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