From 7bc9d434572e6f5871cfe5e4e7484323142560c2 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Fri, 20 Dec 2019 11:50:48 -0800 Subject: [PATCH] even more. --- src/clj/auto_ap/parse/templates.clj | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/clj/auto_ap/parse/templates.clj b/src/clj/auto_ap/parse/templates.clj index f9373b0f..07087551 100644 --- a/src/clj/auto_ap/parse/templates.clj +++ b/src/clj/auto_ap/parse/templates.clj @@ -114,6 +114,48 @@ :parser {:date [:clj-time "MM/dd/yyyy"] :total [:trim-commas nil]}} + ;; REGAL + {:vendor "Regal Wine Co" + :keywords [#"REGAL WINE"] + :extract {:date #"INVOICE DATE.*\n\n(?:.*?)([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"INVOICE\n(.*?)\s{2,}" + :invoice-number #"INVOICE NUMBER.*\n\n(?:.*?)(\d+)" + :total #"Total Amount Due(?:.*?)([0-9,]+\.[0-9]{2})"} + :parser {:date [:clj-time "MM/dd/yy"] + :total [:trim-commas nil]}} + + ;; ALSCO + {:vendor "Alsco" + :keywords [#"Alsco"] + :extract {:date #"Invoice Date:\s+(.*)" + :customer-identifier #"Invoice F o r(?:.*?)\n\s+(.*?)\s{2,}" + :invoice-number #" (\S+)\n\s+Invoice Date" + :total #"Invoice Total\s+\$([0-9,]+\.[0-9]{2})"} + :parser {:date [:clj-time "MMM dd yyyy"] + :total [:trim-commas nil]}} + + ;; SUNCREST + {:vendor "Suncrest USA Inc" + :keywords [#"Suncrest.*Invoice"] + :extract {:date #"Date.*\n\s*\n(?:.*?)([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"Bill To(?:.*?)\n\n(.*?)\s{2,}" + :invoice-number #"Invoice #.*\n\s*\n(?:.*?)\s{2,}(\d{5,})" + :total #"Balance Due\s+\$([0-9,]+\.[0-9]{2})"} + :parser {:date [:clj-time "MM/dd/yyyy"] + :total [:trim-commas nil]}} + + ;; SUNCREST STATEMENT + {:vendor "Suncrest USA Inc" + :keywords [#"Suncrest.*\n.*Statement"] + :extract {:date #"^([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"To:(?:.*?)\n\s*(.*?)\s{2,}" + :invoice-number #"INV #(\d+)" + :total #"Orig\. Amount \$([0-9,]+\.[0-9]{2})"} + :parser {:date [:clj-time "MM/dd/yyyy"] + :total [:trim-commas nil]} + :multi #"\n" + :multi-match? #"^[0-9]+/[0-9]+/[0-9]+\s+INV "} + ;; US FOODS {:vendor "US Foods" :keywords [#"US Foods"]