Fix: [ bug #524 ] Donation receipt html_cerfafr is not localized
This commit is contained in:
parent
a5a3121771
commit
56d19437f4
@ -14,13 +14,12 @@
|
|||||||
<td width="15%" nowrap="nowrap" valign="middle">Cerfa No 11580 01</td>
|
<td width="15%" nowrap="nowrap" valign="middle">Cerfa No 11580 01</td>
|
||||||
|
|
||||||
<td nowrap="nowrap" align="center" valign="middle">
|
<td nowrap="nowrap" align="center" valign="middle">
|
||||||
<font size="+2">Reçu de dons</font><br>
|
<font size="+2">__DonationReceipt__</font><br>
|
||||||
<font size="+1"><b>(Article 200-5 du Code Général des Impôts)</b></font><br>
|
__FrenchArticle__
|
||||||
+ article 238 bis
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td width="15%" nowrap="nowrap" align="center" valign="middle">
|
<td width="15%" nowrap="nowrap" align="center" valign="middle">
|
||||||
Numéro de référence du reçu
|
__DonationRef__
|
||||||
<table width="100%" border="0" bgcolor="#000000" cellspacing="0" cellpadding="3">
|
<table width="100%" border="0" bgcolor="#000000" cellspacing="0" cellpadding="3">
|
||||||
<tr bgcolor="#ffffff" align="center">
|
<tr bgcolor="#ffffff" align="center">
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
@ -48,7 +47,7 @@
|
|||||||
<tr bgcolor="#e0e0e0" align="center">
|
<tr bgcolor="#e0e0e0" align="center">
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<font size="+2">
|
<font size="+2">
|
||||||
<b>Bénéficiaire des versements</b>
|
<b>__DonationRecipient__</b>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -63,12 +62,12 @@
|
|||||||
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<b>Nom ou dénomination :</b><br>
|
<b>__Name__ :</b><br>
|
||||||
__MAIN_INFO_SOCIETE_NOM__<br>
|
__MAIN_INFO_SOCIETE_NOM__<br>
|
||||||
<b>Adresse :</b><br>
|
<b>__Address__ :</b><br>
|
||||||
__MAIN_INFO_SOCIETE_ADRESSE__<br>
|
__MAIN_INFO_SOCIETE_ADRESSE__<br>
|
||||||
<b>Code postal :</b> __MAIN_INFO_SOCIETE_CP__<br>
|
<b>__Zip__ :</b> __MAIN_INFO_SOCIETE_CP__<br>
|
||||||
<b>Commune :</b> __MAIN_INFO_SOCIETE_VILLE__<br>
|
<b>__Town__ :</b> __MAIN_INFO_SOCIETE_VILLE__<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -82,7 +81,7 @@
|
|||||||
<tr bgcolor="#e0e0e0" align="center">
|
<tr bgcolor="#e0e0e0" align="center">
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<font size="+2">
|
<font size="+2">
|
||||||
<b>Donateur</b>
|
<b>__Donor__</b>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -98,12 +97,12 @@
|
|||||||
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<b>Nom :</b><br>
|
<b>__Name__ :</b><br>
|
||||||
__DONATOR_NAME__<br>
|
__DONATOR_NAME__<br>
|
||||||
<b>Adresse :</b><br>
|
<b>__Address__ :</b><br>
|
||||||
__DONATOR_ADDRESS__<br>
|
__DONATOR_ADDRESS__<br>
|
||||||
<b>Code postal :</b> __DONATOR_ZIP__<br>
|
<b>__Zip__ :</b> __DONATOR_ZIP__<br>
|
||||||
<b>Commune :</b> __DONATOR_TOWN__<br>
|
<b>__Town__ :</b> __DONATOR_TOWN__<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -116,9 +115,7 @@
|
|||||||
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Le bénéficiaire reconnait avoir reçu au titre des
|
__IConfirmDonationReception__ : <br>
|
||||||
versements ouvrant droit à réduction d'impôt, la
|
|
||||||
somme de : <br>
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td>
|
<td>
|
||||||
@ -126,15 +123,15 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<b>Date du versement</b> : __DATE__ <br>
|
<b>__DonationPaymentDate__</b> : __DATE__ <br>
|
||||||
<b>Mode de versement</b> : __PAYMENTMODE_LIB__ <br>
|
<b>__DonationPaymentMode__</b> : __PAYMENTMODE_LIB__ <br>
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr align="center">
|
<tr align="center">
|
||||||
|
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<br><br>
|
<br><br>
|
||||||
Merci pour votre don.
|
__ThankYou__
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@ -145,7 +142,7 @@
|
|||||||
<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="160" height="100" valign="top">
|
<td width="160" height="100" valign="top">
|
||||||
<center>Date et signature</center>
|
<center>__Date__ __Signature__</center>
|
||||||
__NOW__
|
__NOW__
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -82,6 +82,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
$outputlangs->load("companies");
|
$outputlangs->load("companies");
|
||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
$outputlangs->load("donations");
|
||||||
|
|
||||||
if (! empty($conf->don->dir_output))
|
if (! empty($conf->don->dir_output))
|
||||||
{
|
{
|
||||||
@ -136,6 +137,23 @@ class html_cerfafr extends ModeleDon
|
|||||||
$form = str_replace('__DONATOR_TOWN__',$don->ville,$form);
|
$form = str_replace('__DONATOR_TOWN__',$don->ville,$form);
|
||||||
$form = str_replace('__PAYMENTMODE_LIB__ ',$don->modepaiement,$form);
|
$form = str_replace('__PAYMENTMODE_LIB__ ',$don->modepaiement,$form);
|
||||||
$form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form);
|
$form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form);
|
||||||
|
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
|
||||||
|
$form = str_replace('__DonationReceipt__',$outputlangs->trans("DonationReceipt"),$form);
|
||||||
|
$form = str_replace('__DonationRecipient__',$outputlangs->trans("DonationRecipient"),$form);
|
||||||
|
$form = str_replace('__DonationPaymentDate__',$outputlangs->trans("DonationPaymentDate"),$form);
|
||||||
|
$form = str_replace('__DonationPaymentMode__',$outputlangs->trans("DonationPaymentMode"),$form);
|
||||||
|
$form = str_replace('__Name__',$outputlangs->trans("Name"),$form);
|
||||||
|
$form = str_replace('__Address__',$outputlangs->trans("Address"),$form);
|
||||||
|
$form = str_replace('__Zip__',$outputlangs->trans("Zip"),$form);
|
||||||
|
$form = str_replace('__Town__',$outputlangs->trans("Town"),$form);
|
||||||
|
$form = str_replace('__Donor__',$outputlangs->trans("Donor"),$form);
|
||||||
|
$form = str_replace('__Date__',$outputlangs->trans("Date"),$form);
|
||||||
|
$form = str_replace('__Signature__',$outputlangs->trans("Signature"),$form);
|
||||||
|
$form = str_replace('__ThankYou__',$outputlangs->trans("ThankYou"),$form);
|
||||||
|
$form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form);
|
||||||
|
$frencharticle='';
|
||||||
|
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='<font size="+1"><b>(Article 200-5 du Code Général des Impôts)</b></font><br>+ article 238 bis';
|
||||||
|
$form = str_replace('__FrenchArticle__',$frencharticle,$form);
|
||||||
|
|
||||||
// Sauve fichier sur disque
|
// Sauve fichier sur disque
|
||||||
dol_syslog("html_cerfafr::write_file $file");
|
dol_syslog("html_cerfafr::write_file $file");
|
||||||
|
|||||||
@ -154,7 +154,15 @@ function don_create($db, $id, $message, $modele, $outputlangs)
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/";
|
$eror=0;
|
||||||
|
|
||||||
|
// Increase limit for PDF build
|
||||||
|
$err=error_reporting();
|
||||||
|
error_reporting(0);
|
||||||
|
@set_time_limit(120);
|
||||||
|
error_reporting($err);
|
||||||
|
|
||||||
|
$srctemplatepath='';
|
||||||
|
|
||||||
// Set template to use
|
// Set template to use
|
||||||
if (! dol_strlen($modele))
|
if (! dol_strlen($modele))
|
||||||
@ -170,22 +178,51 @@ function don_create($db, $id, $message, $modele, $outputlangs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Charge le modele
|
// If selected modele is a filename template (then $modele="modelname:filename")
|
||||||
$file = $modele.".modules.php";
|
$tmp=explode(':',$modele,2);
|
||||||
if (file_exists($dir.$file))
|
if (! empty($tmp[1]))
|
||||||
{
|
{
|
||||||
|
$modele=$tmp[0];
|
||||||
|
$srctemplatepath=$tmp[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search template files
|
||||||
|
$file=''; $classname=''; $filefound=0;
|
||||||
|
$dirmodels=array('/');
|
||||||
|
if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels,$conf->modules_parts['models']);
|
||||||
|
foreach($dirmodels as $reldir)
|
||||||
|
{
|
||||||
|
foreach(array('html','doc','pdf') as $prefix)
|
||||||
|
{
|
||||||
|
$file = $prefix."_".preg_replace('/^html_/','',$modele).".modules.php";
|
||||||
|
|
||||||
|
// On verifie l'emplacement du modele
|
||||||
|
$file=dol_buildpath($reldir."core/modules/dons/".$file,0);
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
$filefound=1;
|
||||||
|
$classname=$prefix.'_'.$modele;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($filefound) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Charge le modele
|
||||||
|
if ($filefound)
|
||||||
|
{
|
||||||
|
require_once $file;
|
||||||
|
|
||||||
$object=new Don($db);
|
$object=new Don($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
|
||||||
require_once $dir.$file;
|
|
||||||
$classname = $modele;
|
$classname = $modele;
|
||||||
$module = new $classname($db);
|
$obj = new $classname($db);
|
||||||
|
|
||||||
// We save charset_output to restore it because write_file can change it if needed for
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
// output format that does not support UTF8.
|
// output format that does not support UTF8.
|
||||||
$sav_charset_output=$outputlangs->charset_output;
|
$sav_charset_output=$outputlangs->charset_output;
|
||||||
if ($module->write_file($object,$outputlangs) > 0)
|
if ($obj->write_file($object,$outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $hookmanager) > 0)
|
||||||
{
|
{
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|
||||||
@ -198,7 +235,7 @@ function don_create($db, $id, $message, $modele, $outputlangs)
|
|||||||
{
|
{
|
||||||
$outputlangs->charset_output=$sav_charset_output;
|
$outputlangs->charset_output=$sav_charset_output;
|
||||||
dol_syslog("Erreur dans don_create");
|
dol_syslog("Erreur dans don_create");
|
||||||
dol_print_error($db,$module->error);
|
dol_print_error($db,$obj->error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
Donation=Donation
|
Donation=Donation
|
||||||
Donations=Donations
|
Donations=Donations
|
||||||
|
DonationRef=Donation ref.
|
||||||
Donor=Donor
|
Donor=Donor
|
||||||
Donors=Donors
|
Donors=Donors
|
||||||
AddDonation=Add a donation
|
AddDonation=Add a donation
|
||||||
@ -21,7 +22,13 @@ DonationStatusPromiseNotValidatedShort=Draft
|
|||||||
DonationStatusPromiseValidatedShort=Validated
|
DonationStatusPromiseValidatedShort=Validated
|
||||||
DonationStatusPaidShort=Received
|
DonationStatusPaidShort=Received
|
||||||
ValidPromess=Validate promise
|
ValidPromess=Validate promise
|
||||||
|
DonationReceipt=Donation receipt
|
||||||
BuildDonationReceipt=Build receipt
|
BuildDonationReceipt=Build receipt
|
||||||
DonationsModels=Documents models for donation receipts
|
DonationsModels=Documents models for donation receipts
|
||||||
LastModifiedDonations=Last %s modified donations
|
LastModifiedDonations=Last %s modified donations
|
||||||
SearchADonation=Search a donation
|
SearchADonation=Search a donation
|
||||||
|
DonationPaymentDate=Donation payment date
|
||||||
|
DonationPaymentMode=Donation payment mode
|
||||||
|
DonationRecipient=Donation recipient
|
||||||
|
ThankYou=Thank You
|
||||||
|
IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount
|
||||||
@ -2,6 +2,7 @@
|
|||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
Donation=Don
|
Donation=Don
|
||||||
Donations=Dons
|
Donations=Dons
|
||||||
|
DonationRef=Réf. donation
|
||||||
Donor=Donateur
|
Donor=Donateur
|
||||||
Donors=Donateurs
|
Donors=Donateurs
|
||||||
AddDonation=Ajouter don
|
AddDonation=Ajouter don
|
||||||
@ -21,7 +22,13 @@ DonationStatusPromiseNotValidatedShort=Non validée
|
|||||||
DonationStatusPromiseValidatedShort=Validée
|
DonationStatusPromiseValidatedShort=Validée
|
||||||
DonationStatusPaidShort=Payé
|
DonationStatusPaidShort=Payé
|
||||||
ValidPromess=Valider promesse
|
ValidPromess=Valider promesse
|
||||||
|
DonationReceipt=Reçu de dons
|
||||||
BuildDonationReceipt=Créer reçu
|
BuildDonationReceipt=Créer reçu
|
||||||
DonationsModels=Modèle de document de bon de réception de dons
|
DonationsModels=Modèle de document de bon de réception de dons
|
||||||
LastModifiedDonations=Les %s derniers dons modifiés
|
LastModifiedDonations=Les %s derniers dons modifiés
|
||||||
SearchADonation=Rechercher un don
|
SearchADonation=Rechercher un don
|
||||||
|
DonationPaymentDate=Date du versement
|
||||||
|
DonationPaymentMode=Mode de versement
|
||||||
|
DonationRecipient=Bénéficiaire des versements
|
||||||
|
ThankYou=Merci
|
||||||
|
IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des versements ouvrant droit à réduction d'impôt, la somme de
|
||||||
Loading…
Reference in New Issue
Block a user