noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ledger_detail_bottom.php
Go to the documentation of this file.
1<hr>
2<?php
3
4/**
5//This file is part of NOALYSS and is under GPL
6//see licence.txt
7*/
8/**
9 * @brief show the common parts of operation details
10 *
11 * Variables : $div = popup or box (det[0-9]
12 *
13 */
14bcscale(2);
16$select_box=new \Select_Box("sb_".$jr_id, _("Autre action"));
17$select_box->set_position("normal");
18$cn=Dossier::connect();
19// Contains all the linked actions
21//
22// Contains all the linked operations
25$aRap=$oRap->get();
26
27// Detail of operation
28 $detail = new Acc_Misc($cn, $obj->jr_id);
29 $detail->get();
30
31 // find out exercice
32 $periode_id=new Periode($cn,$detail->det->jr_tech_per);
33 $exercice=$periode_id->get_exercice();
34
35
36$nb_document=($detail->det->jr_pj_name != "")?1:0;
37
38$nb_aRap=(is_array($aRap))?count($aRap):0;
39// Array of tab
40//
41$a_tab['writing_div']=array('id'=>'writing_div'.$div,'label'=>_('Ecriture Comptable'),'display'=>'none');
42$a_tab['info_operation_div']=array('id'=>'info_operation_div'.$div,'label'=>_('Information'),'display'=>'none');
43$a_tab['linked_operation_div']=array('id'=>'linked_operation_div'.$div,'label'=>_('Opérations liées').'('.$nb_aRap.')','display'=>'none');
44$a_tab['document_operation_div']=array('id'=>'document_operation_div'.$div,'label'=>_('Document').'('.$nb_document.')','display'=>'block');
45$a_tab['linked_action_div']=array('id'=>'linked_action_div'.$div,'label'=>_('Actions Gestion').'('.count($a_followup).')','display'=>'none');
46$a_tab['analytic_div']=array('id'=>'analytic_div'.$div,'label'=>_('Comptabilité Analytique'),'display'=>'none');
47
48
49
50// show tabs
51if ( $div != "popup") :
52 $a_tab['document_operation_div']['display']='block';
53?>
54<ul class="tabs">
55 <?php foreach ($a_tab as $idx=>$a_value): ?>
56 <?php
57 $class=($a_value['display']=='block') ?"tabs_selected":"tabs"
58 ?>
59 <li class="<?php echo $class?>">
60 <?php $div_tab_id=$a_value['id'];?>
61 <a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);var tab=Array('writing_div<?php echo $div?>','info_operation_div<?php echo $div?>','linked_operation_div<?php echo $div?>','document_operation_div<?php echo $div?>','linked_action_div<?php echo $div?>','analytic_div<?php echo $div?>');this.parentNode.className='tabs_selected' ;show_tabs(tab,'<?php echo $div_tab_id; ?>');"><?php echo _($a_value['label'])?></a>
62 </li>
63 <?php endforeach; ?>
64</ul>
65<div style="clear:both"></div>
66<?php
68 foreach ($a_tab as $idx=>$a_value):
69 $a_tab[$idx]['display']='block';
72?>
73
74
75<?php
76 $cmd=new IText('BON_COMMANDE',$obj->info->command);
77 $other=new IText('OTHER',$obj->info->other);
78?>
79 <div id="writing_div<?php echo $div;?>" class="myfieldset" style="display:<?php echo $a_tab['writing_div']['display']?>">
80 <?php
81 // display title only in popup
82 if ($div == 'popup') :
83 ?>
84 <h1 class="legend"><?php echo $a_tab['writing_div']['label']?></h1>
85 <?php endif; ?>
86
87<div class="content">
88 <?php
89
90 ?>
91 <table class="result">
92 <tr>
93 <?php
94 echo th(_('Poste Comptable'));
95 echo th(_('Quick Code'));
96 echo th(_('Libellé'));
97 echo th(_('Débit'), ' style="text-align:right"');
98 echo th(_('Crédit'), ' style="text-align:right"');
99 echo '</tr>';
100 for ($e = 0; $e < count($detail->det->array); $e++)
101 {
102 $row = '';
103 $q = $detail->det->array;
104 $view_history = HtmlInput::history_account($q[$e]['j_poste'], $q[$e]['j_poste'], "", $exercice);
105
106 $row.=td($view_history);
107 if ($q[$e]['j_qcode'] != '')
108 {
109 $fiche = new Fiche($cn);
110 $fiche->get_by_qcode($q[$e]['j_qcode']);
111 $view_history = HtmlInput::history_card($fiche->id, $q[$e]['j_qcode'],"",$exercice);
112 } else
113 $view_history = '';
114 $row.=td($view_history);
115
116 if ($q[$e]['j_text']=="")
117 {
118 if ($q[$e]['j_qcode'] != '')
119 {
120 // nom de la fiche
121 $ff = new Fiche($cn);
122 $ff->get_by_qcode($q[$e]['j_qcode']);
123 $row.=td($ff->strAttribut(h(ATTR_DEF_NAME)));
124 } else
125 {
126 // libellé du compte
127 $name = $cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1', array($q[$e]['j_poste']));
128 $row.=td(h($name));
129 }
130 }
131 else
132 $row.=td(h($q[$e]['j_text']));
133
134 $montant = td(nbm($q[$e]['j_montant']), 'class="num"');
135 $row.=($q[$e]['j_debit'] == 't') ? $montant : td('');
136 $row.=($q[$e]['j_debit'] == 'f') ? $montant : td('');
137 $class=($e%2==0)?' class="even"':'class="odd"';
138
139 echo tr($row,$class);
140 }
141 ?>
142 </table>
143 </div>
144</div>
145<div id="info_operation_div<?php echo $div;?>" class="myfieldset" style="display:<?php echo $a_tab['info_operation_div']['display']?>">
146 <?php
147 // display title only in popup
148 if ($div == 'popup') :
149 ?>
150 <h1 class="legend"><?php echo $a_tab['info_operation_div']['label']?></h1>
151 <?php endif; ?>
152 <table>
153 <tr>
154 <td><?php echo _(" Bon de commande")?> :</td><td> <?php echo Icon_Action::infobulle(31)." ".$cmd->input(); ?></td>
155 </tr>
156 <tr>
157 <td> <?php echo _("Autre information")?> : </td><td><?php echo Icon_Action::infobulle(30)." ".$other->input();?></td>
158 </tr>
159 <tr>
160 <td>
161 <?=_("Type opération")?>
162 </td>
163 <td>
164 <?php
165 // Opération type
166
167 echo Acc_Operation::select_operation_type($detail->det->jr_optype)->input();
168 ?>
169 </td>
170 </tr>
171 </table>
172</div>
173<div id="linked_operation_div<?php echo $div;?>" style="display:<?php echo $a_tab['linked_operation_div']['display']?>" class="myfieldset">
174 <?php
175 // display title only in popup
176 if ($div == 'popup') :
177 ?> er
178 <h1 class="legend"><?php echo $a_tab['linked_operation_div']['label']?></h1>
179 <?php endif; ?>
180<?php
181
182if ($aRap != null ) {
183 $amount_tva_include=(isset($total_tvac))?$total_tvac:$detail->det->jr_montant;
184 $tableid="tb".$div;
185 $total_rec=0;
187 $operation->set_id($jr_id);
188 echo '<table id="'.$tableid.'">';
189 for ($e=0;$e<count($aRap);$e++) {
190 $opRap=new Acc_Operation($cn);
191 $opRap->jr_id=$aRap[$e];
192 $internal=$opRap->get_internal();
193 $array_jr=$cn->get_array('select jr_date,jr_pj_number,jr_montant,jr_comment , jr_internal ,jr_optype
194 from jrn where jr_id=$1',
195 array($aRap[$e]));
196 $amount=$array_jr[0]['jr_montant'];
197 switch (substr($array_jr[0]['jr_internal'],0,1)) {
198 case 'A':
199 $amount = $cn->get_value("select sum(qp_price+qp_vat+qp_nd_tva+qp_nd_tva_recup-qp_vat_sided) from quant_purchase qp
200 where qp_internal=$1",
201 array($internal));
202 // add additional tax if any
203 $add=$operation->get_sum_other_tax();
205 break;
206 case 'V':
207 $amount=$cn->get_value("select sum(qs_price+qs_vat-qs_vat_sided) from quant_sold qs
208 where qs_internal=$1",
209 array($internal));
210 // add additional tax if any
211 $add=$operation->get_sum_other_tax();
212 $amount=bcadd($amount??0,$add??0,2);
213 break;
214 }
215 $total_rec=bcadd($total_rec,$amount??0);
216 $str="modifyOperation(".$aRap[$e].",".$gDossier.")";
217
218 // If write access , allow to drop Reconciles operations
219 if ( $access=='W') {
220 $js="return confirm_box(null,'"._("vous confirmez?")."',";
221 $js.=sprintf('function () { dropLink(\'%s\',\'%s\',\'%s\',\'%s\');deleteRowRec(\'%s\',$(\'row%d\'));})',
222 $gDossier,
223 $div,
224 $jr_id,
225 $aRap[$e],
226 $tableid,
227 $e
228 );
229 $remove=Icon_Action::trash(uniqid(), $js);
230 }
231 else
232 $remove='';
233
234 $comment=strip_tags($array_jr[0]['jr_comment']??"");
235 $pj_nb=h($array_jr[0]['jr_pj_number']);
236 echo tr (td(format_date($array_jr[0]['jr_date'])).
237 td('<a class="line" href="javascript:void(0)" onclick="'.$str.'" >'.$internal.'</A>').
238 td($pj_nb).
239 td($comment).
240 td(_('montant').'='.nbm($amount)).
241 td(_('delta').'='.nbm(bcsub(abs($amount_tva_include),abs($total_rec)))).
242 td($remove),' id = "row'.$e.'"');
243 }
244 echo '</table>';
245}
246?>
247<?php
248if ( $access=='W') {
249 $wConcerned=new IConcerned("rapt".$div);
250 $wConcerned->amount_id=$obj->det->jr_montant;
251 $wConcerned->div="search_reconcile";
252 $wConcerned->set_hideOperation( $obj->jr_id);
253 echo $wConcerned->input();
254
255}
256?>
257</div>
258<div id="linked_action_div<?php echo $div;?>" style="display:<?php echo $a_tab['linked_action_div']['display']?>" class="myfieldset">
259 <?php
260 // display title only in popup
261 if ($div == 'popup') :
262 ?>
263 <h1 class="legend"><?php echo $a_tab['linked_action_div']['label']?></h1>
264 <?php endif; ?>
265<?php
266/**
267 * show possible linked actions
268 */
269echo '<ul style="list-style-type:square;">';
270for ($i = 0; $i < count($a_followup); $i++)
271{
272 $remove='';
274 if ( $div == 'popup')
275 {
276 echo '<li id="op'.$a_followup[$i]['ago_id'].'">'.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),0).$remove.'</li>';
277 }
278 else
279 {
280 echo '<li id="op'.$a_followup[$i]['ago_id'].'">'.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),1).$remove.'</li>';
281 }
282}
283echo '</ul>';
284$related=new IRelated_Action('related');
285$related->id='related'.$div;
286 if ( $access=='W') echo $related->input();
287echo '</div>';
288?>
289
290<?php
291
292require_once NOALYSS_TEMPLATE.'/ledger_detail_file.php';
293?>
294
295
296<div id="analytic_div<?php echo $div;?>" style="overflow:auto;display:<?php echo $a_tab['analytic_div']['display']?>">
297 <?php
298 if ($div == 'popup') :
299 ?>
300 <h1 class="legend"><?php echo $a_tab['analytic_div']['label']?></h1>
301 <?php endif; ?>
302 <?php if ( $owner->MY_ANALYTIC != "nu") :
303 if ( strpos($str_anc,'<td>') == true ):
304 ?>
305
306 <table class="result">
307 <?php echo $str_anc;?>
308 </table>
309 <?php else: ?>
310 <span class="notice">
311 <?php echo _('Aucune donnée'); ?>
312 </span>
313 <?php endif;?>
314<?php else:?>
315 <span class="notice">
316 <?php echo _('Non utilisée'); ?>
317 </span>
318<?php endif;?>
319</div>
320
321<hr>
322<?php
323 echo '<p style="text-align:center">';
324
325if ( $div != 'popup' ) {
326 $a=new IButton('Fermer',_('Fermer'));
327 $a->label=_("Fermer");
328 $a->javascript="removeDiv('".$div."')";
329 echo $a->input();
330} else {
331 echo HtmlInput::hidden('p_jrn',$oLedger->id);
332}
333
334?>
335
336<?php
337
338/**
339 * if you can write
340 */
341 if ( $access=='W') {
342 echo HtmlInput::submit('save',_('Sauver'),'onClick="return verify_ca(\'popup\');"');
344 if ($owner->MY_ANALYTIC != 'nu' /*&& $div=='popup' */){
345
346 $select_box->add_javascript(_("Vérification CA"), sprintf("verify_ca('%s')",$div));
347 }
348
349 $per=new Periode($cn,$obj->det->jr_tech_per);
350 if ( $per->is_closed() == 0 && $owner->MY_STRICT=='N' && $g_user->check_action(RMOPER)==1)
351 {
352 $javascript="return confirm_box(null,content[50],function () {removeOperation('".$obj->det->jr_id."',".dossier::id().",'".$div."')})";
353 $select_box->add_javascript(_("Supprimer"), $javascript);
354 }
355 //----------------------------------------------------
356 // Extourne
357 //----------------------------------------------------
358 $select_box->add_javascript(_("Extourne"), sprintf("g('ext%s').style.display='block'",$div));
359
360 //-------------------------------------------------------------------
361 // Duplicate
362 //-------------------------------------------------------------------
363 $select_box->add_javascript(_("Dupliquer"),sprintf("duplicate_operation('%s','%s')",Dossier::id(),$obj->jr_id));
364
365 //-------------------------------------------------------------------
366 // Export PDF
367 //-------------------------------------------------------------------
368 $select_box->add_url(_("Export PDF"), "export.php?".
369 http_build_query(array("act"=>"PDF:operation_detail","gDossier"=>Dossier::id(),"operation_id"=>$obj->jr_id)));
370
371
372echo $select_box->input();
373echo '</p>';
374echo '</form>';
375
376 echo '<div id="ext'.$div.'" class="inner_box" style="position:absolute;top:40px;display:none">';
377 $date=new IDate('ext_date');
378 $extourne_label=new IText("ext_label");
379 $extourne_label->size=40;
380 $r="<form id=\"form_".$div."\" onsubmit=\"return false;\">";
381 $r.=HtmlInput::hidden('jr_id',$obj->jr_id)
382 . HtmlInput::hidden('div',$div).dossier::hidden().HtmlInput::hidden('act','reverseop');
383 $r.=HtmlInput::title_box(_('Extourner'), 'ext'.$div, 'hide');
384 $r.="<p>";
385 $r.= _("Extourner une opération vous permet de l'annuler par son écriture inverse");
386 $r.="</p>";
387
388 $r.="<p>";
389 $r.=_("entrez une date")." :".$date->input();
390 $r.="</p>";
391
392 $r.="<p>";
393 $r.=_("Libellé")." :".$extourne_label->input();
394 $r.="</p>";
395
396
397 $r.='<p style="text-align:center">';
398 $r.=HtmlInput::submit('x','accepter',
399 'onclick="confirm_box($(\'form_'.$div.'\'),content[50],function () {$(\'form_'.$div.'\').divname=\''.$div.'\';reverseOperation($(\'form_'.$div.'\'))}); return false"');
400 $r.=HtmlInput::button_hide( "ext".$div);
401 $r.="</p>";
402 $r.='</form>';
403 echo $r;
404 echo '</div>';
405
406
407
408}else {
409 echo '</p>';
410}
411?>
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
noalyss_bcadd($p_first, $p_second, $p_decimal=4)
th($p_string, $p_extra='', $raw='')
Definition ac_common.php:58
span($p_string, $p_extra='')
Definition ac_common.php:43
h1($p_string, $p_class="")
Definition ac_common.php:72
tr($p_string, $p_extra='')
Definition ac_common.php:88
p($p_string)
Definition ac_common.php:39
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.
if(isset($tot['tva'][$a]))($tot['tva'][$a])?></td ><?php else endforeach
global $g_user
if no group available , then stop
if(headers_sent() &&DEBUGNOALYSS > 0) else
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
catch(Exception $e) $exercice
if($ledger=="") $access
$jr_id
$opd_description style
$periode_id
_("actif, passif,charge,...")
else $card content[$j]['j_montant']
this class manage data from the JRNX and JRN table
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
static select_operation_type($p_status)
Return a select object to choose the type of operation.
new class for managing the reconciliation it must be used instead of the function InsertRapt,...
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
static get_all_operation($p_jr_id)
static detail_action($ag_id, $p_mesg, $p_modify=1)
return an anchor to view the detail of an action
static button_action_remove_operation($p_operation)
static hidden($p_name, $p_value, $p_id="")
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n', $raw="")
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input.
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.
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
static trash($p_id, $p_javascript)
Display the icon of a trashbin.
static echo_file($msg, $print=true)
display the file
Definition dbg.php:88
Class to manage the company parameter (address, name...)
$all table
const ATTR_DEF_NAME
Definition constant.php:216
const RMOPER
$str
Definition fiche.inc.php:91