mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
Merge branch 'feature-30660/FHC4_StudierendenGUI_Prototyp' of github.com:FH-Complete/FHC-Core into feature-30660/FHC4_StudierendenGUI_Prototyp
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class Konto_model extends DB_Model
|
||||
{
|
||||
|
||||
@@ -14,14 +17,11 @@ class Konto_model extends DB_Model
|
||||
|
||||
|
||||
/**
|
||||
* Get all accounting entries for a person optionally filtered by Studiengang
|
||||
* Adds additional fields to the Query
|
||||
*
|
||||
* @param integer|array $person_id
|
||||
* @param string (optional) $studiengang_kz
|
||||
*
|
||||
* @return stdClass
|
||||
* @return Konto_model
|
||||
*/
|
||||
public function getAlleBuchungen($person_id, $studiengang_kz = '')
|
||||
public function withAdditionalInfo()
|
||||
{
|
||||
$this->addSelect($this->dbTable . '.*');
|
||||
$this->addSelect('UPPER(typ::varchar(1) || kurzbz) AS kuerzel');
|
||||
@@ -35,6 +35,23 @@ class Konto_model extends DB_Model
|
||||
$this->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->addJoin('public.tbl_person person', 'person_id', 'LEFT');
|
||||
|
||||
Events::trigger('konto_query');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all accounting entries for a person optionally filtered by Studiengang
|
||||
*
|
||||
* @param integer|array $person_id
|
||||
* @param string (optional) $studiengang_kz
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getAlleBuchungen($person_id, $studiengang_kz = '')
|
||||
{
|
||||
$this->withAdditionalInfo();
|
||||
|
||||
$this->addOrder('buchungsdatum');
|
||||
|
||||
if (is_array($person_id))
|
||||
@@ -79,6 +96,34 @@ class Konto_model extends DB_Model
|
||||
return $this->getAlleBuchungen($person_id, $studiengang_kz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check double Buchungen
|
||||
*
|
||||
* @param array $person_ids
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param array $buchungstyp_kurzbzs
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function checkDoubleBuchung($person_ids, $studiensemester_kurzbz, $buchungstyp_kurzbzs)
|
||||
{
|
||||
$this->addSelect('vorname');
|
||||
$this->addSelect('nachname');
|
||||
|
||||
$this->addJoin('public.tbl_person', 'person_id');
|
||||
|
||||
$this->db->where_in('person_id', $person_ids);
|
||||
$this->db->where_in('buchungstyp_kurzbz', $buchungstyp_kurzbzs);
|
||||
|
||||
$this->addGroupBy('vorname, nachname');
|
||||
$this->addOrder('nachname');
|
||||
$this->addOrder('vorname');
|
||||
|
||||
return $this->loadWhere([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a Payment as paid
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user