Skip to content
Snippets Groups Projects
Commit 21f0fc82 authored by Alexis Algoud's avatar Alexis Algoud
Browse files

FIX can receive new batch product on supplier order

parent 1ee933c4
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) ...@@ -154,7 +154,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
if (! $error) if (! $error)
{ {
$result = $commande->DispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger); $result = $commande->DispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($commande->error, $commande->errors, 'errors');
...@@ -170,16 +170,17 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) ...@@ -170,16 +170,17 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
//eat-by date dispatch //eat-by date dispatch
//$numline=$reg[2] + 1; // line of product //$numline=$reg[2] + 1; // line of product
$numline=$pos; $numline=$pos;
$prod = "product_".$reg[1]."_".$reg[2]; $prod = 'product_'.$reg[1].'_'.$reg[2];
$qty = "qty_".$reg[1]."_".$reg[2]; $qty = 'qty_'.$reg[1].'_'.$reg[2];
$ent = "entrepot_".$reg[1]."_".$reg[2]; $ent = 'entrepot_'.$reg[1].'_'.$reg[2];
$pu = "pu_".$reg[1]."_".$reg[2]; $pu = 'pu_'.$reg[1].'_'.$reg[2];
$fk_commandefourndet = "fk_commandefourndet_".$reg[1]."_".$reg[2]; $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2];
$lot = "lot_number_".$reg[1]."_".$reg[2]; $lot = 'lot_number_'.$reg[1].'_'.$reg[2];
$dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_'.$reg[1]."_".$reg[2].'month'], $_POST['dluo_'.$reg[1]."_".$reg[2].'day'], $_POST['dluo_'.$reg[1]."_".$reg[2].'year']); $dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_'.$reg[1].'_'.$reg[2].'month'], $_POST['dluo_'.$reg[1].'_'.$reg[2].'day'], $_POST['dluo_'.$reg[1].'_'.$reg[2].'year']);
$dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1]."_".$reg[2].'month'], $_POST['dlc_'.$reg[1]."_".$reg[2].'day'], $_POST['dlc_'.$reg[1]."_".$reg[2].'year']); $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1].'_'.$reg[2].'month'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'day'], $_POST['dlc_'.$reg[1].'_'.$reg[2].'year']);
$fk_commandefourndet = "fk_commandefourndet_".$reg[1]."_".$reg[2]; $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2];
if (GETPOST($qty) > 0) // We ask to move a qty if (GETPOST($qty) > 0) // We ask to move a qty
{ {
if (! (GETPOST($ent,'int') > 0)) if (! (GETPOST($ent,'int') > 0))
...@@ -200,7 +201,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) ...@@ -200,7 +201,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
if (! $error) if (! $error)
{ {
$result = $commande->dispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger); $result = $commande->dispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST('comment'), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($commande->error, $commande->errors, 'errors');
...@@ -225,7 +226,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) ...@@ -225,7 +226,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
} }
} }
if ($result > 0 && ! $error) if ($result >= 0 && ! $error)
{ {
$db->commit(); $db->commit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment