NEW: When using transfer or correct stock from warehouse, after
recording we go back to the warehouse page.
This commit is contained in:
parent
60a6d8789f
commit
52425648bf
@ -4725,6 +4725,7 @@ function picto_from_langcode($codelang)
|
|||||||
* 'member' to add a tab in fundation member view
|
* 'member' to add a tab in fundation member view
|
||||||
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
|
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||||
* 'ecm' to add a tab for another ecm view
|
* 'ecm' to add a tab for another ecm view
|
||||||
|
* 'stock' to add a tab for warehouse view
|
||||||
* @param string $mode 'add' to complete head, 'remove' to remove entries
|
* @param string $mode 'add' to complete head, 'remove' to remove entries
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -467,14 +467,14 @@ else
|
|||||||
|
|
||||||
if ($user->rights->stock->mouvement->creer)
|
if ($user->rights->stock->mouvement->creer)
|
||||||
{
|
{
|
||||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert">';
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
|
||||||
print img_picto($langs->trans("StockMovement"),'uparrow.png','class="hideonsmartphone"').' '.$langs->trans("StockMovement");
|
print img_picto($langs->trans("StockMovement"),'uparrow.png','class="hideonsmartphone"').' '.$langs->trans("StockMovement");
|
||||||
print "</a></td>";
|
print "</a></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->stock->creer)
|
if ($user->rights->stock->creer)
|
||||||
{
|
{
|
||||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=correction">';
|
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=correction&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
|
||||||
print $langs->trans("StockCorrection");
|
print $langs->trans("StockCorrection");
|
||||||
print "</a></td>";
|
print "</a></td>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $langs->load("stocks");
|
|||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
||||||
|
|
||||||
|
$backtopage=GETPOST('backtopage');
|
||||||
$action=GETPOST("action");
|
$action=GETPOST("action");
|
||||||
$cancel=GETPOST('cancel');
|
$cancel=GETPOST('cancel');
|
||||||
|
|
||||||
@ -160,8 +160,16 @@ if ($action == "correct_stock" && ! $cancel)
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$product->id);
|
if ($backtopage)
|
||||||
exit;
|
{
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$product->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -292,8 +300,17 @@ if ($action == "transfert_stock" && ! $cancel)
|
|||||||
if (! $error && $result1 >= 0 && $result2 >= 0)
|
if (! $error && $result1 >= 0 && $result2 >= 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
header("Location: product.php?id=".$product->id);
|
|
||||||
exit;
|
if ($backtopage)
|
||||||
|
{
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header("Location: product.php?id=".$product->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -594,6 +611,7 @@ if ($id > 0 || $ref)
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'" method="post">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'" method="post">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="correct_stock">';
|
print '<input type="hidden" name="action" value="correct_stock">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Warehouse
|
// Warehouse
|
||||||
@ -681,6 +699,7 @@ if ($id > 0 || $ref)
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'" method="post">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'" method="post">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
if ($pdluoid)
|
if ($pdluoid)
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
|
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user