diff --git a/README.md b/README.md index 5ebfc44..3e96947 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Each invoice can have the following keys: * :items - a list of items to be paid for * :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 + * :seller - (optional) invoice specific overrides for the seller object ### Buyer diff --git a/src/invoices/core.clj b/src/invoices/core.clj index 978134b..c431798 100644 --- a/src/invoices/core.clj +++ b/src/invoices/core.clj @@ -38,10 +38,11 @@ (defn prepare-invoice [{seller :seller font :font-path} month worklogs invoice] (-> invoice - (assoc :seller seller) + (update :seller (partial merge seller)) (assoc :font-path font) (calc-prices worklogs))) + (defn process-invoices [{invoices :invoices :as config} month worklogs] (let [invoices (map (partial prepare-invoice config month worklogs) invoices)] (doseq [[i invoice] (map-indexed vector invoices)]