New: Donation complete cerfa 11580*03 Fr - Thanks Benoit21

This commit is contained in:
aspangaro 2015-11-22 21:31:05 +01:00
parent 0c958521ac
commit 5bed70b04e
3 changed files with 491 additions and 199 deletions

View File

@ -1,185 +1,299 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>__DonationTitle__</title>
</head>
<body topmargin="10" marginheight="10" marginwidth="10">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reçu au titre des dons à certains organismes dintérêt général</title>
</head>
<body style="font-size:16px;">
<div style="height: 297mm; width: 210mm; page-break-inside: avoid;">
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#ffffff">
<tr>
<td width="20%" class="nowrap" valign="middle" align="center">
<img src="./theme/common/logo_cerfa.png" width="70px"/><br>
<font><b>N° 11580*03</b><br>
DGFIP
</font>
</td>
<td class="nowrap" align="center" valign="middle">
<font size="+2"><b>Reçu au titre des dons<br>
à certains organismes dintérêt général</b></font><br>
Articles 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)
</td>
<td width="20%" class="nowrap" align="center" valign="middle">
Numéro d'ordre du reçu<br>
__REF__
</td>
</tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr bgcolor="#e0e0e0" align="center">
<td nowrap>
<font size="+2">
<b>Bénéficiaire des versements</b>
</font>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#ffffff">
<tr>
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
<font size="+1"><b>Nom ou dénomination :</b></font><br>
__MAIN_INFO_SOCIETE_NOM__<br>
<font size="+1"><b>Adresse :</b></font><br>
__MAIN_INFO_SOCIETE_ADDRESS__<br>
<font size="+1"><b>Code postal </b></font> __MAIN_INFO_SOCIETE_ZIP__ <font size="+1"><b>Commune </b></font> __MAIN_INFO_SOCIETE_TOWN__<br>
<font size="+1"><b>Objet:</b></font><br>
__MAIN_INFO_SOCIETE_OBJECT__
</td>
</tr>
<tr>
<td>
<hr>
<font size="+1"><b>Cochez la case concernée (1) :</b></font><br>
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Association ou fondation reconnue d'utilité publique par décret en date du ........./ ..... /........... publié au Journal
officiel du ......./ ....../ .......... . ou association située dans le département de la Moselle, du Bas-Rhin ou
du Haut-Rhin dont la mission a été reconnue d'utilité publique par arrêté préfectoral en date du …./.…/……..</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Fondation universitaire ou fondation partenariale mentionnées respectivement aux articles L. 719-12 et
L. 719-13 du code de l'éducation</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Fondation d'entreprise</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox" checked="checked"></td>
<td>Oeuvre ou organisme d'intérêt général</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Musée de France</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Établissement d'enseignement supérieur ou denseignement artistique public ou privé, dintérêt général, à but
non lucratif</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Organisme ayant pour objet exclusif de participer financièrement à la création d'entreprises</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Association cultuelle ou de bienfaisance et établissement public des cultes reconnus d'Alsace-Moselle</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Organisme ayant pour activité principale l'organisation de festivals</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Association fournissant gratuitement une aide alimentaire ou des soins médicaux à des personnes en difficulté ou
favorisant leur logement</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Fondation du patrimoine ou fondation ou association qui affecte irrévocablement les dons à la Fondation du
patrimoine, en vue de subventionner les travaux prévus par les conventions conclues entre la Fondation du
patrimoine et les propriétaires des immeubles (article L. 143-2-1 du code du patrimoine)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Établissement de recherche public ou privé, dintérêt général, à but non lucratif</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Entreprise dinsertion ou entreprise de travail temporaire dinsertion (articles L. 5132-5 et L. 5132-6 du code du
travail).</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Associations intermédiaires (article L. 5132-7 du code du travail)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Ateliers et chantiers dinsertion (article L. 5132-15 du code du travail)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Entreprises adaptées (article L. 5213-13 du code du travail)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Agence nationale de la recherche (ANR)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Société ou organisme agréé de recherche scientifique ou technique (2)</td>
</tr>
<tr>
<td valign="top"><INPUT type="checkbox"></td>
<td>Autre organisme : ………………………………………………………………………………………………</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<font size="-1">
(1) ou n'indiquez que les renseignements concernant l'organisme
<br>
(2) dons effectués par les entreprises
</div>
</font>
<div style="height: 297mm; width: 210mm; page-break-inside: avoid;">
<table width="100%" border="1" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr bgcolor="#e0e0e0" align="center">
<td nowrap>
<font size="+2">
<b>Donateur</b>
</font>
</td>
</tr>
</table>
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td width="50%">
<font size="+1"><b>Nom :</b></font><br>
__DONATOR_SOCIETE____DONATOR_LASTNAME__
</td>
<td width="50%">
<font size="+1"><b>Prénoms :</b></font><br>
__DONATOR_FIRSTNAME__
</td>
</tr>
<tr>
<td>
<font size="+1"><b>Adresse :</b></font><br>
__DONATOR_ADDRESS__<br>
<font size="+1"><b>Code postal </b></font> __DONATOR_ZIP__ <font size="+1"><b>Commune </b></font> __DONATOR_TOWN__
</td>
</tr>
</table>
</td>
</tr>
</table>
<td width="15%" class="nowrap" valign="middle">Cerfa N° 11580*03</td>
<br>
<td class="nowrap" align="center" valign="middle">
<font size="+2"><b>__DonationReceipt__</b></font><br>
__FrenchArticle__
</td>
<table width="100%" border="1" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
Le bénéficiaire reconnaît avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt, la somme de :<br>
<table width="100%">
<tr align="center">
<td>
__AMOUNT__ <b> euros</b>
</td>
</tr>
</table>
<br>
Somme en toutes lettres : __AMOUNTLETTERS__
<br>
<br>
<b>Date du versement ou du don :</b> __DATE__
<br>
<br>
Le bénéficiaire certifie sur lhonneur que les dons et versements quil reçoit ouvrent droit à la réduction d'impôt prévue à larticle (3) :<br>
<table width="100%">
<tr align="center">
__CodeDon__
</tr>
</table>
<hr>
<b>Forme du don :</b> <br>
<table width="100%">
<tr align="left">
<td width="25%"><INPUT type="checkbox"> Acte authentique</td><td width="25%"><INPUT type="checkbox"> Acte sous seing privé</td><td width="33%"><INPUT type="checkbox"> Déclaration de don manuel</td><td width="17%"><INPUT type="checkbox"checked> Autres</td>
</tr>
</table>
<hr>
<b>Nature du don :</b><br>
<table width="100%">
<tr align="left">
<td width="25%"><INPUT type="checkbox" checked="checked"> Numéraire</td><td width="25%"><INPUT type="checkbox"> Titres de sociétés cotés</td><td width="50%"><INPUT type="checkbox"> Autres (4)</td>
</tr>
</table>
<hr>
<b>En cas de don en numéraire, mode de versement du don :</b><!-- __PAYMENTMODE_LIB__ <br>-->
<table width="100%">
<tr align="left">
__ModePaiement__
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<font size="-1">
<table>
<tr>
<td valign="top">(3)</td>
<td>
Lorganisme bénéficiaire peut cocher une ou plusieurs cases.<br>
Lorganisme bénéficiaire peut, en application de larticle L. 80 C du livre des procédures fiscales, demander à ladministration sil relève
de lune des catégories dorganismes mentionnées aux articles 200 et 238 bis du code général des impôts.<br>
Il est rappelé que la délivrance irrégulière de reçus fiscaux par lorganisme bénéficiaire est susceptible de donner lieu, en application des
dispositions de l'article 1740 A du code général des impôts, à une amende fiscale égale à 25 % des sommes indûment mentionnées sur
ces documents.
</td>
</tr>
<tr>
<td valign="top">(4)</td>
<td>
Notamment : abandon de revenus ou de produits ; frais engagés par les bénévoles, dont ils renoncent expressément au remboursement<br>
</td>
</tr>
</table>
</font>
<br>
<br>
<td width="15%" class="nowrap" align="center" valign="middle">
__DonationRef__
<table width="100%" border="0" bgcolor="#000000" cellspacing="0" cellpadding="3">
<tr bgcolor="#ffffff" align="center">
<td class="nowrap">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td align="center">__REF__ </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr bgcolor="#e0e0e0" align="center">
<td class="nowrap">
<font size="+2">
<b>__DonationRecipient__</b>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
<b>__Name__ :</b><br>
__MAIN_INFO_SOCIETE_NOM__<br>
<b>__Address__ :</b><br>
__MAIN_INFO_SOCIETE_ADDRESS__<br>
<b>__Zip__ :</b> __MAIN_INFO_SOCIETE_ZIP__<br>
<b>__Town__ :</b> __MAIN_INFO_SOCIETE_TOWN__<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr bgcolor="#e0e0e0" align="center">
<td class="nowrap">
<font size="+2">
<b>__Donor__</b>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
<b>__Name__ :</b><br>
__DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__<br>
<b>__Address__ :</b><br>
__DONATOR_ADDRESS__<br>
<b>__Zip__ :</b> __DONATOR_ZIP__<br>
<b>__Town__ :</b> __DONATOR_TOWN__<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
__IConfirmDonationReception__ : <br>
<table width="100%">
<tr align="center">
<td>
<font size="+1">
<b>__AMOUNT__ __CURRENCY__<b/>
</font>
</td>
</tr>
</table>
<b>__DonationDatePayment__</b> : __DATE__ <br>
<b>__PaymentMode__</b> : __PAYMENTMODE_LIB__ <br>
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td valign="top">
<br>
<b>__Message__ :</b>
__DonationMessage__<br>
</td>
</tr>
</table>
<table width="100%">
<tr align="center">
<td align="left">
__FrenchEligibility__<br>
__ARTICLE200__ __ARTICLE238__ __ARTICLE885__
</td>
<td align="right">
<table border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom" align="center">
<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td width="160" height="100" valign="top">
<div class="center">__Date__ & __Signature__</div>
<div class="center">__NOW__</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<table width="100%">
<tr align="center">
<td align="right">
<table width="27%" border="0" cellspacing="0" cellpadding="1">
<tr><td align="center">Date et signature<br><br></td></tr>
<tr><td>
<table border="1" cellspacing="0" cellpadding="1" bgcolor="#000000" width="100%">
<tr><td valign="bottom" align="center">
<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td width="1%" height="100" valign="top" align="center">
__NOW__
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -3,7 +3,8 @@
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Benoit Bruchard <benoitb21@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -45,7 +46,7 @@ class html_cerfafr extends ModeleDon
$this->db = $db;
$this->name = "cerfafr";
$this->description = $langs->trans('DonationsReceiptModel').' - fr_FR - Cerfa 11580*03';
$this->description = 'Modèles de reçu de dons - fr_FR - Cerfa 11580*03';
// Dimension page for size A4
$this->type = 'html';
@ -130,7 +131,30 @@ class html_cerfafr extends ModeleDon
$paymentmode = $formclass->cache_types_paiements[$don->modepaiementid]['label'];
}
else $paymentmode = '';
if ($don->modepaiementid==7){
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox" disabled="true" checked="checked"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
else if ($don->modepaiementid==4){
$ModePaiement = '<td width="25%"><input type="checkbox" checked="checked"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
else if ($don->modepaiementid==2 OR $don->modepaiementid==3 OR $don->modepaiementid==6){
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox" checked="checked"> Virement, prélèvement, carte bancaire</td>';
}
else
{
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
if (empty($don->societe))
{
$CodeDon = '<td width="33%"><input type="checkbox" disabled="true" checked="checked" > 200 du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 238 bis du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 885-0 V bis A du CGI</td>';
}
else
{
$CodeDon = '<td width="33%"><input type="checkbox" disabled="true" > 200 du CGI</td><td width="33%"><input type="checkbox" disabled="true" checked="checked" > 238 bis du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 885-0 V bis A du CGI</td>';
}
// Define contents
$donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html";
$form = implode('', file($donmodel));
@ -138,18 +162,23 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__DATE__',dol_print_date($don->date,'day',false,$outputlangs),$form);
//$form = str_replace('__IP__',$user->ip,$form); // TODO $user->ip not exist
$form = str_replace('__AMOUNT__',$don->amount,$form);
$form = str_replace('__AMOUNTLETTERS__',chiffre_en_lettre($don->amount),$form);
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->currency),$form);
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_OBJECT__',$mysoc->object,$form);
$form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form);
$form = str_replace('__DONATOR_LASTNAME__',$don->lastname,$form);
$form = str_replace('__DONATOR_SOCIETE__',$don->societe,$form);
$form = str_replace('__DONATOR_STATUT__',$don->statut,$form);
$form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
$form = str_replace('__DONATOR_ZIP__',$don->zip,$form);
$form = str_replace('__DONATOR_TOWN__',$don->town,$form);
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);
$form = str_replace('__ModePaiement__', $ModePaiement,$form);
$form = str_replace('__NOW__',dol_print_date($now,'day',false,$outputlangs),$form);
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
$form = str_replace('__DonationTitle__',$outputlangs->trans("DonationTitle"),$form);
@ -157,6 +186,7 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__DonationRecipient__',$outputlangs->trans("DonationRecipient"),$form);
$form = str_replace('__DonationDatePayment__',$outputlangs->trans("DonationDatePayment"),$form);
$form = str_replace('__PaymentMode__',$outputlangs->trans("PaymentMode"),$form);
$form = str_replace('__CodeDon__',$CodeDon,$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);
@ -181,7 +211,7 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART200 >= 1)
{
$art200='<input type="checkbox" disabled="true" checked>200 du CGI';
$art200='<input type="checkbox" disabled="true" checked="checked" >200 du CGI';
}
else
{
@ -194,7 +224,7 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART238 >= 1)
{
$art238='<input type="checkbox" disabled="true" checked>238 bis du CGI';
$art238='<input type="checkbox" disabled="true" checked="checked" >238 bis du CGI';
}
else
{
@ -207,7 +237,7 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART885 >= 1)
{
$art885='<input type="checkbox" disabled="true" checked>885-0 V bis du CGI';
$art885='<input type="checkbox" disabled="true" checked="checked" >885-0 V bis du CGI';
}
else
{
@ -242,3 +272,151 @@ class html_cerfafr extends ModeleDon
}
}
function chiffre_en_lettre($montant, $devise1='', $devise2='')
{
if(empty($devise1)) $dev1='euros';
else $dev1=$devise1;
if(empty($devise2)) $dev2='centimes';
else $dev2=$devise2;
$valeur_entiere=intval($montant);
$valeur_decimal=intval(round($montant-intval($montant), 2)*100);
$dix_c=intval($valeur_decimal%100/10);
$cent_c=intval($valeur_decimal%1000/100);
$unite[1]=$valeur_entiere%10;
$dix[1]=intval($valeur_entiere%100/10);
$cent[1]=intval($valeur_entiere%1000/100);
$unite[2]=intval($valeur_entiere%10000/1000);
$dix[2]=intval($valeur_entiere%100000/10000);
$cent[2]=intval($valeur_entiere%1000000/100000);
$unite[3]=intval($valeur_entiere%10000000/1000000);
$dix[3]=intval($valeur_entiere%100000000/10000000);
$cent[3]=intval($valeur_entiere%1000000000/100000000);
$chif=array('', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix sept', 'dix huit', 'dix neuf');
$secon_c='';
$trio_c='';
for($i=1; $i<=3; $i++){
$prim[$i]='';
$secon[$i]='';
$trio[$i]='';
if($dix[$i]==0){
$secon[$i]='';
$prim[$i]=$chif[$unite[$i]];
}
else if($dix[$i]==1){
$secon[$i]='';
$prim[$i]=$chif[($unite[$i]+10)];
}
else if($dix[$i]==2){
if($unite[$i]==1){
$secon[$i]='vingt et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='vingt';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==3){
if($unite[$i]==1){
$secon[$i]='trente et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='trente';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==4){
if($unite[$i]==1){
$secon[$i]='quarante et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='quarante';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==5){
if($unite[$i]==1){
$secon[$i]='cinquante et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='cinquante';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==6){
if($unite[$i]==1){
$secon[$i]='soixante et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='soixante';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==7){
if($unite[$i]==1){
$secon[$i]='soixante et';
$prim[$i]=$chif[$unite[$i]+10];
}
else {
$secon[$i]='soixante';
$prim[$i]=$chif[$unite[$i]+10];
}
}
else if($dix[$i]==8){
if($unite[$i]==1){
$secon[$i]='quatre-vingts et';
$prim[$i]=$chif[$unite[$i]];
}
else {
$secon[$i]='quatre-vingt';
$prim[$i]=$chif[$unite[$i]];
}
}
else if($dix[$i]==9){
if($unite[$i]==1){
$secon[$i]='quatre-vingts et';
$prim[$i]=$chif[$unite[$i]+10];
}
else {
$secon[$i]='quatre-vingts';
$prim[$i]=$chif[$unite[$i]+10];
}
}
if($cent[$i]==1) $trio[$i]='cent';
else if($cent[$i]!=0 || $cent[$i]!='') $trio[$i]=$chif[$cent[$i]] .' cents';
}
$chif2=array('', 'dix', 'vingt', 'trente', 'quarante', 'cinquante', 'soixante', 'soixante-dix', 'quatre-vingts', 'quatre-vingts dix');
$secon_c=$chif2[$dix_c];
if($cent_c==1) $trio_c='cent';
else if($cent_c!=0 || $cent_c!='') $trio_c=$chif[$cent_c] .' cents';
if(($cent[3]==0 || $cent[3]=='') && ($dix[3]==0 || $dix[3]=='') && ($unite[3]==1))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' million ';
else if(($cent[3]!=0 && $cent[3]!='') || ($dix[3]!=0 && $dix[3]!='') || ($unite[3]!=0 && $unite[3]!=''))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' millions ';
else
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3];
if(($cent[2]==0 || $cent[2]=='') && ($dix[2]==0 || $dix[2]=='') && ($unite[2]==1))
$somme = $somme.' mille ';
else if(($cent[2]!=0 && $cent[2]!='') || ($dix[2]!=0 && $dix[2]!='') || ($unite[2]!=0 && $unite[2]!=''))
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2]. ' milles ';
else
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2];
$somme = $somme. $trio[1]. ' ' .$secon[1]. ' ' . $prim[1];
$somme = $somme. ' '. $dev1 .' ' ;
if(($cent_c=='0' || $cent_c=='') && ($dix_c=='0' || $dix_c==''))
return $somme. ' et z&eacute;ro '. $dev2;
else
return $somme. $trio_c. ' ' .$secon_c. ' ' . $dev2;
}

View File

@ -3,6 +3,7 @@
* Copyright (C) 2012-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Benoit Bruchard <benoitb21@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -39,6 +40,7 @@ if (!$user->admin) accessforbidden();
$typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
$value = GETPOST('value');
$type='donation';
@ -377,18 +379,18 @@ if (is_resource($handle))
// Active
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
if ($conf->global->DON_ADDON_MODEL == $name)
{
print img_picto($langs->trans("Enabled"),'switch_on');
}
print "<td align=\"center\">\n";
print img_picto($langs->trans("Enabled"),'switch_on');
print '</td>';
}
else
{
print '&nbsp;';
print '</td><td align="center">';
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
print '</td>';
print '</td>';
}
}
else
{
@ -398,16 +400,18 @@ if (is_resource($handle))
}
// Defaut
print "<td align=\"center\">";
if ($conf->global->DON_ADDON_MODEL == "$name")
{
print img_picto($langs->trans("Default"),'on');
print "<td align=\"center\">";
print img_picto($langs->trans("Default"),'on');
print '</td>';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
print "<td align=\"center\">";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '</td>';
}
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
@ -437,10 +441,6 @@ if (is_resource($handle))
print '</table>';
print "<br>";
llxFooter();
$db->close();
llxFooter();