Bug 33783: Only use ecost if unitprice has not been set on ordering

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomás Cohen Arazi 2023-05-30 14:23:59 -03:00 committed by Jonathan Druart
parent c20921ac1b
commit 5558b88833

View file

@ -1161,12 +1161,12 @@
if(invoiceincgst == "1") {
rrp_txt = Number(row.rrp_tax_included).format_price()+'<span class="hint"> '+ADJ_TAX_INC.format(active_currency)+"</span>";
ecost_txt = Number(row.ecost_tax_included).format_price()+'<span class="hint"> '+TAX_INC+"</span>";
$("#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()+'<span class="hint"> '+ADJ_TAX_EXC.format(active_currency)+"</span>";
ecost_txt = Number(row.ecost_tax_excluded).format_price()+'<span class="hint"> '+TAX_EXC+"</span>";
$("#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);