diff --git a/htdocs/core/tpl/objectline_add.tpl.php b/htdocs/core/tpl/objectline_add.tpl.php index 497d4a294ba..6a7cffcb3fc 100644 --- a/htdocs/core/tpl/objectline_add.tpl.php +++ b/htdocs/core/tpl/objectline_add.tpl.php @@ -80,8 +80,8 @@ if (! empty($conf->margin->enabled)) { 'origin_price_ht_cache' => 'price_ht', 'origin_tva_tx_cache' => 'tva_tx', 'origin_price_ttc_cache' => 'price_ttc', - 'qty' => 'qty' - ,'remise_percent' => 'discount' + 'qty' => 'qty', + 'remise_percent' => 'discount' ), 'update_textarea' => array( 'product_desc' => 'desc' @@ -160,7 +160,10 @@ if (! empty($conf->margin->enabled)) { - % + + % + + margin->enabled)) { @@ -373,6 +376,11 @@ $(document).ready(function() { $('#price_ttc').attr('disabled','disabled'); } + $('#remise_percent').bind('change', function() { + if ($(this).val() < $('#origin_remise_percent').val()) + $('#remise_percent').val($('#origin_remise_percent').val()); + }); + $('#tva_tx').change(function() { if ($(this).val() == 0) { if ($('#idprod').val() == 0) {