Can create invoice from order only if order is "accepted"
This commit is contained in:
parent
0f3c3d1236
commit
dc3145e5dc
@ -1257,9 +1257,13 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($user->rights->fournisseur->commande->approuver)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$commande->id.'&action=approve">'.$langs->trans("ApproveOrder").'</a>';
|
||||
|
||||
print '<a class="butAction" href="fiche.php?id='.$commande->id.'&action=refuse">'.$langs->trans("RefuseOrder").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("ApproveOrder").'</a>';
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("RefuseOrder").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Send
|
||||
@ -1276,15 +1280,6 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($commande->statut == 2)
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&action=cancel">'.$langs->trans("CancelOrder").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Reopen
|
||||
if ($commande->statut == 5 || $commande->statut == 6 || $commande->statut == 7 || $commande->statut == 9)
|
||||
{
|
||||
@ -1295,7 +1290,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Create bill
|
||||
if ($conf->fournisseur->enabled && $commande->statut > 0)
|
||||
if ($conf->fournisseur->enabled && $commande->statut >= 2) // 2 means accepted
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
@ -1308,6 +1303,15 @@ if ($id > 0 || ! empty($ref))
|
||||
//}
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($commande->statut == 2)
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&action=cancel">'.$langs->trans("CancelOrder").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->fournisseur->commande->supprimer)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user