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 strparse
class PaymentImporter(_csv.CSVImporterBase):
NEEDED_FIELDS = frozenset([
'Converted Currency',
'Created (UTC)',
'Fee',
'Status',
'Tax',
'Taxes On Fee',
])
COPIED_FIELDS = {
'Card Name': 'payee',
@ -31,7 +30,7 @@ class PaymentImporter(_csv.CSVImporterBase):
'currency': row['Converted Currency'].upper(),
'date': strparse.date(date_s, self.DATE_FMT),
'fee': strparse.currency_decimal(row['Fee']),
'tax': strparse.currency_decimal(row['Tax']),
'tax': strparse.currency_decimal(row['Taxes On Fee']),
}