angezeigte Buchungen können gefiltert werden

This commit is contained in:
Nikolaus Krondraf
2014-12-09 07:43:27 +00:00
parent bef73811e4
commit 88c2880265
2 changed files with 34 additions and 6 deletions
+11 -2
View File
@@ -395,15 +395,24 @@ class buchung extends basis_db
* @param person_id ID der Person
* @return true wenn ok, false im Fehlerfall
*/
public function getBuchungPerson($person_id)
public function getBuchungPerson($person_id, $options = null)
{
// Filter für Query aufbereiten
$filter = "";
if(!empty($options['von']))
$filter .= " AND buchungsdatum >= " . $this->db_add_param($options['von']) . " ";
if(!empty($options['bis']))
$filter .= " AND buchungsdatum <= " . $this->db_add_param($options['bis']) . " ";
$qry = "SELECT
tbl_buchung.*
FROM
wawi.tbl_buchung
JOIN wawi.tbl_konto USING(konto_id)
WHERE
tbl_konto.person_id=".$this->db_add_param($person_id, FHC_INTEGER)."
tbl_konto.person_id=".$this->db_add_param($person_id, FHC_INTEGER).
$filter ."
ORDER BY buchungsdatum";
if($result = $this->db_query($qry))