From 23b374c52977de2268a98620fc0f3f0dc05e6791 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sun, 17 Nov 2019 19:58:10 -0800 Subject: [PATCH] another vendor. --- src/clj/auto_ap/parse/templates.clj | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/parse/templates.clj b/src/clj/auto_ap/parse/templates.clj index 7bacb01f..f0929264 100644 --- a/src/clj/auto_ap/parse/templates.clj +++ b/src/clj/auto_ap/parse/templates.clj @@ -5,7 +5,9 @@ (def pdf-templates - [{:vendor "CHFW" + [ + ;; CHEF's WAREHOUSE + {:vendor "CHFW" :keywords [#"CHEF'S WAREHOUSE"] :extract {:total #"2 WKS C\.C\.\s+([\d.,]+)" :customer-identifier #"\n([A-Z][A-Z ]+)\s{2,}" @@ -13,6 +15,7 @@ :invoice-number #"\s+[0-9]+/[0-9]+/[0-9]+\s+([0-9]+)"} :parser {:date [:clj-time "MM/dd/yyyy"]}} + ;; GGM {:vendor "Golden Gate Meat Company, Inc" :keywords [#"Golden Gate Meat"] :extract {:total #"Invoice Total\:\s+\$([\d.,]+)" @@ -22,6 +25,7 @@ :parser {:date [:clj-time "MM/dd/yyyy"] :total [:trim-commas nil]}} + ;; CINTAS {:vendor "CINTAS" :keywords [#"CINTAS CORPORATION"] :extract {:invoice-number #"INVOICE\s#\s+([\d.,]+)" @@ -31,6 +35,7 @@ :parser {:date [:clj-time "MM/dd/yy"]} :multi #"\f\f"} + ;; CARBONIC {:vendor "Carbonic Service Inc" :keywords [#"CARBONIC SERVICE INC"] :extract {:invoice-number #"Invoice #\s*\n\s*[\w\.]+\s+[\w\./]+(.*)\s*\n" @@ -38,6 +43,8 @@ :date #"Invoice #\s*\n\s*[\w\.]+\s+([\w\./]+)" :total #"Total\s+\$([0-9.]+)"} :parser {:date [:clj-time "MM/dd/yy"]}} + + ;; DVW {:vendor "DVW Commercial" :keywords [#"DVW Commercial"] :extract {:date #"\s*([0-9]+/[0-9]+/[0-9]+)" @@ -45,6 +52,8 @@ :invoice-number #"Invoice\s*\n\s*([\w\./]+)*" :total #"Total:\s+\$ ([0-9.]+)"} :parser {:date [:clj-time "MM/dd/yy"]}} + + ;; DAYLIGHT FOOD {:vendor "Daylight Foods" :keywords [#"DAYLIGHT FOODS"] :extract {:date #"\n\s*Date[^\n]+\n\s*([0-9]+/[0-9]+/[0-9]+)" @@ -52,6 +61,8 @@ :invoice-number #"Invoice\s([\w\./]+)*" :total #"Total Invoice\s+([0-9.]+)"} :parser {:date [:clj-time "MM/dd/yy"]}} + + ;; SOUTHBAY FRESH {:vendor "Southbay Fresh Produce" :keywords [#"SOUTH BAY FRESH PRODUCE"] :extract {:date #"^([0-9]+/[0-9]+/[0-9]+)" @@ -61,6 +72,8 @@ :parser {:date [:clj-time "MM/dd/yyyy"]} :multi #"\n" :multi-match? #"^[0-9]+/[0-9]+/[0-9]+\s+INV "} + + ;; PFG - LEDYARD {:vendor "Performance Food Group - LEDYARD" :keywords [#"performancefoodservice"] :extract {:date #"DELIVER TO[^\n]+\n.+?(?=[0-9]+/[0-9]+/[0-9]+)([0-9]+/[0-9]+/[0-9]+)" @@ -68,6 +81,8 @@ :invoice-number #"DELIVER TO[^\n]+\n.+?(?=\d+)(\d+)\s*\n" :total #"([0-9.]+)\s+Status Code"} :parser {:date [:clj-time "MM/dd/yy"]}} + + ;; US FOODS {:vendor "US Foods" :keywords [#"US Foods"] :extract {:date #"INVOICE NUMBER[^\n]+\n\n\d+\s+\d+\s+([0-9]+/[0-9]+/[0-9]+)" @@ -75,6 +90,8 @@ :invoice-number #"INVOICE NUMBER[^\n]+\n\n\d+\s+(\d+)" :total #"DELIVERED AMOUNT\s+\$([0-9.]+)"} :parser {:date [:clj-time "MM/dd/yyyy"]}} + + ;; SYSCO {:vendor "Sysco" :keywords [#"SYSCO"] :extract {:date #"INVOICE NUMBER[^\n]+\n([^\n]+)\n" @@ -82,6 +99,8 @@ :invoice-number #"INVOICE NUMBER[^\n]+\n[^\n]+\n.*?(?=[\d]{9})(\d{9})" :total #"\s{2,}INVOICE\s{2,}.*?(?=TOTAL)TOTAL\s+([0-9.]+)"} :parser {:date [:clj-time "MM/dd/yyyy"]}} + + ;; LE BOULANGER {:vendor "Le Boulanger" :keywords [#"Le Boulanger"] :extract {:date #"Invoice Date: ([^\n]+)\n" @@ -89,6 +108,9 @@ :invoice-number #"Invoice No: ([^\n]+)\n" :total #" Total:\s+([\d\.]+)"} :parser {:date [:clj-time "MMM dd, yyyy"]}} + + + ;; A&B {:vendor "A&B Produce" :keywords [#"ABProduce"] :extract {:date #"^\s+([0-9]+/[0-9]+/[0-9]+)" @@ -98,6 +120,20 @@ :parser {:date [:clj-time "MM/dd/yyyy"]} :multi #"\n" :multi-match? #"^\s+[0-9]+/[0-9]+/[0-9]+\s+\d+\s+INV\s+"} + + ;; CHEF's CHOICE + {:vendor "Chef's Choice Produce Co" + :keywords [#"2170 MARTIN AVENUE"] + :extract {:date #"([0-9]{10,10})\s+INVOICE" + :customer-identifier #"\n B\s+([A-Za-z ']+)\s+I " + :invoice-number #"([0-9]+)\s+[0-9]{10,10}\s+INVOICE" + :total #"INVOICE\s+([\d\.]+)"} + :parser {:date [:clj-time "MM1dd1yyyy"]} + :multi #"\n" + :multi-match? #"\s+INVOICE\s+"} + + + ;; PFG - ROMA {:vendor "Performance Food Group - ROMA" :keywords [#"Performance Food Group, Inc\n\f"] :extract {:date #"Date: ([0-9]+/[0-9]+/[0-9]+)"