Fix: When on delivery receipt, ref of shipment was not visible. Also
some tabs were missing. Fix: After deletion of delivery receipt, we must go back to shipment of delivery receipt.
This commit is contained in:
parent
c9ebe7729f
commit
948e0bf753
@ -110,16 +110,15 @@ function delivery_prepare_head($object)
|
|||||||
$head[$h][2] = 'delivery';
|
$head[$h][2] = 'delivery';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
/* We are on id of delivery, no shipment
|
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id;
|
||||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
|
||||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||||
$head[$h][2] = 'contact';
|
$head[$h][2] = 'contact';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
|
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id;
|
||||||
$head[$h][1] = $langs->trans("Notes");
|
$head[$h][1] = $langs->trans("Notes");
|
||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
$h++;*/
|
$h++;
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
|
|||||||
@ -46,6 +46,7 @@ $langs->load('orders');
|
|||||||
|
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
|
$backtourl=GETPOST('backtourl');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
@ -149,7 +150,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
if (! empty($backtourl)) header("Location: ".$backtourl);
|
||||||
|
else header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -464,11 +466,13 @@ else
|
|||||||
$result = $delivery->fetch($id);
|
$result = $delivery->fetch($id);
|
||||||
$delivery->fetch_thirdparty();
|
$delivery->fetch_thirdparty();
|
||||||
|
|
||||||
|
// Origin of a 'livraison' (delivery) is ALWAYS 'expedition' (shipment).
|
||||||
|
// However, origin of shipment in future may differs (commande, proposal, ...)
|
||||||
|
|
||||||
$expedition=new Expedition($db);
|
$expedition=new Expedition($db);
|
||||||
$result = $expedition->fetch($delivery->origin_id);
|
$result = $expedition->fetch($delivery->origin_id);
|
||||||
$typeobject = $expedition->origin;
|
$typeobject = $expedition->origin; // example: commande
|
||||||
|
if ($delivery->origin_id > 0)
|
||||||
if ($delivery->origin_id)
|
|
||||||
{
|
{
|
||||||
$delivery->fetch_origin();
|
$delivery->fetch_origin();
|
||||||
}
|
}
|
||||||
@ -487,14 +491,13 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$expedition_id = $_GET["expid"];
|
$expedition_id = GETPOST("expid");
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&expid='.$expedition_id.'&backtourl='.urlencode($backtourl),$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation
|
* Confirmation de la validation
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if ($action == 'valid')
|
if ($action == 'valid')
|
||||||
{
|
{
|
||||||
@ -508,6 +511,20 @@ else
|
|||||||
*/
|
*/
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Shipment
|
||||||
|
if (($delivery->origin == 'shipment' || $delivery->origin == 'expedition') && $delivery->origin_id > 0)
|
||||||
|
{
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/liste.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<tr><td width="20%">'.$langs->trans("RefSending").'</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
// Nav is hidden because on a delivery receipt of a shipment, if we go on next shipment, we may find no tab (a shipment may not have delivery receipt yet)
|
||||||
|
//print $form->showrefnav($expedition, 'refshipment', $linkback, 1, 'ref', 'ref');
|
||||||
|
print $form->showrefnav($expedition, 'refshipment', $linkback, 0, 'ref', 'ref');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td colspan="3">'.$delivery->ref.'</td></tr>';
|
print '<td colspan="3">'.$delivery->ref.'</td></tr>';
|
||||||
@ -721,7 +738,7 @@ else
|
|||||||
{
|
{
|
||||||
if ($conf->expedition_bon->enabled)
|
if ($conf->expedition_bon->enabled)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?id='.$delivery->id.'&expid='.$delivery->expedition_id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?id='.$delivery->id.'&expid='.$delivery->origin_id.'&action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/expedition/fiche.php?id='.$delivery->origin_id).'">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user