mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
added Plausicheck CORE_STUDENTSTATUS_0015 for finding persons without Konto Buchungen (charges), Plausichecks GUI: generic plausicheck error text is displayed if not defined erroroccured, instead of success message
This commit is contained in:
@@ -879,6 +879,57 @@ class PlausicheckLib
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with a negative or zero value.
|
||||
* @param studiensemester_kurzbz string if check is to be executed for certain Studiensemester
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAktiverStudentstatusOhneKontobuchung($studiensemester_kurzbz, $studiengang_kz = null, $prestudent_id = null)
|
||||
{
|
||||
$params = array($studiensemester_kurzbz);
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT ON (pre.prestudent_id)
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz, status.studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudent pre
|
||||
JOIN public.tbl_person pers USING(person_id)
|
||||
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
status.studiensemester_kurzbz = ?
|
||||
AND status.status_kurzbz IN ('Student', 'Incoming')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
public.tbl_konto
|
||||
WHERE
|
||||
person_id = pers.person_id
|
||||
AND studiensemester_kurzbz = status.studiensemester_kurzbz
|
||||
AND buchungsnr_verweis IS NULL
|
||||
AND betrag <= 0
|
||||
)
|
||||
AND stg.melderelevant
|
||||
AND pre.bismelden";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Person checks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user