From 3ab6ac601eb6ff3b6a1a7dcf713c3810a63ed29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Jan 2015 17:55:20 +0100 Subject: [PATCH] Type of supplier invoice was broken --- htdocs/core/class/commoninvoice.class.php | 42 +++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 991601a4fbd..6087a5a0adb 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -30,6 +30,36 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ abstract class CommonInvoice extends CommonObject { + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; + + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; + + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; + + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; + + /** + * Proforma invoice + */ + const TYPE_PROFORMA = 4; + + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; + /** * Return amount of payments already done * @@ -145,12 +175,12 @@ abstract class CommonInvoice extends CommonObject function getLibType() { global $langs; - if ($this->type == Facture::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); - if ($this->type == Facture::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); - if ($this->type == Facture::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); - if ($this->type == Facture::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); - if ($this->type == Facture::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); - if ($this->type == Facture::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); + if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); + if ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); + if ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); + if ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); + if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); + if ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); return $langs->trans("Unknown"); }