Skip to content

Commit

Permalink
fix: only emit filing account metadata if configured #97
Browse files Browse the repository at this point in the history
  • Loading branch information
redstreet committed Apr 4, 2024
1 parent 45fb855 commit 383a82f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions beancount_reds_importers/importers/workday/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ 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 {}

0 comments on commit 383a82f

Please sign in to comment.