noalyss Version-9
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?><?php require_once NOALYSS_TEMPLATE.'/ledger_detail_top.php'; ?>
7<div class="content" style="padding:0;">
8<?php
11
12?>
13 <?php if ( $access=='W') : ?>
14<form class="print" onsubmit="return op_save(this);">
15 <?php endif; ?>
16
17 <?php echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
18 <table style="width:100%"><tr><td>
19<table>
20<tr>
21<?php
22$date=new IDate('p_date');
23if ( $g_parameter->MY_STRICT=='Y' && $g_user->check_action(UPDDATE)==0) {
24 $date->setReadOnly(true);
25}
26$date->value=format_date($obj->det->jr_date);
27 echo td(_('Date')).td($date->input());
28
29 ?>
30
31</tr>
32
33<tr>
34<?php
35$bk=new Fiche($cn,$obj->det->array[0]['qf_bank']);
36$view_card_detail=HtmlInput::card_detail($bk->get_quick_code(),h($bk->getName()), ' class="line" ');
37echo td(_('Compte en banque')).td($view_card_detail).td();
38
39?>
40</tr>
41<tr>
42<?php
43
44$bk=new Fiche($cn,$obj->det->array[0]['qf_other']);
45$view_card_detail=HtmlInput::card_detail($bk->get_quick_code(),h($bk->getName()), ' class="line" ');
46
47echo td(_('Tiers')).td($view_card_detail);
48?>
49</tr>
50
51<tr>
52<?php
53 $itext=new IText('lib');
54 $itext->value=(!empty($obj->det->jr_comment))?strip_tags($obj->det->jr_comment):'';
55 $itext->size=40;
56 echo td(_('Libellé')).td($itext->input(),' colspan="2" style="width:auto"');
57
58
59?>
60</tr>
61<tr>
62<?php echo td(_('montant')).td(nbm($obj->det->array[0]['qf_amount']),' class="inum"');?>
63</tr>
64<tr>
65<?php
66$itext=new IText('npj');
67$itext->value=(!empty($obj->det->jr_pj_number))?strip_tags($obj->det->jr_pj_number):'';
68echo td(_('Pièce')).td($itext->input());
69?>
70
71</tr>
72</table>
73</td>
74 <td style="width:50%;height:100%;vertical-align:top;text-align: center">
75 <table style="width:99%;height:8rem;vertical-align:top;">
76 <tr style="height: 5%">
77 <td style="text-align:center;vertical-align: top">
78 Note
79 </td></tr>
80 <tr>
81 <td style="text-align:center;vertical-align: top">
82 <?php
83 $inote = new ITextarea('jrn_note');
84 $inote->style=' class="itextarea" style="width:90%;height:100%;"';
85 $inote->value = strip_tags($obj->det->note);
86 echo $inote->input();
87 ?>
88
89 </td>
90 </tr>
91 <tr>
92 <td>
93 <div id="operation_tag_td<?=$div?>">
94 <?php
95 /******************************************************************************************************************
96 * Tags on operation
97 *****************************************************************************************************************/
99 $tag_operation->set_jrn_id($obj->det->jr_id);
100 $tag_operation->tag_cell($div);
101 ?>
102
103 </div>
104
105 <?php
106 // Button add tags
107 if ( $access=='W') { echo Tag_Operation::button_search($obj->det->jr_id,$div);}
108 ?>
109 </td>
110 </tr>
111 </table>
112 </td>
113
114</tr>
115</table>
116
117</td>
118<?php
119/**
120 * Display Currency in a column, if invoice not recorded in EUR
121 */
122if ($obj->det->currency_id!=0)
123{
124 $currency_amount=$obj->db->get_value("select oc_amount from operation_currency where j_id =$1",
125 [$obj->det->array[0]['j_id']]);
126 $currency_rate=$obj->db->get_value("select currency_rate from jrn where jr_id=$1",[$obj->jr_id]);
127 $currency_code=$obj->db->get_value("select cr_code_iso from currency where id=$1",[$obj->det->currency_id]);
128 printf (_("%s Taux utilisé %s Montant en devise %s"),$currency_code,$currency_rate,$currency_amount);
129}
130?>
131<div class="myfieldset">
132<?php
134 $detail->get();
135?>
136<?php
137 if ($owner->MY_ANALYTIC != 'nu' /*&& $div == 'popup'*/){
138 $anc=new Anc_Plan($cn);
139 $a_anc=$anc->get_list(' order by pa_id ');
140 $x=count($a_anc);
141 /* set the width of the col */
142 $str_anc .= '<th colspan="'.$x.'" style="width:auto;text-align:center">'._('Compt. Analytique').'</th>';
143
144 /* add hidden variables pa[] to hold the value of pa_id */
145 $str_anc .= Anc_Plan::hidden($a_anc);
146 }
147 bcscale(2);
148 for ($e=0;$e<count($detail->det->array);$e++) {
149 $row=''; $q=$detail->det->array;
150 $fiche=new Fiche($cn);
151 $fiche->get_by_qcode($q[$e]['j_qcode']);
152 /* Analytic accountancy */
153 if ( $owner->MY_ANALYTIC != "nu" /*&& $div == 'popup'*/)
154 {
155 $poste=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
156 if ( $g_parameter->match_analytic($q[$e]['j_poste']))
157 {
158 $qcode=$fiche->strAttribut(ATTR_DEF_QUICKCODE);
159 $anc_op=new Anc_Operation($cn);
160 $anc_op->j_id=$q[$e]['j_id'];
161 $anc_op->in_div=$div;
162 $str_anc.='<tr>';
165 $str_anc.=td(nbm($q[$e]['j_montant']));
166 $str_anc.='<td>';
167 $str_anc.= HtmlInput::hidden('opanc[]',$anc_op->j_id);
168 $montant=($q[$e]['j_debit'] == "t")?$q[$e]['j_montant']:bcmul($q[$e]['j_montant'], -1);
169 $str_anc.=$anc_op->display_table(1,$montant,$div);
170 $str_anc.='</td>';
171 $str_anc.='</tr>';
172
173 }
174 }
175 }
176?>
177</div>
178<?php
179require_once NOALYSS_TEMPLATE.'/ledger_detail_bottom.php';
180?>
181</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
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
h( $row[ 'oa_description'])
$div
if($ledger=="") $access
$jr_id
Definition: ajax_ledger.php:44
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
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 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 : 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: itext.class.php:30
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:237
const ATTR_DEF_ACCOUNT
Definition: constant.php:215
const UPDDATE
if($access=='W') if($obj->det->currency_id!=0) $detail
Display Currency in a column, if invoice not recorded in EUR.
global $g_user
$tag_operation
$view_card_detail
$inote style
global $g_parameter