diff --git a/import2ledger/importers/nbpy2017.py b/import2ledger/importers/nbpy2017.py index 31927c2c28f89784d8585b0424569f916179dda8..0e5f89cd2e8df5f4398be026e7847989566fdb19 100644 --- a/import2ledger/importers/nbpy2017.py +++ b/import2ledger/importers/nbpy2017.py @@ -82,14 +82,17 @@ class Invoice2017: self.shirts_sold = decimal.Decimal(0) self.shirt_rate = self.STANDARD_SHIRT_RATE for description, qty, unit_price, total in rows_text: + if qty is None: + continue + total = strparse.currency_decimal(total) + self.amount += total if description.startswith('Ticket - '): - self.tickets_sold += 1 + if total > 0: + self.tickets_sold += 1 elif description.startswith('T-Shirt - '): self.shirts_sold += 1 elif description.startswith('Early Bird ('): self.ticket_rate = self.DISCOUNT_TICKET_RATE - if qty: - self.amount += strparse.currency_decimal(total) def _read_invoice_activity(self, table, first_row_text, rows_text): self.actions = [{