Merge pull request #18278 from aspangaro/12p17

FIX: Invoice - Missing button to reopen an abandoned situation invoice
This commit is contained in:
Laurent Destailleur 2021-07-31 12:19:26 +02:00 committed by GitHub
commit b77ec22590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5206,7 +5206,8 @@ elseif ($id > 0 || !empty($ref))
// Reopen a standard paid invoice
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
{