diff --git a/import2ledger/importers/nbpy2017.py b/import2ledger/importers/nbpy2017.py index 0e5f89cd2e8df5f4398be026e7847989566fdb19..c0109cab3aec1734ed890f8a9878c2e0ecefd041 100644 --- a/import2ledger/importers/nbpy2017.py +++ b/import2ledger/importers/nbpy2017.py @@ -88,9 +88,9 @@ class Invoice2017: self.amount += total if description.startswith('Ticket - '): if total > 0: - self.tickets_sold += 1 + self.tickets_sold += int(qty) elif description.startswith('T-Shirt - '): - self.shirts_sold += 1 + self.shirts_sold += int(qty) elif description.startswith('Early Bird ('): self.ticket_rate = self.DISCOUNT_TICKET_RATE diff --git a/tests/data/imports.yml b/tests/data/imports.yml index f3bfc27322ab69bd7bd6e1b24c9e3e0504dca00e..0303dd2c6b90a7c52a825e9dd31c5128910968cb 100644 --- a/tests/data/imports.yml +++ b/tests/data/imports.yml @@ -238,10 +238,10 @@ - payee: Python Person C ledger template: nbpy2017 invoice ledger entry date: !!python/object/apply:datetime.date [2017, 9, 5] - amount: !!python/object/apply:decimal.Decimal ["30.00"] + amount: !!python/object/apply:decimal.Decimal ["60.00"] tickets_sold: !!python/object/apply:decimal.Decimal ["0"] ticket_rate: !!python/object/apply:decimal.Decimal ["42.50"] - shirts_sold: !!python/object/apply:decimal.Decimal ["1"] + shirts_sold: !!python/object/apply:decimal.Decimal ["2"] shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"] status: Invoice currency: USD @@ -250,10 +250,10 @@ - payee: Python Person C ledger template: nbpy2017 payment ledger entry date: !!python/object/apply:datetime.date [2017, 9, 5] - amount: !!python/object/apply:decimal.Decimal ["30.00"] + amount: !!python/object/apply:decimal.Decimal ["60.00"] tickets_sold: !!python/object/apply:decimal.Decimal ["0"] ticket_rate: !!python/object/apply:decimal.Decimal ["42.50"] - shirts_sold: !!python/object/apply:decimal.Decimal ["1"] + shirts_sold: !!python/object/apply:decimal.Decimal ["2"] shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"] status: Payment currency: USD diff --git a/tests/data/nbpy2017c.html b/tests/data/nbpy2017c.html index cc61c3ab7cef2386952525f30e65f23e6a022db2..1c9446b8f09d55b316b7843d8d2b68b9491ff7de 100644 --- a/tests/data/nbpy2017c.html +++ b/tests/data/nbpy2017c.html @@ -179,9 +179,9 @@ T-Shirt - Men's/Straight Cut Size M - 1 - $30.00 + 2 $30.00 + $60.00 Tutorials - Notify me when tutorials are open @@ -191,11 +191,11 @@ TOTAL - $30.00 + $60.00 Includes donation eligible for tax deduction in the USA: - $4.25 + $9.00 @@ -210,7 +210,7 @@ Balance due: - $30.00 + $60.00 @@ -227,12 +227,12 @@ Sept. 5, 2017, 9:14 p.m. Paid with Stripe reference: ch_daer0ahwoh9oDeiqu2eimoD7 - 30.00 + 60.00 Sept. 8, 2017, 3:20 p.m. Generated credit note 31 - -30.00 + -60.00