From 0eedadd7f20b25d71e83f53f3aaf786a0eb86b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 26 Feb 2014 01:09:22 +0100 Subject: [PATCH] Replacing invoice integer types with Facture constants --- htdocs/compta/facture/apercu.php | 12 ++++++------ htdocs/compta/facture/class/facture.class.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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 ''; - if ($object->type != 2 && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print ''; + if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $object->brouillon && $user->rights->facture->creer) print ''; print '
'; print $langs->trans('DateMaxPayment'); print 'id.'">'.img_edit($langs->trans('SetDate'),1).'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; print ''; - if ($object->type != 2) + if ($object->type != Facture::TYPE_CREDIT_NOTE) { if ($action == 'editpaymentterm') { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index dc154b2a51f..ec86fbcbaec 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -68,7 +68,7 @@ class Facture extends CommonInvoice var $ref_ext; var $ref_int; //Check constants for types - var $type= self::TYPE_STANDARD; + var $type = self::TYPE_STANDARD; //var $amount; var $remise_absolue;