noalyss Version-9
ledger_detail_ven.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
5?>
6
7<?php require_once NOALYSS_TEMPLATE . '/ledger_detail_top.php'; ?>
8<?php
9$tab_account = $div . "account";
10$tab_rapprochement = $div . "rapproch";
11$tab_receipt = $div . "receipt";
12$tab_document = $div . "document";
14?>
15<div class="content" style="padding:0px;">
16 <?php
18 ?>
19
20 <?php if ($access == 'W') :
21 echo '<form class="print" onsubmit="return op_save(this);">';
23
24 <?php echo HtmlInput::hidden('whatdiv', $div) . HtmlInput::hidden('jr_id', $jr_id) . dossier::hidden(); ?>
25 <table style="width:100%">
26 <tr>
27 <td>
28 <table>
29 <tr>
30
31 <td></td>
32 <?php
33 $date = new IDate('p_date');
34 if ( $g_parameter->MY_STRICT=='Y' && $g_user->check_action(UPDDATE)==0) {
35 $date->setReadOnly(true);
36 }
37 $date->value = format_date($obj->det->jr_date);
38 echo td(_('Date')) . td($date->input());
39 ?>
40 </tr>
41 <tr>
42 <td></td>
43 <?php
44 $date_ech = new IDate('p_ech');
45 $date_ech->value = format_date($obj->det->jr_ech);
46 echo td(_('Echeance')) . td($date_ech->input());
47 ?>
48 <tr>
49 <td></td>
50 <td>
51 <?php echo _("Date paiement") ?>
52 </td>
53 <td>
54 <?php
55 $date_paid = new IDate('p_date_paid');
56 $date_paid->value = format_date($obj->det->jr_date_paid);
57 echo $date_paid->input();
58 ?>
59 </td>
60 </tr>
61 <tr>
62 <td>
63 <?php
64 $bk = new Fiche($cn, $obj->det->array[0]['qs_client']);
65 echo td(_('Client'));
66
67 $view_card_detail = HtmlInput::card_detail($bk->get_quick_code(), h($bk->getName()), ' class="line" ');
69 ?>
70 </td>
71 </tr>
72 <tr>
73 <td>
74 <?php
75 $itext = new IText('npj');
76 $itext->value = strip_tags($obj->det->jr_pj_number);
77 if ($owner->MY_PJ_SUGGEST=='A' || $g_user->check_action(UPDRECEIPT)==0)
78 $itext->setReadOnly(true);
79 echo td(_('Pièce')) . td($itext->input());
80 ?>
81 </td>
82 <tr>
83 <td>
84 <?php
85 $itext = new IText('lib');
86 $itext->value = strip_tags($obj->det->jr_comment??"");
87 $itext->size = 40;
88 echo td(_('Libellé')) . td($itext->input(), ' colspan="2" ');
89 ?>
90 </td>
91 </tr>
92 <tr>
93 <td></td>
94 <td><?php echo _("Payé") ?></td>
95 <td>
96 <?php
97 $ipaid = new ICheckBox("ipaid", 'paid');
98 $ipaid->selected = ($obj->det->jr_rapt == 'paid');
99 echo $ipaid->input();
100 ?>
101 </td>
102 </tr>
103
104 </table>
105 </td>
106 <td style="width:50%;height:100%;vertical-align:top;text-align: center">
107 <table style="width:99%;height:8rem;vertical-align:top;">
108 <tr style="height: 5%">
109 <td style="text-align:center;vertical-align: top">
110 Note
111 </td>
112 </tr>
113 <tr>
114 <td style="text-align:center;vertical-align: top">
115 <?php
116 $inote = new ITextarea('jrn_note');
117 $inote->style = ' class="itextarea" style="width:90%;height:100%;"';
118 $inote->value = strip_tags($obj->det->note);
119 echo $inote->input();
120 ?>
121
122 </td>
123 </tr>
124 <tr>
125 <td>
126 <div id="operation_tag_td<?=$div?>">
127 <?php
128 /******************************************************************************************************************
129 * Tags on operation
130 *****************************************************************************************************************/
132 $tag_operation->set_jrn_id($obj->det->jr_id);
133 $tag_operation->tag_cell($div);
134 ?>
135
136 </div>
137 <?php
138 // Button add tags
139 if ( $access=='W') { echo Tag_Operation::button_search($obj->det->jr_id,$div);}
140 ?>
141 </td>
142 </tr>
143 </table>
144 </td>
145
146 </tr>
147 </table>
148 <table class="result" style="margin-left:4px">
149 <?php
150 bcscale(2);
154 echo th(_('Quick Code'));
155 echo th(_('Description'));
156 echo th(_('Prix/Un'), 'style="text-align:right"');
157 echo th(_('Quantité'), 'style="text-align:right"');
158 if ($owner->MY_TVA_USE == 'Y')
159 echo th(_('Taux TVA'), 'style="text-align:right"');
160 else
161 echo th('');
162 if ($owner->MY_TVA_USE == 'Y') {
163 echo th(_('HTVA'), 'style="text-align:right"');
164 echo th(_('TVA'), 'style="text-align:right"');
165 echo th(_('TVAC'), 'style="text-align:right"');
166 } else
167 echo th(_('Total'), 'style="text-align:right"');
168 /*
169 * If not in EUR
170 */
171 if ($obj->det->currency_id != 0) {
172 $currency = $obj->db->get_value("select cr_code_iso from currency where id=$1",
173 [$obj->det->currency_id]);
174 echo th($currency, 'style="text-align:right"');
175 }
176 if ($owner->MY_ANALYTIC != 'nu' /*&& $div == 'popup'*/) {
177 $anc = new Anc_Plan($cn);
178 $a_anc = $anc->get_list(" order by pa_id ");
179 $x = count($a_anc);
180 /* set the width of the col */
181 /* add hidden variables pa[] to hold the value of pa_id */
182 $str_anc .= '<tr>' .
183 '<th>' .
184 _('Code') .
185 '</th>' .
186 '<th>' .
187 _('Poste') .
188 '</th>' .
189 '<th>' .
190 _('Montant') .
191 '</th>' .
192 '<th colspan="' . $x . '">'
193 . _('Compt. Analytique') . Anc_Plan::hidden($a_anc) .
194 '</th>' .
195 '</tr>';
196
197 }
198
199 echo '</tr>';
200 for ($e = 0; $e < count($obj->det->array); $e++) {
201 $row = '';
202 $q = $obj->det->array[$e];
203 $fiche = new Fiche($cn, $q['qs_fiche']);
204 $qcode = $fiche->strAttribut(ATTR_DEF_QUICKCODE);
205 $view_card_detail = HtmlInput::card_detail($qcode, "", ' class="line" ');
207 if ($owner->MY_UPDLAB == 'Y') {
208 $l_lib = ($q['j_text'] == '') ? $fiche->strAttribut(ATTR_DEF_NAME) : $q['j_text'];
209 $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
210 $input = new IText("e_march" . $q['j_id'] . "_label", $l_lib);
211 $input->css_size = "100%";
212 } else {
213 $input = new ISpan("e_march" . $q['j_id'] . "_label");
214 $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
215 $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
216 }
217
218 $row .= td($input->input() . $hidden);
219 $sym_tva = '';
220 $pu = $q['qs_unit'];
221 $row .= td(nbm($pu, 4), 'class="num"');
222 $row .= td(nbm($q['qs_quantite'], 4), 'class="num"');
223 $sym_tva = '';
224 if ($owner->MY_TVA_USE == 'Y' && $q['qs_vat_code'] != '') {
225 /* retrieve TVA symbol */
226 $tva = new Acc_Tva($cn, $q['qs_vat_code']);
227 $tva->load();
228 $sym_tva = (h($tva->get_parameter('label')));
229 // $sym_tva=$sym
230 }
231
232 $row .= td($sym_tva, 'style="text-align:center"');
233
234 $htva = $q['qs_price'];
235
236 $row .= td(nbm($htva), 'class="num"');
237 $tva_rounded = round($q['qs_vat'], 2);
238 $tvac = bcadd($htva, $tva_rounded);
239 if ($owner->MY_TVA_USE == 'Y') {
240 $class = "";
241 if ($q['qs_vat_sided'] != 0) {
242 $class = ' style="text-decoration:line-through"';
243 $tvac = bcsub($tvac, $tva_rounded);
244 }
245 $row .= td(nbm($tva_rounded), 'class="num"' . $class);
246 $row .= td(nbm($tvac), 'class="num"');
247 }
248 $total_tvac = bcadd($total_tvac, $tvac);
249 $total_htva = bcadd($total_htva, $htva);
250 /* Analytic accountancy */
251 if ($owner->MY_ANALYTIC != "nu" /*&& $div == 'popup' */) {
252 $poste = $fiche->strAttribut(ATTR_DEF_ACCOUNT);
253 if ($g_parameter->match_analytic($poste)) {
254 $anc_op = new Anc_Operation($cn);
255 $anc_op->in_div = $div;
256 $anc_op->j_id = $q['j_id'];
257 $side = ($q['j_debit'] == 'f') ? 'C' : 'D';
258 echo HtmlInput::hidden('opanc[]', $anc_op->j_id);
259 /* compute total price */
260 bcscale(2);
261 $str_anc .= '<tr>';
262 $str_anc .= td($qcode);
263 $str_anc .= td($poste);
264 $str_anc .= td(nbm($htva) . " {$side}");
265 $str_anc .= $anc_op->display_table(1, $htva, $div) . '</tr>';
266 // $row.=($div == 'popup') ? $anc_op->display_table(1, $htva, $div):"";
267 } else {
268 $row .= td('');
269 }
270 }
271 $class = ($e % 2 == 0) ? ' class="even"' : 'class="odd"';
272 /*
273 * Display Currency in a column, if invoice not recorded in EUR
274 */
275 if ($obj->det->currency_id != 0) {
276 $value = $obj->db->get_value("select oc_amount+oc_vat_amount from operation_currency where j_id=$1", [$q['j_id']]);
278 $row .= td(nbm(round($value, 4), 4), ' class="num"');
279
280 }
281 echo tr($row, $class);
282 }
283 if ($owner->MY_TVA_USE == 'Y')
284 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
285 else
286 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
287 /**
288 * display additional tax if any + currency
289 */
293
295
297 if ($owner->MY_TVA_USE == 'N') {
299 }
300 $row .= td(nbm($total_htva), 'class="num" style="font-style:italic;font-weight: bolder;"');
301 if ($owner->MY_TVA_USE == 'Y') {
302 $row .= td("") . td(nbm($total_tvac), 'class="num" style="font-style:italic;font-weight: bolder;"');
303
304 }
305
306 //Display total in currency
307 if ($obj->det->currency_id != "" && $obj->det->currency_id > 0) {
308 $row .= td(nbm($sum_prod_currency, 2), ' class="num" style="font-style:italic;font-weight: bolder;"');
309 }
310 echo tr($row);
311 ?>
312 </table>
313 </td>
314 </tr>
315 </table>
316 </td>
317 </tr>
318 </table>
319 <?php
320 /*
321 * Info about currency if not in euro
322 */
323 // Add a row with currency and amount
324 if ($obj->det->currency_id != "" && $obj->det->currency_id > 0) {
325 $currency = new Acc_Currency($obj->db, $obj->det->currency_id);
326 $four_space = "&nbsp;" . "&nbsp;" . "&nbsp;" . "&nbsp;";
327
328 echo $currency->get_code(), $four_space;
329 echo _("Taux utilisé"), "&nbsp;", nbm($obj->det->currency_rate, 4), $four_space;
330 echo _("Taux Réf"), "&nbsp;", nbm($obj->det->currency_rate_ref, 4) . $four_space;
331 echo _("Montant en devise"), "&nbsp;", nbm($sum_prod_currency, 4) . $four_space;
332 }
333
334 ?>
335
336 <?php
337 require_once NOALYSS_TEMPLATE . '/ledger_detail_bottom.php';
338 ?>
339</div>
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
h( $row[ 'oa_description'])
$input
$class
display currency , convert to euro , and save them if used.
Acc_Tva is used for to map the table tva_rate parameter are.
static display_row($p_jrn_id, &$sum_euro, &$sum_currency, $decalage=0)
display the additional_tax in the ledger_detail for Sales and Purchase
this class is used to show the form for entering an operation only FOR analytic operation to save it,...
Concerns the Analytic plan (table plan_analytique)
static hidden($p_array)
return an HTML string containing hidden input type to hold the differant PA_ID
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
static card_detail($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
show the detail of a card
static hidden($p_name, $p_value, $p_id="")
Html Input.
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
Html Input.
Definition: ispan.class.php:32
Html Input.
Definition: itext.class.php:30
Manage the TEXTAREA html element.
Class to manage the company parameter (address, name...)
concerns the tags linked to an accountancy writing
static button_search($p_jr, $p_div)
Show a button to select tag for Search.
$all table
const ATTR_DEF_NAME
Definition: constant.php:216
const ATTR_DEF_QUICKCODE
Definition: constant.php:237
const ATTR_DEF_ACCOUNT
Definition: constant.php:215
const UPDDATE
const UPDRECEIPT
$tab_rapprochement
if($access=='W') endif
global $g_user
$sum_prod_currency
$sum_add_tax
display additional tax if any + currency
global $cn
$tag_operation
$view_card_detail
$tab_receipt
$sum_add_tax_cur
global $jr_id
$inote style
global $obj
global $access
global $div
global $g_parameter
else $row
$tab_account
$tab_document
$side