noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ledger_detail_fin.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
6//@var $dossier_id (int) folder id
7$dossier_id=Dossier::id();
8
9//@var $jr_id (int) jrn.jr_id
10//@var $obj (Acc_Operation) current operation detail
11
12//* @var $div (string) current DIV ID
13?><?php require_once NOALYSS_TEMPLATE.'/ledger_detail_top.php'; ?>
14<div class="content" >
15<?php
16 $cn=Dossier::connect();
18
19?>
20 <?php if ( $access=='W') : ?>
21<form class="print" onsubmit="return op_save(this);">
22 <?php endif; ?>
23
24 <?php echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
25 <table style="width:100%"><tr><td>
26<table>
27<tr>
28<?php
29$date=new IDate('p_date');
30if ( $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
38</tr>
39
40<tr>
41<?php
42$bk=new Fiche($cn,$obj->det->array[0]['qf_bank']);
43$view_card_detail=HtmlInput::card_detail($bk->get_quick_code(),h($bk->getName()), ' class="line" ');
44echo td(_('Compte en banque')).td($view_card_detail).td();
45
46?>
47</tr>
48<tr>
49<?php
50
51$bk=new Fiche($cn,$obj->det->array[0]['qf_other']);
52$view_card_detail=HtmlInput::card_detail($bk->get_quick_code(),h($bk->getName()), ' class="line" ');
53
54echo td(_('Tiers')).td($view_card_detail);
55?>
56</tr>
57
58<tr>
59<?php
60 $itext=new IText('lib');
61 $itext->value=(!empty($obj->det->jr_comment))?strip_tags($obj->det->jr_comment):'';
62 $itext->size=40;
63 echo td(_('Libellé')).td($itext->input(),' colspan="2" style="width:auto"');
64
65
66?>
67</tr>
68<tr>
69<?php echo td(_('montant')).td(nbm($obj->det->array[0]['qf_amount']),' class="inum"');?>
70</tr>
71<tr>
72<?php
73$itext=new IText('npj');
74$itext->value=(!empty($obj->det->jr_pj_number))?strip_tags($obj->det->jr_pj_number):'';
75echo td(_('Pièce')).td($itext->input());
76?>
77
78</tr>
79</table>
80</td>
81 <td style="width:50%;height:100%;vertical-align:top;text-align: center">
82 <table style="width:99%;height:8rem;vertical-align:top;">
83 <tr style="height: 5%">
84 <td style="text-align:center;vertical-align: top">
85 <?php
86 $inote = new ITextarea('jrn_note');
87 $inote->set_enrichText("minimal");
88 $inote->id="jrn_note{$div}";
89 $inote->style=' class="itextarea" style="width:90%;height:100%;"';
90 $inote->value = $obj->det->note_html;
91 $inote->heigh=200;
92 echo $inote->input();
93
94 ?>
95 </td>
96 </tr>
97 <tr>
98 <td id="note_html<?=$div?>" style="text-align:center;vertical-align: top">
99 <?=$obj->det->note_html?>
100 </td>
101 </tr>
102 <tr>
103 <td>
104 <div id="operation_tag_td<?=$div?>">
105 <?php
106 /******************************************************************************************************************
107 * Tags on operation
108 *****************************************************************************************************************/
110 $tag_operation->set_jrn_id($obj->det->jr_id);
111 $tag_operation->tag_cell($div);
112 ?>
113
114 </div>
115
116 <?php
117 // Button add tags
118 if ( $access=='W') { echo Tag_Operation::button_search($obj->det->jr_id,$div);}
119 ?>
120 </td>
121 </tr>
122 </table>
123 </td>
124
125</tr>
126</table>
127
128</td>
129<?php
130/**
131 * Display Currency in a column, if invoice not recorded in EUR
132 */
133if ($obj->det->currency_id!=0)
134{
135 $currency_amount=$obj->db->get_value("select oc_amount from operation_currency where j_id =$1",
136 [$obj->det->array[0]['j_id']]);
137 $currency_rate=$obj->db->get_value("select currency_rate from jrn where jr_id=$1",[$obj->jr_id]);
138 $currency_code=$obj->db->get_value("select cr_code_iso from currency where id=$1",[$obj->det->currency_id]);
139 printf (_("%s Taux utilisé %s Montant en devise %s"),$currency_code,$currency_rate,$currency_amount);
140}
141?>
142<div class="myfieldset">
143<?php
145 $detail->get();
146?>
147<?php
148 if ($owner->MY_ANALYTIC != 'nu' /*&& $div == 'popup'*/){
149 $anc=new Anc_Plan($cn);
150 $a_anc=$anc->get_list(' order by pa_id ');
151 $x=count($a_anc);
152 /* set the width of the col */
153 $str_anc .= '<th colspan="'.$x.'" style="width:auto;text-align:center">'._('Compt. Analytique').'</th>';
154
155 /* add hidden variables pa[] to hold the value of pa_id */
156 $str_anc .= Anc_Plan::hidden($a_anc);
157 }
158 bcscale(2);
159 for ($e=0;$e<count($detail->det->array);$e++) {
160 $row=''; $q=$detail->det->array;
161 $fiche=new Fiche($cn);
162 $fiche->get_by_qcode($q[$e]['j_qcode']);
163 /* Analytic accountancy */
164 if ( $owner->MY_ANALYTIC != "nu" /*&& $div == 'popup'*/)
165 {
166 $poste=$fiche->get_attribute(ATTR_DEF_ACCOUNT);
167 if ( $g_parameter->match_analytic($q[$e]['j_poste']))
168 {
169 $qcode=$fiche->get_attribute(ATTR_DEF_QUICKCODE);
170 $anc_op=new Anc_Operation($cn);
171 $anc_op->j_id=$q[$e]['j_id'];
172 $anc_op->in_div=$div;
173 $str_anc.='<tr>';
176 $str_anc.=td(nbm($q[$e]['j_montant']));
177 $str_anc.='<td>';
178 $str_anc.= HtmlInput::hidden('opanc[]',$anc_op->j_id);
179 $montant=($q[$e]['j_debit'] == "t")?$q[$e]['j_montant']:bcmul($q[$e]['j_montant'], -1);
180 $str_anc.=$anc_op->display_table(1,$montant,$div);
181 $str_anc.='</td>';
182 $str_anc.='</tr>';
183
184 }
185 }
186 }
187?>
188</div>
189<?php
190require_once NOALYSS_TEMPLATE.'/ledger_detail_bottom.php';
191?>
192</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
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
h( $row[ 'oa_description'])
if($ledger=="") $access
$jr_id
$opd_description style
_("actif, passif,charge,...")
this class manage data from the JRNX and JRN table
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...
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
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_QUICKCODE
Definition constant.php:244
const ATTR_DEF_ACCOUNT
Definition constant.php:222
const UPDDATE
$tag_operation
Tags on operation.
$view_card_detail