noalyss Version-9
balance_aged_result.php
Go to the documentation of this file.
1<?php
2/*
3 * * Copyright (C) 2015 Dany De Bontridder <dany@alchimerys.be>
4*
5* This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU General Public License
7* as published by the Free Software Foundation; either version 2
8* of the License, or (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program; if not, write to the Free Software
17* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 *
20 */
21
22
23/**
24 * @file
25 * @brief show the result of balance ageing, included from Balance_Age::display_purchase
26 * @see Balance_Age
27 */
28bcscale(2);
29?>
30
31<?php
32 $nb_fiche=count($a_fiche);
33 for ($i=0;$i<$nb_fiche;$i++):
34 $card = new Lettering_Card($this->cn,$a_fiche[$i]['quick_code']);
35 $card->set_parameter('start', $p_date_start);
36 $card->get_balance_ageing($p_let);
37 if ( empty ($card->content)) continue;
38?>
39<?php echo HtmlInput::card_detail($a_fiche[$i]['quick_code'],h($a_fiche[$i]['name']).' '. h($a_fiche[$i]['first_name']));
40?>
41<table class="result">
42 <tr>
43 <th>
44 <?php echo _('Date opération');?>
45 </th>
46 <th>
47 <?php echo _('Pièce');?>
48 </th>
49 <th>
50 <?php echo _('Libellé');?>
51 </th>
52 <th>
53 <?php echo _('Interne');?>
54 </th>
55 <th>
56 <?php echo _('Fin/ OD');?>
57 </th>
58 <th>
59 <?php echo _('< 30 jours');?>
60 </th>
61 <th>
62 <?php echo _('entre 31 et 60 jours');?>
63 </th>
64 <th>
65 <?php echo _('entre 61 et 90 jours');?>
66 </th>
67 <th>
68 <?php echo _('> 90 jours');?>
69 </th>
70 </tr>
71 <?php
72 $nb_row=count($card->content);
78 for ($j=0;$j < $nb_row;$j++):
79
80 $class=($j%2 == 0)?'even':'odd';
81 $show=true;
82 ?>
83 <tr class="<?php echo $class;?>">
84 <td>
85 <?php echo $card->content[$j]['j_date_fmt'] ?>
86 </td>
87 <td>
88 <?php echo HtmlInput::detail_op($card->content[$j]['jr_id'], $card->content[$j]['jr_pj_number']) ?>
89 </td>
90 <td>
91 <?php echo $card->content[$j]['jr_comment'] ?>
92 </td>
93 <td>
94 <?php echo HtmlInput::detail_op($card->content[$j]['jr_id'],$card->content[$j]['jr_internal']) ?>
95 </td>
96 <td style="text-align: right">
97 <?php
98 $side=($card->content[$j]['j_debit']=='t')?'D':'C';
99 if ( $card->content[$j]['jrn_def_type'] == 'FIN' || $card->content[$j]['jrn_def_type'] == 'ODS') :
100 echo nbm($card->content[$j]['j_montant'])." ".$side;
101 if ( $card->content[$j]['j_debit']=='t'):
102 $sum_fin=bcadd($sum_fin,$card->content[$j]['j_montant']);
103 else:
104 $sum_fin=bcsub($sum_fin,$card->content[$j]['j_montant']);
106 $show=false;
107 endif;
108 ?>
109 </td>
110 <td style="text-align: right">
111 <?php
112 if ($show && $card->content[$j]['day_paid'] <= 30) :
113 echo nbm($card->content[$j]['j_montant'])." ".$side;
114 if ( $card->content[$j]['j_debit']=='t'):
115 $sum_lt_30=bcadd($sum_lt_30,$card->content[$j]['j_montant']);
116 else:
117 $sum_lt_30=bcsub($sum_lt_30,$card->content[$j]['j_montant']);
118 endif;
119 endif;
120 ?>
121 </td>
122 <td style="text-align: right">
123 <?php
124 if ( $show &&$card->content[$j]['day_paid'] > 30 && $card->content[$j]['day_paid'] <= 60) :
125 echo nbm($card->content[$j]['j_montant'])." ".$side;
126 if ( $card->content[$j]['j_debit']=='t'):
127 $sum_gt_30_lt_60=bcadd($sum_gt_30_lt_60,$card->content[$j]['j_montant']);
128 else:
129 $sum_gt_30_lt_60=bcsub($sum_gt_30_lt_60,$card->content[$j]['j_montant']);
130 endif;
131 endif;
132 ?>
133 </td>
134 <td style="text-align: right">
135 <?php
136 if ( $show && $card->content[$j]['day_paid'] > 60 && $card->content[$j]['day_paid'] <= 90) :
137 echo nbm($card->content[$j]['j_montant'])." ".$side;
138 if ( $card->content[$j]['j_debit']=='t'):
139 $sum_gt_60_lt_90=bcadd($sum_gt_60_lt_90,$card->content[$j]['j_montant']);
140 else:
141 $sum_gt_60_lt_90=bcsub($sum_gt_60_lt_90,$card->content[$j]['j_montant']);
142 endif;
143 endif;
144 ?>
145 </td>
146 <td style="text-align: right">
147 <?php
148 if ($show && $card->content[$j]['day_paid'] > 90) :
149 echo nbm($card->content[$j]['j_montant'])." ".$side;
150 if ( $card->content[$j]['j_debit']=='t'):
151 $sum_gt_90=bcadd($sum_gt_90,$card->content[$j]['j_montant']);
152 else:
153 $sum_gt_90=bcsub($sum_gt_90,$card->content[$j]['j_montant']);
154 endif;
155
156 endif;
157 ?>
158 </td>
159 </tr>
160 <?php
162 ?>
163 <tr class="highlight">
164 <td>
165
166 </td>
167 <td>
168
169 </td>
170 <td>
171
172 </td>
173 <td>
174
175 </td>
176 <td style="text-align: right">
177 <?php echo nbm(abs($sum_fin));echo ($sum_fin < 0)?'C':(($sum_fin == 0)?'=':'D'); ?>
178 </td>
179 <td style="text-align: right">
180 <?php echo nbm($sum_lt_30);echo ($sum_lt_30 < 0)?'C':(($sum_lt_30 == 0)?'=':'D');?>
181 </td>
182 <td style="text-align: right">
183 <?php echo nbm($sum_gt_30_lt_60);echo ($sum_gt_30_lt_60 < 0)?'C':(($sum_gt_30_lt_60 == 0)?'=':'D');?>
184 </td>
185 <td style="text-align: right">
186 <?php echo nbm($sum_gt_60_lt_90);echo ($sum_gt_60_lt_90 < 0)?'C':(($sum_gt_60_lt_90 == 0)?'=':'D');?>
187 </td>
188 <td style="text-align: right">
189 <?php echo nbm($sum_gt_90);echo ($sum_gt_90 < 0)?'C':(($sum_gt_90 == 0)?'=':'D');?>
190 </td>
191 </tr>
192</table>
193<?php
194 endfor;
195?>
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
h( $row[ 'oa_description'])
$opd_description style
$input_from cn
Definition: balance.inc.php:66
$sum_gt_30_lt_60
for($j=0;$j< $nb_row;$j++)($j%2==0)? 'even' $show
$sum_gt_60_lt_90
$class
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
static card_detail($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
show the detail of a card
only for operation retrieved thanks a quick_code manage the accounting entries for a given card
$all table
$side