consolidate sales summary ledger entry creation into upsert-sales-summary tx
Move journal entry calculation and creation from the reconcile-ledger background job into the upsert-sales-summary tx function. Now any save of a sales summary (job recalculation, admin edit wizard, or manual touch) automatically creates the journal entry if balanced with all accounts mapped, or retracts it if conditions no longer hold. Eliminates the need for a separate upsert-sales-summary-ledger call and the reconcile ledger pass for sales summaries.
This commit is contained in:
@@ -483,7 +483,7 @@
|
||||
edit-schema)
|
||||
(submit [this {:keys [multi-form-state request-method identity] :as request}]
|
||||
(let [result (:snapshot multi-form-state )
|
||||
transaction [:upsert-entity {:db/id (:db/id result)
|
||||
transaction [:upsert-sales-summary {:db/id (:db/id result)
|
||||
:sales-summary/items (map
|
||||
(fn [i]
|
||||
(if (:sales-summary-item/manual? i)
|
||||
|
||||
Reference in New Issue
Block a user