noalyss Version-9
filter_data_currency_card.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 froqm datase , inherit from Data_Currency_Operation, filter on
26 * a specific card
27 */
28
29/**
30 * @class Filter_Data_Currency_Card
31 * @brief filter data in currency froqm datase , inherit from Data_Currency_Operation, filter on
32 * a specific card
33 */
35{
36
37 private $card; //!< qcode of a card
38
40 {
41 parent::__construct($cn, $from_date, $to_date, $currency_id);
42 $this->card=$card;
43 }
44
45 public function getCard()
46 {
47 return $this->card;
48 }
49
50 public function setCard($card)
51 {
52 $this->card=$card;
53 }
54
55 /**
56 *
57 * @brief build the SQL condition
58 * @return SQL condition
59 */
60 public function SQL_Condition()
61 {
62 $sql=parent::SQL_Condition();
63 $sql.=" and f_id=$4";
64 return $sql;
65 }
66
67 /**
68 * @brief returns data
69 * @return array
70 */
71 public function get_data()
72 {
73 $sql=$this->build_SQL();
74 $card_id=$this->getDbconx()->get_value("select f_id from fiche_detail where ad_id=23 and ad_value=$1",
75 [trim(strtoupper($this->card))]);
76 if (empty($card_id))
77 {
78 throw new Exception(_("Fiche non trouvée"));
79 }
80 $aArray=$this->getDbconx()->get_array($sql,
81 [$this->getCurrency_id(),
82 $this->getFrom_date(),
83 $this->getTo_date(),
84 $card_id]);
85
86 return $aArray;
87 }
88
89}
build the SQL and fetch data of data currency operation from database ,
build_SQL()
build the SQL to execute
filter data in currency froqm datase , inherit from Data_Currency_Operation, filter on a specific car...
__construct($cn, $from_date, $to_date, $currency_id, $card)
$card_id