From 5558b888330fae01d9bd4f45bd268204fcac0cc7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 30 May 2023 14:23:59 -0300 Subject: [PATCH] Bug 33783: Only use ecost if unitprice has not been set on ordering Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3100d18d9f..716a8741fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -1161,12 +1161,12 @@ if(invoiceincgst == "1") { rrp_txt = Number(row.rrp_tax_included).format_price()+' '+ADJ_TAX_INC.format(active_currency)+""; ecost_txt = Number(row.ecost_tax_included).format_price()+' '+TAX_INC+""; - $("#unitprice").val(Number(row.ecost_tax_included).format_price()); + $("#unitprice").val(row.unit_price_tax_included > 0 ? Number(row.unit_price_tax_included).format_price() : Number(row.ecost_tax_included).format_price()); $("#unitprice_hint").html(TAX_INC); } else { rrp_txt = Number(row.rrp_tax_excluded).format_price()+' '+ADJ_TAX_EXC.format(active_currency)+""; ecost_txt = Number(row.ecost_tax_excluded).format_price()+' '+TAX_EXC+""; - $("#unitprice").val(Number(row.ecost_tax_excluded).format_price()); + $("#unitprice").val(row.unit_price_tax_excluded > 0 ? Number(row.unit_price_tax_excluded).format_price() : Number(row.ecost_tax_excluded).format_price()); $("#unitprice_hint").html(TAX_EXC); } $("#rrp").html(rrp_txt); -- 2.39.5