noalyss Version-9
impress_reconciliation.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4?><table class="result">
5<tr>
6<th>
7<?php echo _("N°")?>
8</th>
9<th>
10<?php echo _("Date")?>
11</th>
12<th>
13<?php echo _("N° op")?>
14</th>
15<th>
16<?php echo _("n° pièce")?>
17</th>
18<th>
19<?php echo _("Libellé")?>
20</th>
21<th style="text-align:right">
22<?php echo _("Montant")?>
23</th>
24</tr>
25<?php
26for ($i=0;$i<count($array);$i++) {
27 $tot=$acc_reconciliation->get_amount_noautovat($array[$i]['first']['jr_id'],$array[$i]['first']['jr_montant']);
28
29 $r='';
30 $r.=td($i);
31 $r.=td(format_date($array[$i]['first']['jr_date']));
32 $detail = HtmlInput::detail_op($array[$i]['first']['jr_id'], $array[$i]['first']['jr_internal']);
33 $r.=td($detail);
34 $r.=td($array[$i]['first']['jr_pj_number']);
35 $r.=td($array[$i]['first']['jr_comment']);
36 $r.=td(nbm($tot),'style="text-align:right"');
37 echo tr($r);
38 // check if operation does exist in v_detail_quant
39 $ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['first']['jr_id']));
40 $acc_reconciliation->show_detail($ret);
41 if ( isset($array[$i]['depend']) )
42 {
43 $tot2=0;
44 $limit=count($array[$i]['depend'])-1;
45 for ($e=0;$e<count($array[$i]['depend']);$e++) {
46 $r='';
47 $r.=td($i);
48 $r.=td(format_date($array[$i]['depend'][$e]['jr_date']));
49 $detail = HtmlInput::detail_op($array[$i]['depend'][$e]['jr_id'], $array[$i]['depend'][$e]['jr_internal']);
50 $r.=td($detail);
51 $r.=td($array[$i]['depend'][$e]['jr_pj_number']);
52 $r.=td($array[$i]['depend'][$e]['jr_comment']);
53 $r.=td(nbm($array[$i]['depend'][$e]['jr_montant']),'style="text-align:right"');
54
55 $amount_dep=$acc_reconciliation->get_amount_noautovat($array[$i]['depend'][$e]['jr_id'],$array[$i]['depend'][$e]['jr_montant']);
56 $tot2=bcadd($tot2,$amount_dep);
57
58 if ( $e==$limit)
59 echo '<tr>'.$r.'</tr>';
60 else
61 echo tr($r);
62 $ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['depend'][$e]['jr_id']));
63 $acc_reconciliation->show_detail($ret);
64 }
65 echo tr(td(_('Total ')).td(_('opération')).td(nbm($tot)).td(_('opérations dépendantes')).td(nbm($tot2)).td(_('Delta')).td(bcsub($tot,$tot2)),' class="highlight"');
66 echo tr(td('<hr>',' colspan="6" style="witdh:auto"'));
67
68 }
69}
70?>
71</table>
format_date($p_date, $p_from_format='YYYY-MM-DD', $p_to_format='DD.MM.YYYY')
format the date, when taken from the database the format is MM-DD-YYYY
Definition: ac_common.php:852
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
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$opd_description style
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
$all table
catch(Exception $exc) $acc_reconciliation