From ff2a7176431d4d2736a5468649f677967cff9785 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 --- 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 9f006ad862b..5c39f380d34 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.25.1