noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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 = Acc_Tva::build($cn, $q['qs_vat_code']);
227 $tva->load();
228 $sym_tva = (h($tva->get_parameter('label')));
229 $x=($g_user->get_vat_code_preference()==1)?$tva->get_parameter('tva_code'):$tva->get_parameter('id');
230 $sym_tva .= sprintf('[%s]',$x);
231 }
232
233 $row .= td($sym_tva, 'style="text-align:center"');
234
235 $htva = $q['qs_price'];
236
237 $row .= td(nbm($htva), 'class="num"');
238 $tva_rounded = round($q['qs_vat'], 2);
239 $tvac = bcadd($htva, $tva_rounded);
240 if ($owner->MY_TVA_USE == 'Y') {
241 $class = "";
242 if ($q['qs_vat_sided'] != 0) {
243 $class = ' style="text-decoration:line-through"';
244 $tvac = bcsub($tvac, $tva_rounded);
245 }
246 $row .= td(nbm($tva_rounded), 'class="num"' . $class);
247 $row .= td(nbm($tvac), 'class="num"');
248 }
249 $total_tvac = bcadd($total_tvac, $tvac);
250 $total_htva = bcadd($total_htva, $htva);
251 /* Analytic accountancy */
252 if ($owner->MY_ANALYTIC != "nu" /*&& $div == 'popup' */) {
253 $poste = $fiche->strAttribut(ATTR_DEF_ACCOUNT);
254 if ($g_parameter->match_analytic($poste)) {
255 $anc_op = new Anc_Operation($cn);
256 $anc_op->in_div = $div;
257 $anc_op->j_id = $q['j_id'];
258 $side = ($q['j_debit'] == 'f') ? 'C' : 'D';
259 echo HtmlInput::hidden('opanc[]', $anc_op->j_id);
260 /* compute total price */
261 bcscale(2);
262 $str_anc .= '<tr>';
263 $str_anc .= td($qcode);
264 $str_anc .= td($poste);
265 $str_anc .= td(nbm($htva) . " {$side}");
266 $str_anc .= $anc_op->display_table(1, $htva, $div) . '</tr>';
267 // $row.=($div == 'popup') ? $anc_op->display_table(1, $htva, $div):"";
268 } else {
269 $row .= td('');
270 }
271 }
272 $class = ($e % 2 == 0) ? ' class="even"' : 'class="odd"';
273 /*
274 * Display Currency in a column, if invoice not recorded in EUR
275 */
276 if ($obj->det->currency_id != 0) {
277 $value = $obj->db->get_value("select oc_amount+oc_vat_amount from operation_currency where j_id=$1", [$q['j_id']]);
279 $row .= td(nbm(round($value, 4), 4), ' class="num"');
280
281 }
282 echo tr($row, $class);
283 }
284 if ($owner->MY_TVA_USE == 'Y')
285 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
286 else
287 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
288 /**
289 * display additional tax if any + currency
290 */
294
296
298 if ($owner->MY_TVA_USE == 'N') {
300 }
301 $row .= td(nbm($total_htva), 'class="num" style="font-style:italic;font-weight: bolder;"');
302 if ($owner->MY_TVA_USE == 'Y') {
303 $row .= td("") . td(nbm($total_tvac), 'class="num" style="font-style:italic;font-weight: bolder;"');
304
305 }
306
307 //Display total in currency
308 if ($obj->det->currency_id != "" && $obj->det->currency_id > 0) {
309 $row .= td(nbm($sum_prod_currency, 2), ' class="num" style="font-style:italic;font-weight: bolder;"');
310 }
311 echo tr($row);
312 ?>
313 </table>
314 </td>
315 </tr>
316 </table>
317 </td>
318 </tr>
319 </table>
320 <?php
321 /*
322 * Info about currency if not in euro
323 */
324 // Add a row with currency and amount
325 if ($obj->det->currency_id != "" && $obj->det->currency_id > 0) {
326 $currency = new Acc_Currency($obj->db, $obj->det->currency_id);
327 $four_space = "&nbsp;" . "&nbsp;" . "&nbsp;" . "&nbsp;";
328
329 echo $currency->get_code(), $four_space;
330 echo _("Taux utilisé"), "&nbsp;", nbm($obj->det->currency_rate, 4), $four_space;
331 echo _("Taux Réf"), "&nbsp;", nbm($obj->det->currency_rate_ref, 4) . $four_space;
332 echo _("Montant en devise"), "&nbsp;", nbm($sum_prod_currency, 4) . $four_space;
333 }
334
335 ?>
336
337 <?php
338 require_once NOALYSS_TEMPLATE . '/ledger_detail_bottom.php';
339 ?>
340</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
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.
global $g_parameter
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
if($ledger=="") $access
$jr_id
$opd_description style
_("actif, passif,charge,...")
display currency , convert to euro , and save them if used.
static build($db, $p_code)
retrieve TVA rate thanks the code that could be the tva_id or tva_code.
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...
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...
Html Input.
Html Input.
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
$sum_add_tax
display additional tax if any + currency
$view_card_detail
$tab_rapprochement
$side