diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 214d1ad7c0a4f6df75279b26452500bdb7b09e47..b79e26e71d13b36659d31e4d2ed0634a556fbaf4 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).'<br>'; } } + // 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.'<br>'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'<br>'; + } + } + // 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 2d8fed55213b77932e51053bd4da889c9d7d3596..5011f5f9b8919571a9d3e83305c232a4e289a253 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.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $texte.= '<input type="hidden" name="action" value="updateMask">'; $texte.= '<input type="hidden" name="maskconstinvoice" value="FACTURE_MERCURE_MASK_INVOICE">'; + $texte.= '<input type="hidden" name="maskconstreplacement" value="FACTURE_MERCURE_MASK_REPLACEMENT">'; $texte.= '<input type="hidden" name="maskconstcredit" value="FACTURE_MERCURE_MASK_CREDIT">'; $texte.= '<input type="hidden" name="maskconstdeposit" value="FACTURE_MERCURE_MASK_DEPOSIT">'; $texte.= '<table class="nobordernopadding" width="100%">'; @@ -73,6 +74,11 @@ class mod_facture_mercure extends ModeleNumRefFactures $texte.= '</tr>'; + // Parametrage du prefix des replacement + $texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>'; + $texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">',$tooltip,1,1).'</td>'; + $texte.= '</tr>'; + // Parametrage du prefix des avoirs $texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</td>'; $texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">',$tooltip,1,1).'</td>'; @@ -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 5263d8bca6c9f7751130935c9ac88a9523b23e04..cceaeefe179268e5de86bbee48b49020597ca5e6 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 <b>%s</b> %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 9dae4bf83dbd6b25f42f3f3c1b892e3bb74a6b3f..9cb3b305e43b4790bc019a02cd5367691e3b56e0 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 4cf9ab6d37f02306f8b1911026a9239b407a40ca..365d8fbfbf4305615b77cbec6caf7bf6992fb18c 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 <b>%s</b> %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 42fbcf5682541732a21fb98744fbb625549829d8..72c4e6ed622d42067c2708c6871a53f126d20991 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 <b>%s</b> %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 de78b75f1106a77ee28d152a1445d5b476401703..1ab48c2ef11b641b9778b823bda9c094e4c4c683 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 à <b>%s</b> %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)