Update Stripe importer to rename tax field

This reflects the current CSV output from the "Export" button.
This commit is contained in:
Ben Sturmfels 2023-05-17 22:39:44 +10:00
parent 950c7fd644
commit 5f1315b4e4
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -1,15 +1,14 @@
import decimal
from . import _csv from . import _csv
from .. import strparse from .. import strparse
class PaymentImporter(_csv.CSVImporterBase): class PaymentImporter(_csv.CSVImporterBase):
NEEDED_FIELDS = frozenset([ NEEDED_FIELDS = frozenset([
'Converted Currency', 'Converted Currency',
'Created (UTC)', 'Created (UTC)',
'Fee', 'Fee',
'Status', 'Status',
'Tax', 'Taxes On Fee',
]) ])
COPIED_FIELDS = { COPIED_FIELDS = {
'Card Name': 'payee', 'Card Name': 'payee',
@ -31,7 +30,7 @@ class PaymentImporter(_csv.CSVImporterBase):
'currency': row['Converted Currency'].upper(), 'currency': row['Converted Currency'].upper(),
'date': strparse.date(date_s, self.DATE_FMT), 'date': strparse.date(date_s, self.DATE_FMT),
'fee': strparse.currency_decimal(row['Fee']), 'fee': strparse.currency_decimal(row['Fee']),
'tax': strparse.currency_decimal(row['Tax']), 'tax': strparse.currency_decimal(row['Taxes On Fee']),
} }