Hi all,
I am wiriting an importer using the shipped CSV one. I wonder what's the proper way to read the row in the categorizer. Here is my current method:
def categorizer(txn, row) -> Transaction:
# Fees column must be included to get correct balance
if self.parse_amount(row[17]): # Fee
create_simple_posting(
entry=txn,
account='Expenses:Financial:Fees',
number=-(self.parse_amount(row[17])),
currency=currency
)
create_simple_posting(
entry=txn,
account=account,
number=self.parse_amount(row[17]),
currency=currency
)
# Balancing entry TODO: categorize
create_simple_posting(
entry=txn,
account='Equity:Opening-Balances',
number=None,
currency=None
)
return txn
You need column index. Currently I can only hardcode it, which is not great. I could get it mapped in `iconfig`, simply pass something like `{ExtCol.Fee: fee_column_name}` in `config`, but I cannot get to `iconfig` in my class.
Is there currently any alternative?
Thanks,
Vlad