Plugins  LAST
 All Data Structures Files Functions Variables Pages
listing_year.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Copyright 2010 De Bontridder Dany <dany@alchimerys.be>
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 ?>
21 <h2 class="info">Liste pour <?php echo $year?></h2>
22 <style>
23 @PAGE landscape {size: landscape;}
24 TABLE {PAGE: landscape;}
25 </style>
26 <table class="result">
27 <tr>
28  <th>Code</th>
29  <th>Description</th>
30  <th>Date d'acquisition</th>
31  <th>Année d'achat</th>
32  <th style="text-align:right"><?php echo _("Montant à l'achat")?></th>
33  <th style="text-align:right"><?php echo _("Nombre amortissement")?></th>
34  <th style="text-align:right"><?php echo _("Montant à amortir")?></th>
35  <th style="text-align:right"><?php echo _("Amortissement")?></th>
36  <th style="text-align:right"><?php echo _("Pourcentage")?></th>
37  <th style="text-align:right"><?php echo _("Reste à amortir")?></th>
38 </tr>
39 <?php
40 $tot_amort=0;$tot_net=0;bcscale(2);
41 $tot_purchase=0;$tot_to_amortize=0;$tot_remain=0;
42 for ($i=0;$i < count($array) ; $i++):
43  $class=($i % 2 == 0 )?' even ':' odd ';
44  echo '<tr class="'.$class.'">';
45  $fiche=new Fiche($cn,$array[$i]['f_id']);
46  echo td($fiche->strAttribut(ATTR_DEF_QUICKCODE));
47  echo td($fiche->strAttribut(ATTR_DEF_NAME));
48  echo td(format_date($array[$i]['a_date']));
49 
50  echo td($array[$i]['a_start']);
51 
52  echo td(nbm($array[$i]['a_amount']),'style="text-align:right"');
53  echo td($array[$i]['a_nb_year'],'style="text-align:right"');
54 
55 
56 
57  $remain=$cn->get_value("select coalesce(sum(ad_amount),0) from amortissement.amortissement_detail
58  where a_id=$1 and ad_year >= $2",
59  array($array[$i]['a_id'],$year));
60  $amortize=$cn->get_value("select ad_amount from amortissement.amortissement_detail
61  where a_id=$1 and ad_year = $2",
62  array($array[$i]['a_id'],$year));
63  $toamortize=bcsub($remain,$amortize);
64  $tot_amort=bcadd($tot_amort,$amortize);
65  $tot_net=bcadd($tot_net,$toamortize);
66  $tot_purchase=bcadd($tot_purchase,$array[$i]['a_amount']);
67  $tot_to_amortize=bcadd($tot_to_amortize,$amortize);
68  $tot_remain=bcadd($tot_remain,$toamortize);
69  $pct=$cn->get_value("select ad_percentage from amortissement.amortissement_detail
70  where a_id=$1 and ad_year = $2",
71  array($array[$i]['a_id'],$year));
72 
73 
74  echo td(nbm($remain),'style="text-align:right"');
75  echo td(nbm($amortize),'style="text-align:right"');
76  echo td(nbm($pct),'style="text-align:right"');
77  echo td(nbm($toamortize),'style="text-align:right"');
78 echo '</tr>';
79 endfor;
80 ?>
81 <tr class="highlight">
82 <td></td>
83 <td></td>
84 <td></td>
85 <td></td>
86 <td class="num">
87  <?php echo nbm($tot_purchase)?>
88 </td>
89 <td></td>
90 <td></td>
91 <td class="num">
92  <?php echo nbm($tot_to_amortize)?>
93 </td>
94 <td></td>
95 <td class="num">
96  <?php echo nbm($tot_remain)?>
97 </td>
98 
99 </tfoot>
100 </table>
101 <hr>
102 <table class="result" style="width:50%;margin-left:25%">
103 <tr>
104 <?php
105 echo td(_("Acquisition de l'année"));
106  $tot=$cn->get_value(" select coalesce(sum(a_amount),0) from amortissement.amortissement where a_start=$1",
107  array($year));
108 echo td(nbm($tot),"align=\"right\"");
109 ?>
110 </tr>
111 <tr>
112 <?php
113 echo td(_("Amortissement "));
114 echo td(nbm($tot_amort),"align=\"right\"");
115 ?>
116 </tr>
117 <tr>
118 <?php
119 echo td(_("Valeur net "));
120 echo td(nbm($tot_net),"align=\"right\"");
121 
122 ?>
123 </tr>
124 </table>
125 <ul class="aligned-block">
126  <li>
127 <?php echo date('d.m.Y')?>
128  </li>
129  <li>
130 <form method="GET" action="extension.raw.php">
131 <?php echo dossier::hidden()?>
132 <?php echo HtmlInput::hidden('csv_list_year',$year);?>
133 <?php echo HtmlInput::hidden('ac',$_REQUEST['ac']);?>
134 <?php echo HtmlInput::extension()?>
135 <?php echo HtmlInput::submit('csv','Export CSV');?>
136 </form>
137  </li>
138  <li>
139 <form method="GET" action="extension.raw.php">
140 <?php echo dossier::hidden()?>
141 <?php echo HtmlInput::hidden('pdf_list_year',$year);?>
142 <?php echo HtmlInput::hidden('ac',$_REQUEST['ac']);?>
143 <?php echo HtmlInput::extension()?>
144 <?php echo HtmlInput::submit('csv','Export PDF');?>
145 </form>
146 </li>
147 </ul>
else $class
Definition: show_import.php:25
endfor
$note style
$tot_purchase
$p_card size
if(isset($_POST['remove'])) $array
$tot_remain
$tot
$categorie_appel table
$_REQUEST['sb']
Definition: am_print.php:39
global $cn