diff --git a/import2ledger/importers/nbpy2017.py b/import2ledger/importers/nbpy2017.py index 9e35eb6..31927c2 100644 --- a/import2ledger/importers/nbpy2017.py +++ b/import2ledger/importers/nbpy2017.py @@ -63,7 +63,7 @@ class Invoice2017: self.actions def _strpdate(self, s): - date_s = strparse.rejoin_slice_words(s, slice(2), ',', 2) + date_s = strparse.rejoin_slice_words(s, slice(2), ',', 2).replace('Sept.', 'Sep.') return strparse.date(date_s, '%b. %d, %Y') def _read_invoice_header(self, table, first_row_text, rows_text): diff --git a/tests/data/imports.yml b/tests/data/imports.yml index b0216d7..41dd760 100644 --- a/tests/data/imports.yml +++ b/tests/data/imports.yml @@ -237,7 +237,7 @@ expect: - payee: Python Person C ledger template: nbpy2017 invoice ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 5] + date: !!python/object/apply:datetime.date [2017, 9, 5] amount: !!python/object/apply:decimal.Decimal ["55.00"] tickets_sold: !!python/object/apply:decimal.Decimal ["1"] ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"] @@ -245,11 +245,11 @@ shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"] status: Invoice currency: USD - invoice_date: !!python/object/apply:datetime.date [2017, 10, 5] + invoice_date: !!python/object/apply:datetime.date [2017, 9, 5] invoice_id: "11" - payee: Python Person C ledger template: nbpy2017 payment ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 5] + date: !!python/object/apply:datetime.date [2017, 9, 5] amount: !!python/object/apply:decimal.Decimal ["55.00"] tickets_sold: !!python/object/apply:decimal.Decimal ["1"] ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"] @@ -257,7 +257,7 @@ shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"] status: Payment currency: USD - invoice_date: !!python/object/apply:datetime.date [2017, 10, 5] + invoice_date: !!python/object/apply:datetime.date [2017, 9, 5] payment_id: ch_daer0ahwoh9oDeiqu2eimoD7 stripe_id: ch_daer0ahwoh9oDeiqu2eimoD7 invoice_id: "11" diff --git a/tests/data/nbpy2017c.html b/tests/data/nbpy2017c.html index 72734a9..fb7ed95 100644 --- a/tests/data/nbpy2017c.html +++ b/tests/data/nbpy2017c.html @@ -155,8 +155,8 @@ - - + +
Number 11
Status Refunded
Issue date Oct. 5, 2017
Due Oct. 6, 2017, 9:09 p.m.
Issue date Sept. 5, 2017
Due Sept. 6, 2017, 9:09 p.m.
Recipient Python Person C
Anycountry
@@ -225,12 +225,12 @@ Amount - Oct. 5, 2017, 9:14 p.m. + Sept. 5, 2017, 9:14 p.m. Paid with Stripe reference: ch_daer0ahwoh9oDeiqu2eimoD7 55.00 - Oct. 8, 2017, 3:20 p.m. + Sept. 8, 2017, 3:20 p.m. Generated credit note 31 -55.00