diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 214d1ad7c0a..b79e26e71d1 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -52,12 +52,15 @@ $type='invoice';
if ($action == 'updateMask')
{
$maskconstinvoice=GETPOST('maskconstinvoice','alpha');
+ $maskconstreplacement=GETPOST('maskconstreplacement','alpha');
$maskconstcredit=GETPOST('maskconstcredit','alpha');
$maskconstdeposit=GETPOST('maskconstdeposit','alpha');
$maskinvoice=GETPOST('maskinvoice','alpha');
+ $maskreplacement=GETPOST('maskreplacement','alpha');
$maskcredit=GETPOST('maskcredit','alpha');
$maskdeposit=GETPOST('maskdeposit','alpha');
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity);
+ if ($maskconstreplacement) $res = dolibarr_set_const($db,$maskconstreplacement,$maskreplacement,'chaine',0,'',$conf->entity);
if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity);
if ($maskconstdeposit) $res = dolibarr_set_const($db,$maskconstdeposit,$maskdeposit,'chaine',0,'',$conf->entity);
@@ -383,6 +386,22 @@ foreach ($dirmodels as $reldir)
$htmltooltip.=$langs->trans($module->error).'
';
}
}
+ // Example for remplacement
+ $facture->type=1;
+ $nextval=$module->getNextValue($mysoc,$facture);
+ if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
+ {
+ $htmltooltip.=$langs->trans("NextValueForReplacements").': ';
+ if ($nextval)
+ {
+ $htmltooltip.=$nextval.'
';
+ }
+ else
+ {
+ $htmltooltip.=$langs->trans($module->error).'
';
+ }
+ }
+
// Example for credit invoice
$facture->type=2;
$nextval=$module->getNextValue($mysoc,$facture);
diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php
index 2d8fed55213..5011f5f9b89 100644
--- a/htdocs/core/modules/facture/mod_facture_mercure.php
+++ b/htdocs/core/modules/facture/mod_facture_mercure.php
@@ -55,6 +55,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
$texte.= '';
$texte.= '';
$texte.= '';
+ $texte.= '';
$texte.= '';
$texte.= '';
$texte.= '
| '.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'): | '; + $texte.= ''.$form->textwithpicto('',$tooltip,1,1).' | '; + $texte.= '
| '.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'): | '; $texte.= ''.$form->textwithpicto('',$tooltip,1,1).' | '; @@ -129,7 +135,15 @@ class mod_facture_mercure extends ModeleNumRefFactures // Get Mask value $mask = ''; - if (is_object($facture) && $facture->type == 2) $mask=$conf->global->FACTURE_MERCURE_MASK_CREDIT; + if (is_object($facture) && $facture->type == 1) + { + $mask=$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT; + if (! $mask) + { + $mask=$conf->global->FACTURE_MERCURE_MASK_INVOICE; + } + } + else if (is_object($facture) && $facture->type == 2) $mask=$conf->global->FACTURE_MERCURE_MASK_CREDIT; else if (is_object($facture) && $facture->type == 3) $mask=$conf->global->FACTURE_MERCURE_MASK_DEPOSIT; else $mask=$conf->global->FACTURE_MERCURE_MASK_INVOICE; if (! $mask) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 5263d8bca6c..cceaeefe179 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -71,7 +71,9 @@ Fields=Camps Mask=Màscara NextValue=Pròxim valor NextValueForInvoices=Pròxim valor (factures) -NextValueForCreditNotes=Pròxim valor (notes de lliurament) +NextValueForCreditNotes=Pròxim valor (abonaments) +NextValueForDeposit=Pròxim valor(factures de bestreta) +NextValueForReplacements=Pròxim valor (factures rectificatives) MustBeLowerThanPHPLimit=Observació: El seu PHP limita la mida a %s %s de màxim, qualsevol que sigui el valor d'aquest paràmetre NoMaxSizeByPHPLimit=Cap limitació interna en el seu servidor PHP MaxSizeForUploadedFiles=Tamany màxim dels documents a pujar (0 per prohibir la pujada) diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index 9dae4bf83db..9cb3b305e43 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -411,7 +411,7 @@ PDFCrabeDescription=Model de factura complet (model recomanat per defecte) # oursin PDF Model PDFOursinDescription=Model de factura complet (model alternatiu) # NumRef Modules -TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 -MarsNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures, %syymm-nnnn per a les factures rectificatives, %syymm-nnnn per a les factures proforma i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 +TerreNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures, %syymm-nnnn per als abonaments i %syymm-nnnn per a les factures de bestreta on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 +MarsNumRefModelDesc1=Retorna el nombre sota el format %syymm-nnnn per a les factures, %syymm-nnnn per a les factures rectificatives, %syymm-nnnn per a les factures de bestreta i %syymm-nnnn per als abonaments on yy és l'any, mm. el mes i nnnn un comptador seqüencial sense ruptura i sense permanència a 0 # TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4cf9ab6d37f..365d8fbfbf4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -73,6 +73,7 @@ NextValue=Next value NextValueForInvoices=Next value (invoices) NextValueForCreditNotes=Next value (credit notes) NextValueForDeposit=Next value (deposit) +NextValueForReplacements=Next value (replacements) MustBeLowerThanPHPLimit=Note: your PHP limits each file upload's size to %s %s, whatever this parameter's value is NoMaxSizeByPHPLimit=Note: No limit is set in your PHP configuration MaxSizeForUploadedFiles=Maximum size for uploaded files (0 to disallow any upload) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 42fbcf56825..72c4e6ed622 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -71,7 +71,9 @@ Fields=Campos Mask=Máscara NextValue=Próximo valor NextValueForInvoices=Próximo valor (facturas) -NextValueForCreditNotes=Próximo valor (notas de entrega) +NextValueForCreditNotes=Próximo valor (abonos) +NextValueForDeposit=Próximo valor (facturas de anticipo) +NextValueForReplacements=Próximo valor (facturas rectificativas) MustBeLowerThanPHPLimit=Observación: Su PHP limita el tamaño a %s %s de máximo, cualquiera que sea el valor de este parámetro NoMaxSizeByPHPLimit=Ninguna limitación interna en su servidor PHP MaxSizeForUploadedFiles=Tamaño máximo de los documentos a subir (0 para prohibir la subida) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index de78b75f110..1ab48c2ef11 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -73,6 +73,7 @@ NextValue=Prochaine valeur NextValueForInvoices=Prochaine valeur (factures) NextValueForCreditNotes=Prochaine valeur (avoirs) NextValueForDeposit=Prochaine valeur (acomptes) +NextValueForReplacements=Prochaine valeur (factures de remplacement) MustBeLowerThanPHPLimit=Remarque : Votre PHP limite la taille des envois à %s %s, quelle que soit la valeur de ce paramètre NoMaxSizeByPHPLimit=Aucune limite configurée dans votre serveur PHP MaxSizeForUploadedFiles=Taille maximum des fichiers envoyés (0 pour interdire l'envoi)