noalyss Version-9
filter_data_currency_accounting.class.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 * PhpCompta 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 (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
21
22
23/**
24 * @file
25 * @brief filter data in currency from datase , inherit from Data_Currency_Operation, filter on
26 * a range of accounting or only one
27 */
28
29/**
30 * @class Filter_Data_Currency_Accounting
31 * @brief filter data in currency from datase , inherit from Data_Currency_Operation, filter on
32 * a range of accounting or only one
33 */
35{
36
39
41 {
42 parent::__construct($cn, $from_date, $to_date, $currency_id);
43 $this->from_accounting=$from_accounting;
44 $this->to_accounting=$to_accounting;
45 }
46 /**
47 * @brief from_accounting : lowest accounting range
48 * @return accounting (string)
49 */
50 public function getFrom_accounting()
51 {
53 }
54 /**
55 *
56 * @brief to_accounting : highest accounting range
57 * @return accounting (string)
58 */
59 public function getTo_accounting()
60 {
62 }
63/**
64 *
65 * @brief from_accounting : lowest accounting range
66 * @return accounting (string)
67 */
69 {
70 $this->from_accounting=$from_accounting;
71 return $this;
72 }
73 /**
74 *
75 * @brief to_accounting : highest accounting range
76 * @return accounting (string)
77 */
79 {
80 $this->to_accounting=$to_accounting;
81 return $this;
82 }
83 /**
84 *
85 * @brief build the SQL condition
86 * @return SQL condition
87 */
88 public function SQL_Condition()
89 {
90 $sql=parent::SQL_Condition();
91 $sql.=' and j_poste >= $4 and j_poste <= $5';
92 return $sql;
93 }
94 /**
95 * @brief returns data
96 * @return array
97 */
98 public function get_data()
99 {
100 $sql=$this->build_SQL();
101 $aArray=$this->getDbconx()->get_array($sql,
102 [$this->getCurrency_id(),
103 $this->getFrom_date(),
104 $this->getTo_date(),
105 $this->getFrom_accounting(),
106 $this->getTo_accounting()]);
107
108 return $aArray;
109 }
110 public function info()
111 {
112 return sprintf("currency_id %s from_date %s to_date %s from_accounting %s to_accounting %s",
113 $this->getCurrency_id(),$this->getFrom_date(),$this->getTo_date(),$this->getFrom_accounting(),
114 $this->getTo_accounting());
115 }
116
117}
build the SQL and fetch data of data currency operation from database ,
build_SQL()
build the SQL to execute
filter data in currency from datase , inherit from Data_Currency_Operation, filter on a range of acco...
getFrom_accounting()
from_accounting : lowest accounting range
setFrom_accounting($from_accounting)
from_accounting : lowest accounting range
getTo_accounting()
to_accounting : highest accounting range
setTo_accounting($to_accounting)
to_accounting : highest accounting range
__construct($cn, $from_date, $to_date, $currency_id, $from_accounting, $to_accounting)