From 2913f054790de8cb5d154c1a8f97752acbd040dc Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 31 Dec 2019 18:18:31 -0800 Subject: [PATCH] fixed one invoice type and added another. --- src/clj/auto_ap/parse/templates.clj | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/parse/templates.clj b/src/clj/auto_ap/parse/templates.clj index 07087551..a0bba1a6 100644 --- a/src/clj/auto_ap/parse/templates.clj +++ b/src/clj/auto_ap/parse/templates.clj @@ -100,7 +100,7 @@ :extract {:date #"0430\n(.*)" :customer-identifier #"Account:(?:.*\n)(.*(?=\s{2,}))" :invoice-number #"Invoice#: (\d+)" - :total #"Invoice Total\s+([0-9]+\.[0-9]{2})"} + :total #"Invoice Total\s+([0-9,]+\.[0-9]{2})"} :parser {:date [:clj-time "EEE MMM dd, yyyy HH:mm aa"] :total [:trim-commas nil]}} @@ -197,6 +197,16 @@ :multi #"\n" :multi-match? #"^\s+[0-9]+/[0-9]+/[0-9]+\s+\d+\s+(INV|C/M)\s+"} + ;; A&B Invoice + {:vendor "A&B Produce" + :keywords [#"415-656-0254"] + :extract {:date #"([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"BILL TO.*\n.*?\s{2,}(.*?)\s{2,}" + :invoice-number #"INVOICE#\n.*?(\d+)\n" + :total #"INV TOTAL \s+([\d\.\-]+)"} + :parser {:date [:clj-time "MM/dd/yyyy"] + :total [:trim-commas-and-negate nil]}} + ;; CHEF's CHOICE {:vendor "Chef's Choice Produce Co" :keywords [#"(2170 MARTIN AVENUE|213-3886)"]