fix: add missing edit field with pakaging option on
This commit is contained in:
parent
ff739dcbd2
commit
df4b208de1
@ -1664,9 +1664,9 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$coeff = intval($qty / $prod->packaging) + 1;
|
||||
$qty = $prod->packaging * $coeff;
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
}
|
||||
}
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
}
|
||||
} else {
|
||||
$product_type = $type;
|
||||
|
||||
@ -272,7 +272,7 @@ class ProductFournisseur extends Product
|
||||
$charges = price2num($charges, 'MU');
|
||||
$qty = price2num($qty, 'MS');
|
||||
$unitBuyPrice = price2num($buyprice / $qty, 'MU');
|
||||
$packaging = ($this->packaging < $qty) ? $qty : $this->packaging;
|
||||
$packaging = price2num((($this->packaging < $qty) ? $qty : $this->packaging), 'MS');
|
||||
|
||||
$error = 0;
|
||||
$now = dol_now();
|
||||
|
||||
@ -339,6 +339,7 @@ UseProductFournDesc=Add a feature to define the descriptions of products defined
|
||||
ProductSupplierDescription=Vendor description for the product
|
||||
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
|
||||
PackagingForThisProduct=Packaging
|
||||
PackagingForThisProductDesc=On supplier order, you will automaticly order this quantity (or a multiple of this quantity). Cannot be less than minimum buying quantity
|
||||
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
|
||||
|
||||
#Attributes
|
||||
|
||||
@ -230,10 +230,9 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO : may be remove, already done in class update_buyprice
|
||||
if (empty($packaging)) $packaging = 1;
|
||||
|
||||
if ($packaging < $quantity) $packaging = $quantity;
|
||||
|
||||
$object->packaging = $packaging;
|
||||
|
||||
if (!$error)
|
||||
@ -529,6 +528,28 @@ if ($id > 0 || $ref)
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||
// Packaging
|
||||
print '<tr>';
|
||||
|
||||
print '<td class="fieldrequired">'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'</td>';
|
||||
print '<td>';
|
||||
$packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'nohtml'), 'MS') : "1";
|
||||
if ($rowid)
|
||||
{
|
||||
print '<input type="hidden" name="packaging" value="'.$object->packaging.'">';
|
||||
print price2num($object->packaging, 'MS');
|
||||
} else {
|
||||
print '<input class="flat" name="packaging" size="5" value="'.$packaging.'">';
|
||||
}
|
||||
// Units
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
$unit = $object->getLabelOfUnit();
|
||||
if ($unit !== '') {
|
||||
print ' '.$langs->trans($unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Vat rate
|
||||
$default_vat = '';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user