noalyss Version-9
ledger_detail_misc.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
5require_once NOALYSS_TEMPLATE.'/ledger_detail_top.php';
8 // find out exercice
9 $periode_id=new Periode($cn,$obj->det->jr_tech_per);
10 $exercice=$periode_id->get_exercice();
12?>
13<?php
14?>
15<div class="content" style="padding:0">
16
17 <?php if ( $access=='W') : ?>
18<form class="print" onsubmit="return op_save(this);">
19 <?php endif; ?>
20
21 <?php echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
22 <table style="width:100%">
23 <tr>
24 <td>
25 <table>
26 <tr>
27 <td>
28 <?php
29 $date=new IDate('p_date');
30 if ( $g_parameter->MY_STRICT=='Y' && $g_user->check_action(UPDDATE)==0) {
31 $date->setReadOnly(true);
32 }
33 $date->value=format_date($obj->det->jr_date);
34 echo td(_('Date')).td($date->input());
35
36 ?>
37 </td>
38 </tr>
39
40 <tr>
41 <td>
42 <?php
43 $itext=new IText('lib');
44 $itext->value=strip_tags($obj->det->jr_comment??"");
45 $itext->size=40;
46 echo td(_('Libellé')).td($itext->input());
47
48
49 ?>
50 </td>
51 </tr>
52 <tr>
53 <td>
54 <?php echo td(_('Montant')).td(nbm($obj->det->jr_montant),' class="inum"');?>
55 </td>
56 </tr>
57 <tr>
58 <td>
59 <?php
60 $itext=new IText('npj');
61 if ($owner->MY_PJ_SUGGEST=='A' || $g_user->check_action(UPDRECEIPT)==0)
62 $itext->setReadOnly(true);
63 $itext->value=strip_tags($obj->det->jr_pj_number??"");
64 echo td(_('Pièce')).td($itext->input());
65 ?>
66 </td>
67 </tr>
68 </table>
69 </td>
70 <td style="width:50%;height:100%;vertical-align:top;text-align: center">
71 <table style="width:99%;height:8rem;vertical-align:top;">
72 <tr style="height: 5%">
73 <td style="text-align:center;vertical-align: top">
74 Note
75 </td></tr>
76 <tr>
77 <td style="text-align:center;vertical-align: top">
78 <?php
79 $inote = new ITextarea('jrn_note');
80 $inote->style=' class="itextarea" style="width:90%;height:100%;"';
81 $inote->value = strip_tags($obj->det->note);
82 echo $inote->input();
83 ?>
84
85 </td>
86 </tr>
87 <tr>
88 <td>
89 <div id="operation_tag_td<?=$div?>">
90 <?php
91 /******************************************************************************************************************
92 * Tags on operation
93 *****************************************************************************************************************/
95 $tag_operation->set_jrn_id($obj->det->jr_id);
96 $tag_operation->tag_cell($div);
97 ?>
98
99
100 </div>
101 <?php
102 // Button add tags
103 if ( $access=='W') { echo Tag_Operation::button_search($obj->det->jr_id,$div);}
104 ?>
105 </td>
106 </tr>
107 </table>
108 </td>
109
110</tr>
111</table>
112
113<div class="myfieldset">
114<?php
116?>
117<table class="result">
118<tr>
119<?php
120 echo th(_('Poste Comptable'));
121 echo th(_('Quick Code'));
122 echo th(_('Libellé'));
123 echo th(_('Débit'), 'style="text-align:right"');
124 echo th(_('Crédit'), 'style="text-align:right"');
125 if ( $obj->det->currency_id != 0 ) {
126 echo th(_("Devise"),' class="num" ');
127 }
128
129 if ($owner->MY_ANALYTIC != 'nu' /* && $div == 'popup' */ ){
130 $anc=new Anc_Plan($cn);
131 $a_anc=$anc->get_list(' order by pa_id ');
132 $x=count($a_anc);
133 /* set the width of the col */
134 $str_anc.='<tr><th>Code</th><th>Poste</th><th>Montant</th><th colspan="' . $x . '">' . _('Compt. Analytique') . '</th>';
135
136 /* add hidden variables pa[] to hold the value of pa_id */
137 $str_anc.= Anc_Plan::hidden($a_anc);
138 }
139echo '</tr>';
141 for ($e=0;$e<count($obj->det->array);$e++) {
142 $row=''; $q=$obj->det->array;
143 $view_history = HtmlInput::history_account($q[$e]['j_poste'], $q[$e]['j_poste'], "", $exercice);
144 $row.=td($view_history);
145
146 if ( $q[$e]['j_qcode'] !='') {
147 $fiche=new Fiche($cn);
148 $fiche->get_by_qcode($q[$e]['j_qcode']);
149 $view_history=HtmlInput::history_card($fiche->id, $q[$e]['j_qcode'], "", $exercice);
150 }
151 else
152 $view_history='';
153 $row.=td($view_history);
154 $l_lib = $q[$e]['j_text'] ;
155
156 if ( $l_lib!='')
157 {
158 $l_lib=$q[$e]['j_text'];
159 }
160 else if ( $q[$e]['j_qcode'] !='') {
161 // nom de la fiche
162 $ff=new Fiche($cn);
163 $ff->get_by_qcode( $q[$e]['j_qcode']);
164 $l_lib=$ff->strAttribut(ATTR_DEF_NAME);
165 } else {
166 // libellé du compte
167 $name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste']));
168 $l_lib=$name;
169 }
170 $l_lib=strip_tags($l_lib);
171 if ($owner->MY_UPDLAB == 'Y')
172 {
173 $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
174 $input = new IText("e_march" . $q[$e]['j_id'] . "_label", $l_lib);
175 $input->css_size="100%";
176 }
177 else
178 {
179 $input = new ISpan("e_march" . $q[$e]['j_id'] . "_label");
180 $input->value=$l_lib;
181 $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
182 }
183 $row.=td($input->input().$hidden);
184 $montant=td(nbm($q[$e]['j_montant']),'class="num"');
185 $row.=($q[$e]['j_debit']=='t')?$montant:td('');
186 $row.=($q[$e]['j_debit']=='f')?$montant:td('');
187 /*
188 * Compute total in currency if not default one
189 */
190 if ( $obj->det->currency_id != 0 && $q[$e]['j_debit']=='f' ) {
191 $value=$obj->db->get_value("select oc_amount+oc_vat_amount from operation_currency where j_id=$1",[$q[$e]['j_id']]);
193
194 }
195 /* Analytic accountancy */
196 if ( $owner->MY_ANALYTIC != "nu" /*&& $div=='popup'*/){
197 if ( $g_parameter->match_analytic($q[$e]['j_poste'])) {
198
199 echo HtmlInput::hidden("amount_t".$amount_idx,$q[$e]['j_montant']);
200 $anc_op=new Anc_Operation($cn);
201 $anc_op->j_id=$q[$e]['j_id'];
202 $anc_op->in_div=$div;
203 $side=($q[$e]['j_debit'] == 'f')?'C':'D';
204
205 $str_anc.='<tr>';
206 $str_anc.=HtmlInput::hidden('opanc[]',$anc_op->j_id);
207 $str_anc.=td($q[$e]['j_qcode']);
208 $str_anc.=td($q[$e]['j_poste']);
209 $str_anc.=td(nbm($q[$e]['j_montant'])." {$side}");
210 $str_anc.=$anc_op->display_table(1,$q[$e]['j_montant'],$div);
211 $str_anc.='</tr>';
212 $amount_idx++;
213 } else {
214 $row.=td('');
215 }
216 }
217 $class=($e%2==0)?' class="even"':'class="odd"';
218 if ( $obj->det->currency_id != 0 ) {
219 $cur_amount=$cn->get_value("select oc_amount from operation_currency where j_id=$1",
220 [$q[$e]['j_id']]);
221 $row.=td(nbm($cur_amount,2),' class="num" ');
222 }
223 echo tr($row,$class);
224
225 }
226?>
227</table>
228<?php
229/*
230 * Info about currency if not in euro
231 */
232 // Add a row with currency and amount
233 if ( $obj->det->currency_id != "" && $obj->det->currency_id > 0)
234 {
235 $currency=new Acc_Currency($obj->db, $obj->det->currency_id);
236 $four_space="&nbsp;"."&nbsp;"."&nbsp;"."&nbsp;";
237
238 echo $currency->get_code(),$four_space;
239 echo _("Taux utilisé"),"&nbsp;", nbm($obj->det->currency_rate,4),$four_space;
240 echo _("Taux Réf"), "&nbsp;",nbm($obj->det->currency_rate_ref,4).$four_space;
241 echo _("Montant en devise"), "&nbsp;",nbm($sum_prod_currency,4).$four_space;
242
243 }
244?>
245</div>
246<?php
247require_once NOALYSS_TEMPLATE.'/ledger_detail_bottom.php';
248?>
249</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
global $g_parameter
global $g_user
if no group available , then stop
$input
$div
if($ledger=="") $access
$jr_id
Definition: ajax_ledger.php:44
$class
display currency , convert to euro , and save them if used.
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
static connect()
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
static history_account($p_account, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the account
static hidden($p_name, $p_value, $p_id="")
static history_card($f_id, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the card
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...)
For the periode tables parm_periode and jrn_periode.
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 UPDDATE
const UPDRECEIPT
$sum_prod_currency
$tag_operation
$inote style
$side