From d089cfa32cbf4c9c8553e57d716e58858bd10d2c Mon Sep 17 00:00:00 2001 From: Ants-In <73986823+Ants-In@users.noreply.github.com> Date: Sun, 25 Sep 2022 09:22:44 +0200 Subject: [PATCH] fix21543 --- htdocs/core/tpl/objectline_create.tpl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 2956e71178f..d16da640c7e 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -952,13 +952,15 @@ if (!empty($usemargins) && $user->rights->margins->creer) { var discount = parseFloat($('option:selected', this).attr('data-discount')); if (isNaN(discount)) { discount = parseFloat(jQuery('#idprodfournprice').attr('data-discount'));} - /* var tva_tx = $('option:selected', this).data('tvatx'); */ + var tva_tx = $('option:selected', this).data('tvatx'); /* FIX21543 */ console.log("We find supplier price :"+up+" qty: "+qty+" tva_tx="+tva_tx+" discount: "+discount+" for product "+jQuery('#idprodfournprice').val()); jQuery("#price_ht").val(up); /* $('#tva_tx option').removeAttr('selected').filter('[value='+tva_tx+']').prop('selected', true); */ + $('#tva_tx option').val(tva_tx); /* FIX21543 */ + if (jQuery("#qty").val() < qty) { jQuery("#qty").val(qty); }