Skip to content
Snippets Groups Projects
Commit 6d1a0213 authored by Juanjo Menent's avatar Juanjo Menent
Browse files

New: [ task #1005 ] Update mercure module with replacement invoices.

parent d0bd188e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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)
......
......@@ -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)
......
......@@ -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.
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment