noalyss Version-9
letter_prop.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?><?php
5
7if ( count($this->content) == 0 ) :
8?>
9 <h2 class="error"><?php echo _('Désolé aucun résultat trouvé')?></h2>
10
11 <?php
12 else :
13if (DEBUGNOALYSS>1) {
14 echo Noalyss\Dbg::hidden_info("linked ",$this->linked);
15 echo Noalyss\Dbg::hidden_info("content",$this->content);
16}
18?>
19<table class="result">
20<tr>
21<th>
22</th>
23<th>
24 <?php echo _('Lettrage')?>
25</th>
26<th>
27 <?php echo _('Date')?>
28</th>
29<th>
30 <?php echo _('Ref')?>
31</th>
32<th>
33 <?php echo _('Internal')?>
34</th>
35<th>
36 <?php echo _('Description')?>
37</th>
38<th style="text-align:right">
39 <?php echo _('Débit')?>
40</th>
41<th style="text-align:right">
42 <?php echo _('Crédit')?>
43</th>
44<th style="text-align:center">
45 <?php echo _('Op. concernée')?>
46</th>
47</tr>
48
49<?php
50// ???
51// $this->content=array_merge($this->linked,$this->content);
52$amount_deb=($j_debit=='t')?$amount_init:0;
53$amount_cred=($j_debit=='f')?$amount_init:0;
54
55$linked_limit=count($this->linked);
56
57for ($i=0;$i<count($this->content);$i++):
58 $class="";
59$class= ( ($i % 2) == 0 ) ? "odd":"even";
60if ( $i < $linked_limit ) $class="even";
62{
63 ?>
64<tr>
65<th>
66</th>
67<th>
68 <?php echo _('Lettrage')?>
69</th>
70<th>
71 <?php echo _('Date')?>
72</th>
73<th>
74 <?php echo _('Ref')?>
75</th>
76<th>
77 <?php echo _('Internal')?>
78</th>
79<th>
80 <?php echo _('Description')?>
81</th>
82<th style="text-align:right">
83 <?php echo _('Débit')?>
84</th>
85<th style="text-align:right">
86 <?php echo _('Crédit')?>
87</th>
88<th style="text-align:center">
89 <?php echo _('Op. concernée')?>
90</th>
91</tr>
92<?php
93
94}
95?>
96 <tr <?php echo "class=\"$class\""; ?> >
97<td>
98<?php
99
100 if ($this->content[$i]['j_id']==$p_jid) continue;
101if ( $jnt_id == $this->content[$i]['letter'] && $i >= $linked_limit) continue;
102
103$check=new ICheckbox('ck[]',$this->content[$i]['j_id']);
104if ( $jnt_id == $this->content[$i]['letter'] && $i < $linked_limit) $check->selected=true; else $check->selected=false;
105
106if ( $this->content[$i]['letter'] < 0 || $check->selected == true )
107 echo $check->input();
108echo HtmlInput::hidden('letter_j_id[]',$this->content[$i]['j_id']);
109?>
110</td>
111<td>
112<?php
113$letter=($this->content[$i]['letter']< 0)?" ":strtoupper(base_convert($this->content[$i]['letter'],10,36));
114?>
115<?php echo $letter?>
116</td>
117<td> <?php echo smaller_date($this->content[$i]['j_date_fmt'])?> </td>
118<td> <?php echo h($this->content[$i]['jr_pj_number']);?> </td>
119<?php
120$r=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:viewOperation(\'%s\',\'%s\')" >%s</A>',
121 $this->content[$i]['jr_id'], $gDossier, $this->content[$i]['jr_internal']);
122?>
123<td> <?php echo $r?> </td>
124
125<td> <?php echo h($this->content[$i]['jr_comment'])?> </td>
126 <?php if ($this->content[$i]['j_debit']=='t') : ?>
127 <td style="text-align:right"> <?php echo nb($this->content[$i]['j_montant'])?> </td>
128 <td></td>
129 <?php else : ?>
130 <td></td>
131 <td style="text-align:right"> <?php echo nb($this->content[$i]['j_montant'])?> </td>
132 <?php endif ?>
133<td style="text-align:center">
134<?php
135 // Rapprochement
136 $rec=new Acc_Reconciliation($this->db);
137 $rec->set_jr_id($this->content[$i]['jr_id']);
138 $a=$rec->get();
139 if ( $a != null ) {
140 foreach ($a as $key => $element)
141 {
142 $operation=new Acc_Operation($this->db);
143 $operation->jr_id=$element;
144 $l_amount=$this->db->get_value("select jr_montant from jrn ".
145 " where jr_id=$element");
146 echo "<A class=\"detail\" HREF=\"javascript:viewOperation('".$element."',".$gDossier.")\" > ".$operation->get_internal()." [ ".nbm($l_amount,2)." &euro; ]</A>";
147 }//for
148 }// if ( $a != null ) {
149
150?>
151</td>
152
153</tr>
154<?php
155if ($i<$linked_limit)
156{
157 $amount_deb+=( $jnt_id == $this->content[$i]['letter'] && $this->content[$i]['j_debit']=='t')?$this->content[$i]['j_montant']:0;
158 $amount_cred+=( $jnt_id == $this->content[$i]['letter'] && $this->content[$i]['j_debit']=='f')?$this->content[$i]['j_montant']:0;
159}
162$side = _('Créditeur');
163if ($delta < 0 ) {
164$side = _("Débiteur");
165$delta = abs($delta);
167 $side="";
168}
169?>
170</TABLE>
171 <h3 class="title"> <?php echo _("Total lettré")?></h3>
172<span style="display:block;font-size:14px"><?php echo _('Total Debit')?> <?php echo nbm($amount_deb,2)?></span>
173<span style="display:block;font-size:14px"><?php echo _('Total Credit')?> <?php echo nbm($amount_cred,2)?></span>
174<span style="display:block;font-size:14px"><?php echo _('Différence ')." ".$side?> <?php echo nbm($delta,2)?></span>
175
176<?php endif;?>
177<?php echo HtmlInput::button('check_all',_('Sélectionner tout'),' onclick="select_checkbox(\'letter_form\')"');?>
178<?php echo HtmlInput::button('check_none',_('Tout Désélectionner'),' onclick="unselect_checkbox(\'letter_form\')"');?>
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
smaller_date($p_date)
shrink the date, make a date shorter for the printing
Definition: ac_common.php:837
span($p_string, $p_extra='')
Definition: ac_common.php:43
tr($p_string, $p_extra='')
Definition: ac_common.php:88
nb($p_number)
format the number for the CSV export
Definition: ac_common.php:107
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
if(!headers_sent()) else
h( $row[ 'oa_description'])
$opd_description style
$input_from id
Definition: balance.inc.php:63
else $card content[$j]['j_montant']
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
new class for managing the reconciliation it must be used instead of the function InsertRapt,...
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static hidden($p_name, $p_value, $p_id="")
static hidden_info($p_title, $msg)
Show a icon to display large information on demand, when you click it , the content will be showned.
Definition: dbg.php:170
$all table
$SecUser db
$amount_deb
Definition: letter_all.php:6
$gDossier
Definition: letter_prop.php:6
if(count($this->content)==0)('Désolé aucun résultat trouvé')?></h2 ><?php else(DEBUGNOALYSS >1) $delta
Definition: letter_prop.php:17
$amount_cred
Definition: letter_prop.php:53
$letter
if( $delta< 0) elseif( $delta==0)
$side
$check
$r
for($i=0;$i< count($this->content);$i++) $class
Definition: letter_prop.php:59
if($a !=null) if($i< $linked_limit) endfor
$a
$linked_limit
Definition: letter_prop.php:55