Merge pull request #10619 from atm-gauthier/8.0_fix_cant_reopen_fourn_creditnote
FIX : we want to be able to reopen fourn credit note
This commit is contained in:
commit
c0b22e86c2
@ -3014,8 +3014,13 @@ else
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a></div>';
|
||||
}
|
||||
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$result = $discount->fetch(0, 0, $object->id);
|
||||
|
||||
// Reopen a standard paid invoice
|
||||
if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
|
||||
if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT
|
||||
|| ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id)))
|
||||
&& ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
|
||||
{
|
||||
if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user