Add Bonanza Produce multi-invoice statement template
- Added multi-invoice template for Bonanza Produce with :multi and :multi-match? flags - Template uses keywords for statement header to identify multi-invoice format - Extracts invoice-number, date, customer-identifier (from RETURN line), and total - Parses 4 invoices from statement PDF 13595522.pdf - All tests pass (29 assertions, 0 failures, 0 errors) - Added test: parse-bonanza-produce-statement-13595522 - Updated invoice-template-creator skill: emphasized test-first approach
This commit is contained in:
@@ -753,7 +753,7 @@
|
||||
:multi #"\n"
|
||||
:multi-match? #"INV #"}
|
||||
|
||||
;; Bonanza Produce
|
||||
;; Bonanza Produce
|
||||
{:vendor "Bonanza Produce"
|
||||
:keywords [#"530-544-4136"]
|
||||
:extract {:invoice-number #"NO\s+(\d{8,})\s+\d{2}/\d{2}/\d{2}"
|
||||
@@ -762,7 +762,19 @@
|
||||
:account-number #"(?s)L\s+([0-9][A-Z0-9\s]+?)(?=\s{2,}|\n)"
|
||||
:total #"SHIPPED\s+[\d\.]+\s+TOTAL\s+([\d\.]+)"}
|
||||
:parser {:date [:clj-time "MM/dd/yy"]
|
||||
:total [:trim-commas nil]}}])
|
||||
:total [:trim-commas nil]}}
|
||||
|
||||
;; Bonanza Produce Statement (multi-invoice)
|
||||
{:vendor "Bonanza Produce"
|
||||
:keywords [#"The perishable agricultural commodities" #"SPARKS, NEVADA"]
|
||||
:extract {:invoice-number #"^\s+[0-9]{2}/[0-9]{2}/[0-9]{2}\s+([0-9]+)\s+INVOICE"
|
||||
:customer-identifier #"(.*?)\s+RETURN"
|
||||
:date #"^\s+([0-9]{2}/[0-9]{2}/[0-9]{2})"
|
||||
:total #"^\s+[0-9]{2}/[0-9]{2}/[0-9]{2}\s+[0-9]+\s+INVOICE\s+([\d.]+)"}
|
||||
:parser {:date [:clj-time "MM/dd/yy"]
|
||||
:total [:trim-commas nil]}
|
||||
:multi #"\n"
|
||||
:multi-match? #"\s+[0-9]{2}/[0-9]{2}/[0-9]{2}\s+[0-9]+\s+INVOICE"}])
|
||||
|
||||
(def excel-templates
|
||||
[{:vendor "Mama Lu's Foods"
|
||||
|
||||
Reference in New Issue
Block a user