From 604855bbc14a5ca9f9802f470e1801e7c85938fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 02:05:20 +0200 Subject: [PATCH] Debug v16 --- .../modules/commande/mod_commande_marbre.php | 12 ++++++++++++ htdocs/core/modules/facture/mod_facture_mars.php | 10 +++++++++- .../core/modules/facture/mod_facture_terre.php | 16 +++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 0cc9324ef16..8c9ef0385eb 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -48,6 +48,18 @@ class mod_commande_marbre extends ModeleNumRefCommandes public $name = 'Marbre'; + /** + * Constructor + */ + public function __construct() + { + global $conf, $mysoc; + + if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') { + $this->prefix = 'SO'; // We use correct standard code "SO = Sale Order" + } + } + /** * Return description of numbering module * diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index ef34b145e52..9e0ff0d5b4e 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -55,7 +55,15 @@ class mod_facture_mars extends ModeleNumRefFactures */ public function __construct() { - global $conf; + global $conf, $mysoc; + + if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') { + $this->prefixinvoice = 'IN'; // We use correct standard code "IN = Invoice" + $this->prefixreplacement = 'IR'; + $this->prefixdeposit = 'ID'; + $this->prefixcreditnote = 'IC'; + } + if (!empty($conf->global->INVOICE_NUMBERING_MARS_FORCE_PREFIX)) { $this->prefixinvoice = $conf->global->INVOICE_NUMBERING_MARS_FORCE_PREFIX; } diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 9660be93266..2b11ee3976f 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -42,6 +42,12 @@ class mod_facture_terre extends ModeleNumRefFactures */ public $prefixinvoice = 'FA'; + /** + * Prefix for replacement invoices + * @var string + */ + public $prefixreplacement = 'FA'; + /** * Prefix for credit note * @var string @@ -65,7 +71,15 @@ class mod_facture_terre extends ModeleNumRefFactures */ public function __construct() { - global $conf; + global $conf, $mysoc; + + if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') { + $this->prefixinvoice = 'IN'; // We use correct standard code "IN = Invoice" + $this->prefixreplacement = 'IR'; + $this->prefixdeposit = 'ID'; + $this->prefixcreditnote = 'IC'; + } + if (!empty($conf->global->INVOICE_NUMBERING_TERRE_FORCE_PREFIX)) { $this->prefixinvoice = $conf->global->INVOICE_NUMBERING_TERRE_FORCE_PREFIX; }