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 
22 if (!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");
32 bcscale(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));
44 echo HtmlInput::title_box(_('Détail'), "anc_detail_op_div");
45 echo $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));
50 $nb_row=count($a_row);
52 echo '<table class="result">';
53 echo '<tr>';
54 echo th(_('Fiche'));
55 for ( $e=0;$e<$nb_plan;$e++) echo th($a_plan[$e]['pa_name']);
56 echo th(_('Montant'),'style="text-align:right"');
57 echo th(_('D/C'));
58 echo '<tr>';
59 
60 echo '</tr>';
61 for ($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 }
89 echo '</table>';
90 echo '<ul class="aligned-block">';
91 echo '<li>',HtmlInput::button_close("anc_detail_op_div");
92 echo '</ul >';
$class
$class
Definition: cfgplugin.inc.php:128
h
h( $row[ 'oa_description'])
Definition: ajax_anc_detail_operation.php:46
$e
$e
Definition: result_cat_card_summary.php:26
HtmlInput\button_close
static button_close($div_name)
close button for the HTML popup
Definition: html_input.class.php:430
HttpInput
manage the http input (get , post, request) and extract from an array
Definition: http_input.class.php:37
$qcode
$qcode
Definition: category_operation.inc.php:35
HtmlInput\title_box
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".
Definition: html_input.class.php:838
$nb_row
$nb_row
Definition: ajax_anc_detail_operation.php:50
$a_plan
$a_plan
Definition: ajax_anc_detail_operation.php:49
$nb_plan
$nb_plan
Definition: ajax_anc_detail_operation.php:51
$i
$i
Definition: action_document_type_mtable_input.php:83
$f_id
$f_id
Definition: ajax_action_remove_concerned.php:31
$oa_group
$oa_group
Definition: ajax_anc_detail_operation.php:31
$amount
$amount
Definition: ajax_anc_key_compute.php:40
$http
$http
Definition: ajax_anc_detail_operation.php:30
$cn
$cn
Definition: ajax_anc_accounting.php:30
ATTR_DEF_QUICKCODE
const ATTR_DEF_QUICKCODE
Definition: constant.php:227
$a_row
$a_row
Definition: ajax_anc_detail_operation.php:48
th
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
td
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
$row
$row
Definition: ajax_anc_detail_operation.php:33