31 parent::__construct(
$p_id);
32 $this->signature=
'closing';
55 $this->exercice =
$http->request(
"exercice_cl",
"number");
66with total_account as (
67 select sum(a.montant) as tot_amount, j_poste, f_id
69 (select j_id, case when j_debit='t' then j_montant
70 else j_montant * (-1) end as montant
72 join jrnx using (j_id)
73 join parm_periode on (j_tech_per = p_id )
76 and( j_poste::text like '7%'
77 or j_poste::text like '6%')
79 having (sum(a.montant) != 0 )
83 ,(select pcm_lib from tmp_pcmn where pcm_val=t1.j_poste) as lib_accounting
85 ,(select ad_value fd2 from fiche_detail fd2 where fd2.f_id=t1.f_id and fd2.ad_id=23) qcode
86,(select fd3.ad_value from fiche_detail fd3 where fd3.f_id=t1.f_id and fd3.ad_id=1) f_name
87,abs(t1.tot_amount) atot_amount
88,case when tot_amount <0 then 'f' else 't' end debit
92 $this->operation_exercice_sql->setp(
"oe_type", $this->signature)
94 ->set(
"oe_text",_(
"Ecriture cloture $exercice_report"))
95 ->setp(
"oe_exercice", $this->exercice);
98 $this->operation_exercice_sql->insert();
100 if (empty(
$array))
return;
101 foreach (
$array as $item) {
103 $row->oe_id = $this->operation_exercice_sql->oe_id;
104 $row->oed_poste = (empty($item[
'qcode']))?$item[
"j_poste"]:
null;
105 $row->oed_qcode = $item[
"qcode"];
106 $row->oed_amount = $item[
'atot_amount'];
107 $row->oed_label=(empty($item[
'qcode']))?$item[
'lib_accounting']:$item[
'f_name'];
108 $row->oed_debit = $item[
"debit"];
113 }
catch (\Exception
$e) {
115 echo
$e->getMessage();
122 echo
h2(
"ClĂ´ture compte");
124 parent::display_result();
h2($p_string, $p_class="", $raw="")
static id()
return the 'gDossier' value after a check
insert()
insert data into data operation_exercice and operation_exercice_detail