Per invoice seller overrides

This commit is contained in:
Daniel O'Connell 2019-10-08 21:19:36 +02:00
parent 3c4974797e
commit 9fef8fa107
2 changed files with 3 additions and 1 deletions

View File

@ -53,6 +53,7 @@ Each invoice can have the following keys:
* :items - a list of items to be paid for * :items - a list of items to be paid for
* :imap - (optional) email credentials. These are needed if a confirmation email is to be sent * :imap - (optional) email credentials. These are needed if a confirmation email is to be sent
* :callbacks - (optional) a list of commands to be called with the resulting pdf file * :callbacks - (optional) a list of commands to be called with the resulting pdf file
* :seller - (optional) invoice specific overrides for the seller object
### Buyer ### Buyer

View File

@ -38,10 +38,11 @@
(defn prepare-invoice [{seller :seller font :font-path} month worklogs invoice] (defn prepare-invoice [{seller :seller font :font-path} month worklogs invoice]
(-> invoice (-> invoice
(assoc :seller seller) (update :seller (partial merge seller))
(assoc :font-path font) (assoc :font-path font)
(calc-prices worklogs))) (calc-prices worklogs)))
(defn process-invoices [{invoices :invoices :as config} month worklogs] (defn process-invoices [{invoices :invoices :as config} month worklogs]
(let [invoices (map (partial prepare-invoice config month worklogs) invoices)] (let [invoices (map (partial prepare-invoice config month worklogs) invoices)]
(doseq [[i invoice] (map-indexed vector invoices)] (doseq [[i invoice] (map-indexed vector invoices)]