diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 5d409dd6c67..3d4e442f6f3 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ /** * \file htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php * \ingroup facture fournisseur - * \brief File that contain parent class for supplier invoices models + * \brief File that contains parent class for supplier invoices models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -55,6 +56,79 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator } +/** + * Parent Class of numbering models of suppliers invoices references + */ +abstract class ModeleNumRefSuppliersInvoices +{ + var $error=''; + + /** Return if a model can be used or not + * + * @return boolean true if model can be used + */ + function isEnabled() + { + return true; + } + + /** Returns the default description of the model numbering + * + * @return string Description Text + */ + function info() + { + global $langs; + $langs->load("invoices"); + return $langs->trans("NoDescription"); + } + + /** Returns a numbering example + * + * @return string Example + */ + function getExample() + { + global $langs; + $langs->load("invoices"); + return $langs->trans("NoExample"); + } + + /** Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + * + * @return boolean false if conflict, true if ok + */ + function canBeActivated() + { + return true; + } + + /** Returns next value assigned + * + * @return string Valeur + */ + function getNextValue() + { + global $langs; + return $langs->trans("NotAvailable"); + } + + /** Returns version of the model numbering + * + * @return string Value + */ + function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'development') return $langs->trans("VersionDevelopment"); + if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + if ($this->version == 'dolibarr') return DOL_VERSION; + return $langs->trans("NotAvailable"); + } +} + /** * Create a document onto disk according to template module. * @@ -168,4 +242,4 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided } } -?> +?> \ No newline at end of file