invoice fixups.

This commit is contained in:
2021-12-10 07:42:50 -08:00
parent 4a7215a74b
commit 35e7dda7af
4 changed files with 60 additions and 41 deletions

View File

@@ -214,7 +214,7 @@
(try
(f entry)
(catch Exception e
(log/warn e)
(log/warn (.getMessage e))
(assoc entry :error (.getMessage e)
:status (or (:status (ex-data e))
:error))))))
@@ -371,6 +371,7 @@
retraction (mapv (fn [x] [:db/retractEntity [:journal-entry/external-id (:external_id x)]])
success)]
(log/info "manual ledger import has " (count success) " new rows")
(log/info errors)
(audit-transact-batch retraction (:id context))

View File

@@ -166,7 +166,10 @@
:total #"Total\s+([0-9\.,]+)"
:account-number #"Customer No.\s+(.*?)\s{2}"}
:parser {:date [:clj-time "MM/dd/yy"]
:total [:trim-commas nil]}}
:total [:trim-commas nil]}
:multi (. java.util.regex.Pattern (compile (-> \formfeed str) java.util.regex.Pattern/CASE_INSENSITIVE))
:multi-match? #"Customer No\."
}
;; AUTO-CHLOR
{:vendor "Auto-Chlor"
@@ -211,6 +214,18 @@
:parser {:date [:clj-time "MM/dd/yy"]
:total [:trim-commas-and-negate nil]}}
;;; credits don't have the same format
{:vendor "General Produce Company"
:keywords [#"1330 NORTH B"]
:extract {:date #"DATE.*\n.*\n.*?([0-9]+/[0-9]+/[0-9]+)"
:customer-identifier #"SPECIAL INSTRUCTIONS.*\n\s+(.*?)\s{2,}"
:invoice-number #"CREDIT NO.*\n.*\n.*?(\d{5,}?)\s+"
:account-number #"CUST NO.*\n.*\n\s+(\d+)"
:total #"TOTAL:\s+\|\s*(.*)"}
:parser {:date [:clj-time "MM/dd/yy"]
:total [:trim-commas-and-negate nil]}}
;; Young's Market Co new statement
{:vendor "Youngs Market"
:keywords [#"(YOUNG'S MARKET COMPANY|Young.*Statement)"]

View File

@@ -367,8 +367,8 @@
(log/info "COUNT" (count (transactions->txs transactions transaction->bank-account (rm/rule-applying-fn all-rules) (get-existing))))
(doseq [tx (transactions->txs transactions transaction->bank-account (rm/rule-applying-fn all-rules) (get-existing))]
(log/info "transacting" tx)
(audit-transact tx {:user/name "Yodlee import"
(audit-transact tx {:user/name "Yodlee import2"
:user/role ":admin"})))))))