Fix: Conditions to reopen closed invoice.
This commit is contained in:
parent
de8d2f58ee
commit
7c11750aa3
@ -3308,24 +3308,9 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reopen a standard paid invoice
|
// Reopen a standard paid invoice
|
||||||
if ($fac->type == 1 && $fac->statut == 2) // A paid invoice (partially or completely)
|
if (($fac->type == 0 || $fac->type == 1) && ($fac->statut == 2 || $fac->statut == 3)) // A paid invoice (partially or completely)
|
||||||
{
|
{
|
||||||
if (! $facidnext)
|
if (! $facidnext && $fac->close_code != 'replaced') // Not replaced by another invoice
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reopen a classified invoice
|
|
||||||
if (($fac->statut == 2 || $fac->statut == 3) && // Closed invoice
|
|
||||||
$fac->getIdReplacingInvoice() == 0 && // Not replaced by another invoice
|
|
||||||
$fac->close_code != 'replaced') // Not replaced by another invoice
|
|
||||||
{
|
|
||||||
if (! $facidnext)
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1189,17 +1189,16 @@ else
|
|||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
// Reopen a standard paid invoice
|
// Reopen a standard paid invoice
|
||||||
if ($fac->type == 1 && $fac->statut == 2) // A paid invoice (partially or completely)
|
if (($fac->type == 0 || $fac->type == 1) && ($fac->statut == 2 || $fac->statut == 3)) // A paid invoice (partially or completely)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
if (! $facidnext && $fac->close_code != 'replaced') // Not replaced by another invoice
|
||||||
}
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
||||||
// Reopen a classified invoice
|
}
|
||||||
if (($fac->statut == 2 || $fac->statut == 3) && // Closed invoice
|
else
|
||||||
$fac->getIdReplacingInvoice() == 0 && // Not replaced by another invoice
|
{
|
||||||
$fac->close_code != 'replaced') // Not replaced by another invoice
|
print '<span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span>';
|
||||||
{
|
}
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=reopen">'.$langs->trans('ReOpen').'</a>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['action'] != 'edit' && $fac->statut <= 1 && $fac->getSommePaiement() <= 0 && $user->rights->fournisseur->facture->creer)
|
if ($_GET['action'] != 'edit' && $fac->statut <= 1 && $fac->getSommePaiement() <= 0 && $user->rights->fournisseur->facture->creer)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user