Skip to content
Snippets Groups Projects
Commit dc491fba authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Merge pull request #4887 from defrance/patch-111

NEW : INVOICE_CAN_NEVER_BE_CANCELED global
parents d2130028 767ce063
No related branches found
No related tags found
No related merge requests found
...@@ -3953,6 +3953,7 @@ else if ($id > 0 || ! empty($ref)) ...@@ -3953,6 +3953,7 @@ else if ($id > 0 || ! empty($ref))
} }
// Classify 'closed not completely paid' (possible si validee et pas encore classee payee) // Classify 'closed not completely paid' (possible si validee et pas encore classee payee)
if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement)
{ {
if ($totalpaye > 0 || $totalcreditnotes > 0) if ($totalpaye > 0 || $totalcreditnotes > 0)
...@@ -3962,13 +3963,19 @@ else if ($id > 0 || ! empty($ref)) ...@@ -3962,13 +3963,19 @@ else if ($id > 0 || ! empty($ref))
} }
else else
{ {
if ($objectidnext) { if ( empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED))
{
if ($objectidnext)
{
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ClassifyCanceled') . '</span></div>'; print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ClassifyCanceled') . '</span></div>';
} else { }
else
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&amp;action=canceled">' . $langs->trans('ClassifyCanceled') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&amp;action=canceled">' . $langs->trans('ClassifyCanceled') . '</a></div>';
} }
} }
} }
}
// Clone // Clone
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer) if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment