Skip to content

Commit

Permalink
feat(minor): overridable add_custom_postings()
Browse files Browse the repository at this point in the history
  • Loading branch information
redstreet committed Feb 3, 2024
1 parent 9a1129a commit 78f9182
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beancount_reds_importers/libtransactionbuilder/investments.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def extract_transactions(self, file, counter):
print("ERROR: unknown entry type:", ot.type)
raise Exception('Unknown entry type')
self.add_fee_postings(entry, ot)
self.add_custom_postings(entry, ot)
new_entries.append(entry)
return new_entries

Expand Down Expand Up @@ -436,6 +437,9 @@ def add_fee_postings(self, entry, ot):
if getattr(ot, 'commission', 0) != 0:
data.create_simple_posting(entry, config['fees'], ot.commission, self.currency)

def add_custom_postings(self, entry, ot):
pass

def extract_custom_entries(self, file, counter):
"""For custom importers to override"""
return []
Expand Down

0 comments on commit 78f9182

Please sign in to comment.