Fix: If shipment is closed before delivery element is generated, there
was no way to generate it again (dead lock situation).
This commit is contained in:
parent
4c60740623
commit
7e1a74cef1
@ -613,7 +613,7 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($conf->livraison_bon->enabled)
|
||||
{
|
||||
if ($this->statut == 1)
|
||||
if ($this->statut == 1 || $this->statut == 2)
|
||||
{
|
||||
// Expedition validee
|
||||
include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
|
||||
|
||||
@ -1331,12 +1331,20 @@ else
|
||||
{
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
// TODO until the module is autonomous
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->origin.'&originid='.$object->origin_id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
|
||||
// This is just to generate a delivery receipt
|
||||
if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
||||
}
|
||||
|
||||
// Close
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
|
||||
{
|
||||
$label="Close";
|
||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
||||
@ -1345,11 +1353,6 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->livraison_bon->enabled && $object->statut == 1 && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("DeliveryOrder").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->expedition->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
|
||||
@ -295,7 +295,6 @@ if ($action == 'create')
|
||||
|
||||
/*
|
||||
* Lignes de commandes
|
||||
*
|
||||
*/
|
||||
print '<br><table class="noborder" width="100%">';
|
||||
|
||||
@ -311,9 +310,9 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="54%">'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">Quan. commandee</td>';
|
||||
print '<td align="center">Quan. livree</td>';
|
||||
print '<td align="center">Quan. a livrer</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyReceived").'</td>';
|
||||
print '<td align="center">'.$langs->trans("QtyToShip").'</td>';
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
print '<td width="12%" align="center">'.$langs->trans("Stock").'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user