Fix : price by quantity now updates the discount field only if there is not an existing discount greater than the price by quantity one

This commit is contained in:
Maxime Kohlhaas 2013-04-04 20:44:00 +02:00
parent e5085b2a1c
commit 9530e103e8

View File

@ -81,7 +81,7 @@ if (! empty($conf->margin->enabled)) {
'origin_tva_tx_cache' => 'tva_tx',
'origin_price_ttc_cache' => 'price_ttc',
'qty' => 'qty'
//'remise_percent' => 'discount'
,'remise_percent' => 'discount'
),
'update_textarea' => array(
'product_desc' => 'desc'
@ -242,7 +242,7 @@ $(document).ready(function() {
$('#select_type').val(data.type).attr('disabled','disabled').trigger('change');
//$('#price_base_type_area').show();
$('#qty').val(data.qty);
//$('#remise_percent').val(data.discount);
if($('#remise_percent').val() < data.discount) $('#remise_percent').val(data.discount);
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances['product_desc'] != "undefined") {
CKEDITOR.instances['product_desc'].setData(data.desc).focus();