FIX Can't create a stock transfer from product card
This commit is contained in:
parent
77fcbd3884
commit
608c93702d
@ -185,7 +185,7 @@ if ($action == "correct_stock" && ! $cancel)
|
||||
// Transfer stock from a warehouse to another warehouse
|
||||
if ($action == "transfert_stock" && ! $cancel)
|
||||
{
|
||||
if (! (GETPOST("id_entrepot_source",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0))
|
||||
if (! (GETPOST("id_entrepot",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$error++;
|
||||
@ -197,7 +197,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
||||
$error++;
|
||||
$action='transfert';
|
||||
}
|
||||
if (GETPOST("id_entrepot_source",'int') == GETPOST("id_entrepot_destination",'int'))
|
||||
if (GETPOST("id_entrepot",'int') == GETPOST("id_entrepot_destination",'int'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorSrcAndTargetWarehouseMustDiffers"), null, 'errors');
|
||||
$error++;
|
||||
@ -255,7 +255,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
||||
}
|
||||
else
|
||||
{
|
||||
$srcwarehouseid=GETPOST('id_entrepot_source','int');
|
||||
$srcwarehouseid=GETPOST('id_entrepot','int');
|
||||
$batch=GETPOST('batch_number');
|
||||
$eatby=$d_eatby;
|
||||
$sellby=$d_sellby;
|
||||
@ -292,7 +292,7 @@ if ($action == "transfert_stock" && ! $cancel)
|
||||
// Remove stock
|
||||
$result1=$object->correct_stock(
|
||||
$user,
|
||||
GETPOST("id_entrepot_source"),
|
||||
GETPOST("id_entrepot"),
|
||||
GETPOST("nbpiece"),
|
||||
1,
|
||||
GETPOST("label"),
|
||||
@ -391,6 +391,7 @@ if ($id > 0 || $ref)
|
||||
{
|
||||
$object = new Product($db);
|
||||
$result = $object->fetch($id,$ref);
|
||||
|
||||
$object->load_stock();
|
||||
|
||||
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
@ -677,7 +678,7 @@ if ((! empty($conf->productbatch->enabled)) && $object->hasbatch())
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.pmp, ps.rowid as product_stock_id";
|
||||
$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
|
||||
@ -703,9 +704,10 @@ if ($resql)
|
||||
$entrepotstatic->id=$obj->rowid;
|
||||
$entrepotstatic->libelle=$obj->label;
|
||||
$entrepotstatic->lieu=$obj->lieu;
|
||||
$stock_real = round($obj->reel, 10);
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td colspan="4">'.$entrepotstatic->getNomUrl(1).'</td>';
|
||||
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
|
||||
print '<td align="right">'.$stock_real.($stock_real < 0 ?' '.img_warning():'').'</td>';
|
||||
// PMP
|
||||
print '<td align="right">'.(price2num($object->pmp)?price2num($object->pmp,'MU'):'').'</td>';
|
||||
// Value purchase
|
||||
|
||||
Loading…
Reference in New Issue
Block a user