21 <h2
class=
"info">Liste pour <?php echo $year?></h2>
23 @PAGE landscape {
size: landscape;}
24 TABLE {PAGE: landscape;}
26 <
table class=
"result">
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>
40 $tot_amort=0;$tot_net=0;bcscale(2);
42 for ($i=0;$i < count(
$array) ; $i++):
43 $class=($i % 2 == 0 )?
' even ':
' odd ';
44 echo
'<tr class="'.$class.
'">';
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']));
50 echo td(
$array[$i][
'a_start']);
52 echo td(nbm(
$array[$i][
'a_amount']),
'style="text-align:right"');
53 echo td(
$array[$i][
'a_nb_year'],
'style="text-align:right"');
57 $remain=
$cn->get_value(
"select coalesce(sum(ad_amount),0) from amortissement.amortissement_detail
58 where a_id=$1 and ad_year >= $2",
60 $amortize=
$cn->get_value(
"select ad_amount from amortissement.amortissement_detail
61 where a_id=$1 and ad_year = $2",
63 $toamortize=bcsub(
$remain,$amortize);
64 $tot_amort=bcadd($tot_amort,$amortize);
65 $tot_net=bcadd($tot_net,$toamortize);
67 $tot_to_amortize=bcadd($tot_to_amortize,$amortize);
69 $pct=
$cn->get_value(
"select ad_percentage from amortissement.amortissement_detail
70 where a_id=$1 and ad_year = $2",
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"');
81 <tr
class=
"highlight">
92 <?php echo nbm($tot_to_amortize)?>
102 <
table class=
"result" style=
"width:50%;margin-left:25%">
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",
108 echo td(nbm(
$tot),
"align=\"right\"");
113 echo td(_(
"Amortissement "));
114 echo td(nbm($tot_amort),
"align=\"right\"");
119 echo td(_(
"Valeur net "));
120 echo td(nbm($tot_net),
"align=\"right\"");
125 <ul
class=
"aligned-block">
127 <?php echo date(
'd.m.Y')?>
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');?>
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');?>
if(isset($_POST['remove'])) $array