diff --git a/beancount_reds_importers/importers/workday/__init__.py b/beancount_reds_importers/importers/workday/__init__.py index e8c4261..2a1f08b 100644 --- a/beancount_reds_importers/importers/workday/__init__.py +++ b/beancount_reds_importers/importers/workday/__init__.py @@ -50,3 +50,7 @@ def valid_header_label(label): for header in table.header(): table = table.rename(header, valid_header_label(header)) self.alltables[section] = table + + def build_metadata(self, file, metatype=None, data={}): + acct = self.config.get("filing_account", self.config.get("main_account", None)) + return {"filing_account": acct} diff --git a/beancount_reds_importers/libtransactionbuilder/transactionbuilder.py b/beancount_reds_importers/libtransactionbuilder/transactionbuilder.py index 07694eb..c0082ec 100644 --- a/beancount_reds_importers/libtransactionbuilder/transactionbuilder.py +++ b/beancount_reds_importers/libtransactionbuilder/transactionbuilder.py @@ -53,5 +53,9 @@ def build_metadata(self, file, metatype=None, data={}): # This 'filing_account' is read by a patch to bean-extract so it can output transactions to # a file that corresponds with filing_account, when the one-file-per-account feature is # used. - acct = self.config.get("filing_account", self.config.get("main_account", None)) - return {"filing_account": acct} + if self.config.get("emit_filing_account_metadata"): + acct = self.config.get( + "filing_account", self.config.get("main_account", None) + ) + return {"filing_account": acct} + return {}