Simple excel invoice fix

This commit is contained in:
2021-11-22 21:31:42 -08:00
parent a857b45024
commit 42bd65357f

View File

@@ -164,13 +164,13 @@
(:db/id (d-vendors/account-for-client-id vendor client-id)))
:location default-location
:amount total}]}
(:vendor/terms vendor) (assoc :invoice/due (coerce/to-date
(time/plus date (time/days (d-vendors/terms-for-client-id vendor client-id)))))
automatically-paid-when-due (assoc :invoice/scheduled-payment (coerce/to-date
(time/plus date (time/days (d-vendors/terms-for-client-id vendor client-id)))))
schedule-payment-dom (assoc :invoice/scheduled-payment (coerce/to-date
(next-dom date schedule-payment-dom)
)))
(:vendor/terms vendor) (assoc :invoice/due (coerce/to-date
(time/plus date (time/days (d-vendors/terms-for-client-id vendor client-id)))))
automatically-paid-when-due (assoc :invoice/scheduled-payment (coerce/to-date
(time/plus date (time/days (d-vendors/terms-for-client-id vendor client-id)))))
schedule-payment-dom (assoc :invoice/scheduled-payment (coerce/to-date
(next-dom date schedule-payment-dom)
)))
payment (if (= :invoice-status/paid (:invoice/status invoice))
#:invoice-payment {:invoice (:db/id invoice)
:amount (:invoice/total invoice)
@@ -182,10 +182,9 @@
:status :payment-status/cleared
:date (:invoice/date invoice)})}
)]
[[:propose-invoice invoice] payment])))
(filter identity)
(map remove-nils)
))
[[:propose-invoice (remove-nils invoice)]
(some-> payment remove-nils)])))
(filter identity)))
(defn match-vendor [vendor-code forced-vendor]