From de31d916388647ca1ba30711a047c8eadf1e744f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 26 May 2023 12:50:41 +0000 Subject: [PATCH] Bug 33783: (bug 8179 follow-up) Populate actual cost with ecost during receiving if not set This restores behavior prior to 8179 to use the estimated cost when receiving if the actual cost is not set. We set the unitprice in the table row so that it will be used when editing and will be saved even if not adjusted To test: 1 - Add some orders to a basket, do not set actual cost field 2 - Close basket, receive orders 3 - Note actual cost field is blank 4 - Cancel receipt 5 - Apply patch 6 - Receive again 7 - Note actual cost is populated 8 - Complete receipt and confirm actual cost correctly saved Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 9f006ad862..5c39f380d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -690,7 +690,7 @@ var effective_create_items = row.basket.create_items || AcqCreateItem; params['tax_rate'] = (effective_create_items == 'receiving')?row.tax_rate_on_receiving:row.tax_rate_on_ordering; params['replacementprice'] = row.replacement_price; - params['unitprice'] = invoiceincgst=="1"?row.unit_price_tax_included:row.unit_price_tax_excluded; + params['unitprice'] = ( invoiceincgst=="1" ) ? ( row.unit_price_tax_included || row.ecost_tax_included ) : ( row.unit_price_tax_excluded || row.ecost_tax_excluded ); params['order_internalnote'] = row.internal_note; if(effective_create_items == 'receiving') { Object.keys(row.items).forEach(function(key) { -- 2.39.5