FIX: supplier relativ discounts: pre-fill newlines with qty/discount
This commit is contained in:
parent
24ffce0be5
commit
e07177fec2
@ -2482,6 +2482,10 @@ class Form
|
||||
$opt = '<option value="'.$outkey.'"';
|
||||
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected';
|
||||
if (empty($objp->idprodfournprice) && empty($alsoproductwithnosupplierprice)) $opt.=' disabled';
|
||||
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0)
|
||||
{
|
||||
$opt.= ' pbq="'.$objp->idprodfournprice.'" data-pbq="'.$objp->idprodfournprice.'" data-pbqqty="'.$objp->quantity.'" data-pbqpercent="'.$objp->remise_percent.'"';
|
||||
}
|
||||
$opt.= '>';
|
||||
|
||||
$objRef = $objp->ref;
|
||||
|
||||
@ -729,10 +729,11 @@ jQuery(document).ready(function() {
|
||||
?>
|
||||
|
||||
/* To process customer price per quantity */
|
||||
var pbq = $('option:selected', this).attr('data-pbq');
|
||||
var pbqqty = $('option:selected', this).attr('data-pbqqty');
|
||||
var pbqpercent = $('option:selected', this).attr('data-pbqpercent');
|
||||
if (jQuery('#idprod').val() > 0 && typeof pbq !== "undefined")
|
||||
var pbq = parseInt($('option:selected', this).attr('data-pbq'));
|
||||
var pbqqty = parseFloat($('option:selected', this).attr('data-pbqqty'));
|
||||
var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
|
||||
|
||||
if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && typeof pbq !== "undefined")
|
||||
{
|
||||
console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
|
||||
jQuery("#pbq").val(pbq);
|
||||
@ -786,7 +787,6 @@ function setforfree() {
|
||||
jQuery("#tva_tx").show();
|
||||
jQuery("#buying_price").val('').show();
|
||||
jQuery("#fournprice_predef").hide();
|
||||
jQuery("#title_fourn_ref").show();
|
||||
jQuery("#title_vat").show();
|
||||
jQuery("#title_up_ht").show();
|
||||
jQuery("#title_up_ht_currency").show();
|
||||
@ -810,7 +810,6 @@ function setforpredef() {
|
||||
jQuery("#fourn_ref").hide();
|
||||
jQuery("#tva_tx").hide();
|
||||
jQuery("#buying_price").show();
|
||||
jQuery("#title_fourn_ref").hide();
|
||||
jQuery("#title_vat").hide();
|
||||
jQuery("#title_up_ht").hide();
|
||||
jQuery("#title_up_ht_currency").hide();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user