From e791e4924f4bfb58044420ff5ab495f3ff5cf8c1 Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Tue, 9 Jun 2020 22:12:13 +0100 Subject: Add debit field to convert command This changes the error reported when a transaction with no amount is imported. --- src/csv.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/csv.h') diff --git a/src/csv.h b/src/csv.h index 274ecc7e..9747a775 100644 --- a/src/csv.h +++ b/src/csv.h @@ -51,6 +51,8 @@ class xact_t; class journal_t; class account_t; +DECLARE_EXCEPTION(csv_error, std::runtime_error); + class csv_reader { parse_context_t context; @@ -60,7 +62,8 @@ class csv_reader FIELD_DATE_AUX, FIELD_CODE, FIELD_PAYEE, - FIELD_AMOUNT, + FIELD_CREDIT, + FIELD_DEBIT, FIELD_COST, FIELD_TOTAL, FIELD_NOTE, @@ -72,7 +75,8 @@ class csv_reader mask_t date_aux_mask; mask_t code_mask; mask_t payee_mask; - mask_t amount_mask; + mask_t credit_mask; + mask_t debit_mask; mask_t cost_mask; mask_t total_mask; mask_t note_mask; @@ -87,7 +91,8 @@ public: date_aux_mask("posted( ?date)?"), code_mask("code"), payee_mask("(payee|desc(ription)?|title)"), - amount_mask("amount"), + credit_mask("credit|amount"), + debit_mask("debit"), cost_mask("cost"), total_mask("total"), note_mask("note") { -- cgit v1.2.3