noalyss Version-9
Public Member Functions | Private Attributes
Prepared_Query Class Reference

contains prepared query used in different classes of the application More...

+ Collaboration diagram for Prepared_Query:

Public Member Functions

 __construct (Database $cn)
 
 get_db ()
 
 prepare_currency ()
 Prepare the query for find the amount in currency. More...
 
 prepare_reconcile_date ()
 Prepare the query for fetching the linked operation. More...
 
 set_db ($db)
 

Private Attributes

 $db
 Database connection. More...
 

Detailed Description

contains prepared query used in different classes of the application

Definition at line 35 of file prepared_query.class.php.

Constructor & Destructor Documentation

◆ __construct()

Prepared_Query::__construct ( Database  $cn)

Definition at line 38 of file prepared_query.class.php.

39 {
40 $this->db=$cn;
41 }
$SecUser db

References $cn, and db.

Member Function Documentation

◆ get_db()

Prepared_Query::get_db ( )

Definition at line 43 of file prepared_query.class.php.

44 {
45 return $this->db;
46 }
$db
Database connection.

References $db.

◆ prepare_currency()

Prepared_Query::prepare_currency ( )

Prepare the query for find the amount in currency.

Definition at line 92 of file prepared_query.class.php.

93 {
94 $prepare=$this->db->is_prepare("amount_cur");
95 if ($prepare==FALSE)
96 {
97
98 $this->db->prepare("amount_cur",
99 "select jrn2.jr_id ,
100 sum(coalesce(oc_amount,0)) as sum_ocamount
101 from operation_currency
102 join jrnx using (j_id)
103 join jrn as jrn2 on (j_grpt=jrn2.jr_grpt_Id)
104 where
105 j_id in (select j_id from jrnx where j_grpt=jrn2.jr_grpt_id )
106 and jr_id=$1
107 group by jr_id"
108 );
109 }
110 }

References db.

◆ prepare_reconcile_date()

Prepared_Query::prepare_reconcile_date ( )

Prepare the query for fetching the linked operation.

ONE paramete is needed : jrn.jr_id , returns all columns from the table PUBLIC.JRN, column qcode_bank (default card for fin ledger) of the operation concerning to the payment

See also
export_ledger_pdf.php
Acc_Ledger_History

Definition at line 63 of file prepared_query.class.php.

64 {
65 $prepare=$this->db->is_prepare("reconcile_date");
66 if ($prepare==FALSE)
67 {
68 $this->db->prepare('reconcile_date',
69 'select *
70 , (select ad_value from fiche_detail where ad_id=23 and f_id=jrn_def.jrn_def_bank ) as qcode_bank
71 , (select ad_value from fiche_detail where ad_id=1 and f_id=jrn_def.jrn_def_bank ) as qcode_name
72 from
73 jrn
74 join jrn_def on (jrn.jr_def_id=jrn_def.jrn_def_id)
75 where
76 jr_id in
77 (select
78 jra_concerned
79 from
80 jrn_rapt
81 where jr_id = $1
82 union all
83 select
84 jr_id
85 from jrn_rapt
86 where jra_concerned=$1)');
87 }
88 }

References db.

◆ set_db()

Prepared_Query::set_db (   $db)

Definition at line 48 of file prepared_query.class.php.

49 {
50 $this->db=$db;
51 return $this;
52 }

References $db, and db.

Field Documentation

◆ $db

Prepared_Query::$db
private

Database connection.

Definition at line 36 of file prepared_query.class.php.

Referenced by get_db(), and set_db().


The documentation for this class was generated from the following file: