switched from auto pay to scheduled payment
This commit is contained in:
@@ -15,12 +15,11 @@
|
||||
|
||||
(let [invoices-to-close (d/query {:query {:find ['?e]
|
||||
:in ['$ '?today]
|
||||
:where ['[?e :invoice/automatically-paid-when-due true]
|
||||
:where ['[?e :invoice/scheduled-payment ?d]
|
||||
'[?e :invoice/status :invoice-status/unpaid]
|
||||
'[?e :invoice/due ?d]
|
||||
'[(<= ?d ?today)]]}
|
||||
:args [(d/db conn) (coerce/to-date (time/local-now))]})]
|
||||
(log/info "Closing " (count invoices-to-close) "automatic invoices")
|
||||
(log/info "Closing " (count invoices-to-close) "scheduled invoices")
|
||||
(some->> invoices-to-close
|
||||
seq
|
||||
|
||||
@@ -29,7 +28,7 @@
|
||||
:invoice/status :invoice-status/paid}))
|
||||
(d/transact conn)
|
||||
deref)
|
||||
(log/info "Closed " (count invoices-to-close) "automatic invoices"))
|
||||
(log/info "Closed " (count invoices-to-close) "scheduled invoices"))
|
||||
(catch Exception e
|
||||
(log/error e)))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user