noalyss Version-9
ajax_anc_detail_operation.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24
25/**
26 * @file
27 * @brief display the detail of an anc operation
28 * parameters : oa_group
29 */
31$oa_group=$http->request("oa_group","number");
32bcscale(4);
33$row=$cn->get_row("select distinct oa_group,
34 to_char(oa_date,'DD.MM.YYYY') as str_date ,
35 oa_date,
36 oa_description,
37 jr_pj_number,
38 jr_id
39 from
40 operation_analytique as oa
41 join poste_analytique using (po_id)
42 left join (select jr_id,jr_pj_number,j_id from jrn join jrnx on (jr_grpt_id=j_grpt) ) as m on (m.j_id=oa.j_id)
43 where oa_group=$1",array($oa_group));
44echo HtmlInput::title_box(_('Détail'), "anc_detail_op_div");
45echo $row['str_date'],' ',
46 h($row['oa_description']),' ',
47 h($row['jr_pj_number']);
48$a_row=$cn->get_array("select distinct oa_row from operation_analytique where oa_group=$1",array($oa_group));
49$a_plan=$cn->get_array("select distinct pa_id,pa_name from operation_analytique join poste_analytique using (po_id) join plan_analytique using (pa_id) where oa_group=$1 order by pa_name",array($oa_group));
52echo '<table class="result">';
53echo '<tr>';
54echo th(_('Fiche'));
55for ( $e=0;$e<$nb_plan;$e++) echo th($a_plan[$e]['pa_name']);
56echo th(_('Montant'),'style="text-align:right"');
57echo th(_('D/C'));
58echo '<tr>';
59
60echo '</tr>';
61for ($i=0;$i< $nb_row;$i++) {
62 $class=($i%2==0)?"even":"odd";
63 echo '<tr class="'.$class.'">';
64 // retrieve card
65 echo '<td>';
66 $f_id=$cn->get_value("select distinct f_id from operation_analytique where oa_group = $1 and oa_row=$2",[$oa_group,$a_row[$i]['oa_row']]);
67 $qcode=$cn->get_value("select ad_value from fiche_detail where f_id=$1 and ad_id=$2",[$f_id,ATTR_DEF_QUICKCODE] );
68 echo $qcode;
69 echo '</td>';
70 for ( $e = 0;$e<$nb_plan;$e++) {
71 $detail_row=$cn->get_row("select po_name , oa_amount,oa_positive ,oa_debit
72 from operation_analytique
73 join poste_analytique using (po_id)
74 join plan_analytique using (pa_id)
75 where
76 oa_group=$1
77 and oa_row=$2
78 and pa_id=$3",array($oa_group,$a_row[$i]['oa_row'],$a_plan[$e]['pa_id']));
79 echo td($detail_row['po_name']);
80 }
81 $amount=$detail_row['oa_amount'];
82 if ( $detail_row['oa_positive']=="N") {$amount=bcmul($amount,-1);}
83 echo td($amount,'style="text-align:right"');
84 $debit=($detail_row['oa_debit'] == 'f')?"C":"D";
85 echo td($debit);
86 echo '</tr>';
87
88}
89echo '</table>';
90echo '<ul class="aligned-block">';
91echo '<li>',HtmlInput::button_close("anc_detail_op_div");
92echo '</ul >';
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
h( $row[ 'oa_description'])
$class
static button_close($div_name, $class='smallbutton')
close button for the HTML popup
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
manage the http input (get , post, request) and extract from an array
const ATTR_DEF_QUICKCODE
Definition: constant.php:237