From 13d9059da890c7ba9484eb4ab27393aeeef88830 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 --- 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 13f8d19943a..05a18563894 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -1171,12 +1171,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.34.1