26require_once NOALYSS_INCLUDE.
'/constant.php';
40 parent::__construct($p_cn);
43 $this->ga_description=
null;
53 if (strlen ($this->
ga_id) > 10 )
return '<span class="notice">'.
54 _(
'Taille de la code trop long maximum 10 caractères').
'</span>';
55 $sql=
" insert into groupe_analytique (ga_id,ga_description,pa_id) values ($1,$2,$3)";
59 $this->ga_description,
65 return '<span class="notice">Doublon !!</span>';
77 $sql=
" delete from groupe_analytique where ga_id=$1";
88 $sql=
"select ga_id, ga_description,pa_id from groupe_analytique where".
95 $this->ga_description=
$array[
'ga_description'];
110 $this->ga_description=
$p_array[
'ga_description'];
114 $sql=
" select ga_id,groupe_analytique.pa_id,pa_name,ga_description ".
115 " from groupe_analytique ".
116 " join plan_analytique using (pa_id)";
125 $obj->get_from_array($m);
126 $obj->pa_name=
$m[
'pa_name'];
137 if ( $this->
from !=
"" )
139 $sql.=
" $and oa_date >= to_date('".$this->from.
"','DD.MM.YYYY')";
142 if ( $this->
to !=
"" )
144 $sql.=
" $and oa_date <= to_date('".$this->to.
"','DD.MM.YYYY')";
149 $sql.=
" $and upper(po_name)>= upper('".$this->from_poste.
"')";
154 $sql.=
" $and upper(po_name)<= upper('".$this->to_poste.
"')";
165 $sql=
"with m as (select po_id,
169 case when oa_debit = 't' then oa_amount
172 case when oa_debit = 'f' then oa_amount
176 from operation_analytique
177join poste_analytique using (po_id)
178where pa_id=$1 $filter_date )
179select sum(amount_cred) as sum_cred, sum(amount_deb)as sum_deb,po_name,ga_id,ga_description,po_description
180from m left join groupe_analytique using (ga_id)
181group by ga_id,po_name,ga_description,po_description
182order by ga_description,po_name";
190 if ( $this->
check() != 0)
192 alert(
'Désolé mais une des dates données n\'est pas valide');
197 if ( empty (
$array) )
return "";
198 require_once NOALYSS_TEMPLATE.
'/anc_balance_group.php';
210 $r.=
'<form method="GET" action="export.php" style="display:inline">';
218 $r.= dossier::hidden();
228 $cvs->write_header(array(
"groupe",
"activité",
"description",
"débit",
"credit",
"solde"));
234 $cvs->add(
$array[
$i][
'po_description']);
235 $cvs->add(
$array[
$i][
'sum_deb'],
"number");
236 $cvs->add(
$array[
$i][
'sum_cred'],
"number");
251 $o->ga_id=
"DD' dd dDD";
252 $o->ga_description=
"Test 1";
256 $o->ga_description=
"Test 1";
noalyss_str_replace($search, $replace, $string)
alert($p_msg, $buffer=false)
alert in javascript
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$anc_grandlivre from_poste
class for the group of the analytic account
get_from_array($p_array)
fill the object thanks an array
insert()
insert into the database an object
load()
load the todo_list row thanks it's ID
show_button($p_hidden="")
display the button export CSV
set_sql_filter()
Set the filter (account_date)
this class is the mother class for the CA printing
static fetch_all($ret)
wrapper for the function pg_fetch_all
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
Manage the CSV : manage files and write CSV record.