Changeset 53972 in spip-zone
- Timestamp:
- Nov 2, 2011, 2:50:58 PM (9 years ago)
- Location:
- _plugins_/Association/Associaspip
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/Association/Associaspip/exec/compte_resultat.php
r51608 r53972 52 52 53 53 debut_cadre_relief(_DIR_PLUGIN_ASSOCIATION_ICONES . "finances.jpg", false, "", ' ' . propre(_T('asso:cpte_resultat_titre_general') . ' - ' . $annee)); 54 54 55 55 if ($plan) { 56 56 $join = " RIGHT JOIN spip_asso_plan ON imputation=code"; … … 63 63 } 64 64 65 $var = @serialize(array($annee, $join, $sel, $having, $order)); 66 65 67 echo "<table border='0' cellpadding='2' cellspacing='6' width='100%' class='arial2' style='border: 1px solid #aaaaaa;'>"; 66 68 echo "<tr style='background-color: #DBE1C5;'><td>"; 67 $depenses = compte_resultat_charges_produits($ annee, $join, $sel, $having, $order, intval($GLOBALS['association_metas']['classe_charges']));69 $depenses = compte_resultat_charges_produits($var, intval($GLOBALS['association_metas']['classe_charges'])); 68 70 echo "</td></tr>"; 69 71 echo "<tr style='background-color: #DBE1C5;'><td>"; 70 $recettes = compte_resultat_charges_produits($ annee, $join, $sel, $having, $order, intval($GLOBALS['association_metas']['classe_produits']));72 $recettes = compte_resultat_charges_produits($var, intval($GLOBALS['association_metas']['classe_produits'])); 71 73 echo "</td></tr>"; 72 74 echo "<tr style='background-color: #DBE1C5;'><td>"; … … 74 76 echo "</td></tr>"; 75 77 echo "<tr style='background-color: #DBE1C5;'><td>"; 76 compte_resultat_benevolat($ annee, $join, $sel, $having, $order, intval($GLOBALS['association_metas']['classe_contributions_volontaires']));78 compte_resultat_benevolat($var, intval($GLOBALS['association_metas']['classe_contributions_volontaires'])); 77 79 echo "</td></tr></table>"; 80 81 /* si plan on peut exporter en pdf, cs, xml, ..... */ 82 if($plan){ 83 echo "<br /><table cellpadding='2' cellspacing='6' width='100%' class='arial2' style='border: 1px solid #aaaaaa;'>"; 84 echo "<tr style='background-color: #DBE1C5;'>"; 85 echo "<td style='text-align:right;'>"._T('asso:cpte_resultat_mode_exportation')."</td>"; 86 foreach(array('pdf','csv','xml') as $type) { // exports possibles 87 $h = generer_url_ecrire('export_compte_resultat', "type=$type&var=$var"); 88 echo "<td style='text-align:center;'><a href='$h'><strong>".ucfirst($type)."</strong></td>"; 89 } 90 echo '</tr></table>'; 91 } 78 92 79 93 fin_cadre_relief(); … … 82 96 } 83 97 84 function compte_resultat_charges_produits($ annee, $join, $sel, $having, $order, $class) {98 function compte_resultat_charges_produits($var, $class) { 85 99 include_spip('inc/association_plan_comptable'); 100 $tableau = @unserialize($var); 101 $annee = $tableau[0];$join = $tableau[1];$sel = $tableau[2];$having = $tableau[3];$order = $tableau[4]; 86 102 echo "<table border='0' cellpadding='2' cellspacing='0' width='100%' class='arial2' style='border: 1px solid #aaaaaa;'>"; 87 103 echo "<tr style='background-color: #DBE1C5;'>"; … … 89 105 echo "<td width='30'><strong> </strong></td>"; 90 106 echo "<td><strong>" . (($class == $GLOBALS['association_metas']['classe_charges']) ? _T('asso:cpte_resultat_titre_charges') : _T('asso:cpte_resultat_titre_produits')) . "</strong></td>"; 91 echo "<td width=' 50'><strong> </strong></td>";107 echo "<td width='80'><strong> </strong></td>"; 92 108 echo "</tr>"; 93 109 $quoi = (($class == $GLOBALS['association_metas']['classe_charges']) ? ("sum(depense) AS valeurs") : ("sum(recette) AS valeurs")); … … 137 153 $res = $recettes - $depenses; 138 154 echo "<td class='arial11 border1' style='text-align:right;color: #9F1C30;'><strong>" . (($res < 0) ? _T('asso:cpte_resultat_perte') : _T('asso:cpte_resultat_benefice')) . "</strong></td>"; 139 echo "<td width=' 50' class='arial11 border1' style='text-align:right;color: #9F1C30;'><strong>" . number_format($res, 2, ',', ' ') . "</strong></td>";155 echo "<td width='80' class='arial11 border1' style='text-align:right;color: #9F1C30;'><strong>" . number_format($res, 2, ',', ' ') . "</strong></td>"; 140 156 141 157 echo "</tr></table>"; 142 158 } 143 159 144 function compte_resultat_benevolat($annee, $join, $sel, $having, $order, $class) { 160 function compte_resultat_benevolat($var, $class) { 161 $tableau = @unserialize($var); 162 $annee = $tableau[0];$join = $tableau[1];$sel = $tableau[2];$having = $tableau[3];$order = $tableau[4]; 145 163 echo "<table border='0' cellpadding='2' cellspacing='0' width='100%' class='arial2' style='border: 1px solid #aaaaaa;'>"; 146 164 echo "<tr style='background-color: #DBE1C5;'>"; 147 echo "<td><strong> </strong></td>"; 165 echo "<td width='10'><strong> </strong></td>"; 166 echo "<td width='30'><strong> </strong></td>"; 148 167 echo '<td><strong>' . _T('asso:cpte_resultat_titre_benevolat') . '</strong></td>'; 149 echo "<td style='text-align:right;'><strong>"._T('asso:cpte_resultat_recette_evaluee')."</strong></td>";150 echo "<td style='text-align:right;'><strong>"._T('asso:cpte_resultat_depense_evaluee')."</strong></td>";168 echo "<td width='80' style='text-align:right;'><strong>"._T('asso:cpte_resultat_recette_evaluee')."</strong></td>"; 169 echo "<td width='80' style='text-align:right;'><strong>"._T('asso:cpte_resultat_depense_evaluee')."</strong></td>"; 151 170 $query = sql_select("imputation, sum(recette) AS recettes, sum(depense) AS depenses, date_format(date, '%Y') AS annee$sel", 152 171 "spip_asso_comptes$join", … … 156 175 '', 157 176 "annee=$annee$having$class"); 177 $chapitre = ''; 158 178 $total_recettes = $total_depenses = 0; 159 179 while ($data = sql_fetch($query)) { … … 161 181 $depenses = $data['depenses']; 162 182 echo '<tr style="background-color: #EEEEEE;">'; 183 $new_chapitre = substr($data['code'], 0, 2); 184 if ($chapitre != $new_chapitre) { 185 echo "<td class='arial11 border1'>" . $new_chapitre . '</td>'; 186 echo "<td colspan='4' class='arial11 border1'>" . association_plan_comptable_complet($new_chapitre) . '</td>'; 187 $chapitre = $new_chapitre; 188 echo '</tr><tr style="background-color: #EEEEEE;">'; 189 } 190 echo "<td> </td>"; 163 191 echo "<td class='arial11 border1'>" . $data['code'] . '</td>'; 164 192 echo "<td class='arial11 border1'>" . $data['intitule'] . '</td>'; … … 174 202 175 203 echo '<tr style="background-color: #EEEEEE;">'; 176 echo "<td class='arial11 border1' style='text-align:right;color: #9F1C30;' colspan=' 2'><strong>" . _T('asso:resultat_courant') . '</strong></td>';204 echo "<td class='arial11 border1' style='text-align:right;color: #9F1C30;' colspan='3'><strong>" . _T('asso:resultat_courant') . '</strong></td>'; 177 205 echo "<td class='arial11 border1' style='text-align:right;color: #9F1C30;'><strong>" . $total_recettes . '</strong></td>'; 178 206 echo "<td class='arial11 border1' style='text-align:right;color: #9F1C30;'><strong>" . $total_depenses . '</strong></td>'; -
_plugins_/Association/Associaspip/lang/asso_fr.php
r53923 r53972 531 531 #Votre association 532 532 'votre_asso' => 'Votre association', 533 'president' => 'Pr esident',533 'president' => 'Préesident', 534 534 'votre_equipe' => 'Votre équipe', 535 535 'donnees_perso' => 'Données Personnelles', … … 566 566 # Bilan 567 567 'toutes_destination' => 'toutes destinations', 568 'bilan_depenses' => 'Dépenses', 569 'bilan_recettes' => 'Recettes', 570 'bilan_solde' => 'Solde', 568 571 # Comptes 569 572 'compte_financier' => 'Compte financier', … … 571 574 'compte_cree_automatiquement' => 'Compte créé automatiquement par Associaspip', 572 575 'virement_interne' => 'Virement interne', 573 576 'bouton_radio_type_operation_titre' => 'Type d\'opération', 577 574 578 # Compte de Resultat 575 579 'cpte_resultat_titre_general' => 'Compte de Résultat', … … 586 590 'cpte_resultat_mode_exportation' => 'Exporter le Compte de Résultat en ', 587 591 'cpte_resultat_pied_page_export_pdf' => 'Associaspip - Gestion d\'une association sous licence GPL', 592 'cpte_resultat_total_produits_evalues' => 'Total des Produits Évalués', 593 'cpte_resultat_total_charges_evaluees' => 'Total des Charges Évaluées', 588 594 589 595 # annexe
Note: See TracChangeset
for help on using the changeset viewer.