New: Make things more clear.
This commit is contained in:
parent
0021f7d98e
commit
73b17dc4c5
@ -2446,8 +2446,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraft');
|
||||
if ($statut==1) return $langs->trans('StatusOrderValidated');
|
||||
if ($statut==2) return $langs->trans('StatusOrderSentShort');
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
@ -2455,8 +2455,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort');
|
||||
if ($statut==1) return $langs->trans('StatusOrderValidatedShort');
|
||||
if ($statut==2) return $langs->trans('StatusOrderSentShort');
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
@ -2464,8 +2464,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraftShort');
|
||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$langs->trans('StatusOrderValidatedShort');
|
||||
if ($statut==2) return img_picto($langs->trans('StatusOrderSent'),'statut3').' '.$langs->trans('StatusOrderSentShort');
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort');
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
@ -2473,8 +2473,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
||||
if ($statut==2) return img_picto($langs->trans('StatusOrderSentShort'),'statut3');
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
@ -2482,8 +2482,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1').' '.$langs->trans('StatusOrderValidated');
|
||||
if ($statut==2) return img_picto($langs->trans('StatusOrderSentShort'),'statut3').' '.$langs->trans('StatusOrderSent');
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
@ -2491,8 +2491,8 @@ class Commande extends CommonOrder
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
if ($statut==1) return $langs->trans('StatusOrderValidatedShort').' '.img_picto($langs->trans('StatusOrderValidated'),'statut1');
|
||||
if ($statut==2) return $langs->trans('StatusOrderSentShort').' '.img_picto($langs->trans('StatusOrderSent'),'statut3');
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort').' '.img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
if ($statut==3 && (! $facturee && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort').' '.img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && ($facturee || ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessedShort').' '.img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -859,7 +859,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer)
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->commande->cloturer)
|
||||
else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer)
|
||||
{
|
||||
$result = $object->cloture($user);
|
||||
if ($result < 0) $mesgs=$object->errors;
|
||||
@ -1648,9 +1648,9 @@ else
|
||||
/*
|
||||
* Confirmation de la cloture
|
||||
*/
|
||||
if ($action == 'close')
|
||||
if ($action == 'shipped')
|
||||
{
|
||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close', '', 0, 1);
|
||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2115,6 +2115,7 @@ else
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
||||
}
|
||||
|
||||
|
||||
// Create bill and Classify billed
|
||||
if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed)
|
||||
{
|
||||
@ -2122,17 +2123,16 @@ else
|
||||
{
|
||||
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>';
|
||||
}
|
||||
|
||||
if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER))
|
||||
if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORsKFLOW_BILL_ON_SHIPMENT))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Close
|
||||
// Set to shipped
|
||||
if (($object->statut == 1 || $object->statut == 2) && $user->rights->commande->cloturer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans('Close').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a>';
|
||||
}
|
||||
|
||||
// Clone
|
||||
|
||||
@ -152,6 +152,7 @@ class InterfaceWorkflowManager
|
||||
if ($action == 'BILL_PAYED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
|
||||
@ -1288,8 +1288,8 @@ else
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
|
||||
// Create bill and Classify billed
|
||||
if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed)
|
||||
// Create bill and Close shipment
|
||||
if ($conf->facture->enabled && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
@ -1298,10 +1298,12 @@ else
|
||||
//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>';
|
||||
}
|
||||
|
||||
// TODO add alternative status
|
||||
if ($user->rights->expedition->creer && $object->statut > 0)
|
||||
if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
|
||||
$label="Close";
|
||||
// Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
|
||||
if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) $label="ClassifyBilled";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans($label).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -152,7 +152,7 @@ if ($id > 0 || ! empty($ref))
|
||||
*/
|
||||
if ($action == 'cloture')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseOrder"),$langs->trans("ConfirmCloseOrder"),"confirm_cloture");
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture");
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user