diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index afe5586ab13..36802709c0a 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref))
{
if ($absolute_creditnote > 0) // If not linke will be added later
{
- if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'
';
+ if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT) print ' - '.$addabsolutediscount.'
';
else print '.';
}
else print '. ';
@@ -197,9 +197,9 @@ if ($id > 0 || ! empty($ref))
if ($absolute_creditnote > 0)
{
// If validated, we show link "add credit note to payment"
- if ($object->statut != 1 || $object->type == 2 || $object->type == 3)
+ if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT)
{
- if ($object->statut == 0 && $object->type != 3)
+ if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT)
{
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency));
print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse"));
@@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref))
if (! $absolute_discount && ! $absolute_creditnote)
{
print $langs->trans("CompanyHasNoAbsoluteDiscount");
- if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'
';
+ if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT) print ' - '.$addabsolutediscount.'
';
else print '. ';
}
/*if ($object->statut == 0 && $object->type != 2 && $object->type != 3)
@@ -242,10 +242,10 @@ if ($id > 0 || ! empty($ref))
print '
| '; print $langs->trans('DateMaxPayment'); print ' | '; - if ($object->type != 2 && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print 'id.'">'.img_edit($langs->trans('SetDate'),1).' | '; + if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print 'id.'">'.img_edit($langs->trans('SetDate'),1).' | '; print '