need to update packaging quantity
This commit is contained in:
parent
cea6eb279f
commit
c3a900a41c
@ -169,7 +169,7 @@ if (empty($reshook))
|
|||||||
$supplier_description = GETPOST('supplier_description', 'alpha');
|
$supplier_description = GETPOST('supplier_description', 'alpha');
|
||||||
$barcode = GETPOST('barcode', 'alpha');
|
$barcode = GETPOST('barcode', 'alpha');
|
||||||
$fk_barcode_type = GETPOST('fk_barcode_type', 'int');
|
$fk_barcode_type = GETPOST('fk_barcode_type', 'int');
|
||||||
$packaging = GETPOST('packaging', 'int');
|
$packaging = price2num(GETPOST("packaging", 'nohtml'), 'MS');
|
||||||
|
|
||||||
if ($tva_tx == '')
|
if ($tva_tx == '')
|
||||||
{
|
{
|
||||||
@ -230,11 +230,6 @@ 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)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -295,6 +290,10 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$newprice = price2num(GETPOST("price", "alpha"));
|
$newprice = price2num(GETPOST("price", "alpha"));
|
||||||
|
|
||||||
|
if (empty($packaging)) $packaging = 1;
|
||||||
|
if ($packaging < $quantity) $packaging = $quantity;
|
||||||
|
$object->packaging = $packaging;
|
||||||
|
|
||||||
if ($conf->multicurrency->enabled)
|
if ($conf->multicurrency->enabled)
|
||||||
{
|
{
|
||||||
$multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha'));
|
$multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha'));
|
||||||
@ -534,14 +533,9 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
print '<td class="fieldrequired">'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'</td>';
|
print '<td class="fieldrequired">'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'nohtml'), 'MS') : "1";
|
$packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'nohtml'), 'MS') : ((empty($rowid))?"1":price2num($object->packaging, 'MS'));
|
||||||
if ($rowid)
|
print '<input class="flat" name="packaging" size="5" value="'.$packaging.'">';
|
||||||
{
|
|
||||||
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
|
// Units
|
||||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||||
$unit = $object->getLabelOfUnit();
|
$unit = $object->getLabelOfUnit();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user