37 parent::__construct(
$p_id);
38 $this->signature =
'opening';
82 $this->exercice =
$http->request(
"exercice",
"number");
83 $this->from_folder =
$http->request(
"dos_id",
"number");
93 $other_dossier =
new Database($this->from_folder);
96with total_account as (
97 select sum(a.montant) as tot_amount, j_poste, f_id
99 (select j_id, case when j_debit='t' then j_montant
100 else j_montant * (-1) end as montant
102 join jrnx using (j_id)
103 join parm_periode on (j_tech_per = p_id )
106 and j_poste::text not like '7%'
107 and j_poste::text not like '6%'
108 group by j_poste,f_id
109 having (sum(a.montant) != 0 )
113 ,(select pcm_lib from tmp_pcmn where pcm_val=t1.j_poste) as lib_accounting
115 ,(select ad_value fd2 from fiche_detail fd2 where fd2.f_id=t1.f_id and fd2.ad_id=23) qcode
116,(select fd3.ad_value from fiche_detail fd3 where fd3.f_id=t1.f_id and fd3.ad_id=1) f_name
117,abs(t1.tot_amount) atot_amount
118,case when tot_amount <0 then 'f' else 't' end debit
121 $exercice_report=$this->exercice+1;
122 $this->operation_exercice_sql->setp(
"oe_type", $this->signature)
123 ->setp(
"oe_dossier_id", $this->from_folder)
124 ->set(
"oe_text",_(
"Ecriture ouverture $exercice_report"))
125 ->setp(
"oe_exercice", $this->exercice);
128 $this->operation_exercice_sql->insert();
129 $array = $other_dossier->get_array(
$sql, array($this->exercice));
130 if (empty(
$array))
return;
131 foreach (
$array as $item) {
133 $row->oe_id = $this->operation_exercice_sql->oe_id;
134 $row->oed_poste = (empty($item[
'qcode']))?$item[
"j_poste"]:
null;
135 $row->oed_qcode = $item[
"qcode"];
136 $row->oed_amount = $item[
'atot_amount'];
137 $row->oed_label=(empty($item[
'qcode']))?$item[
'lib_accounting']:$item[
'f_name'];
138 $row->oed_debit = $item[
"debit"];
143 }
catch (\Exception
$e) {
145 echo
$e->getMessage();
152 echo
h2(
"Ouverture compte");
154 parent::display_result();
h2($p_string, $p_class="", $raw="")
contains the class for connecting to Noalyss
set_from_folder($from_folder)
insert()
insert data into data operation_exercice and operation_exercice_detail