mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Added function getOrdered_fromDate() to Vertragvertragsstatus_model
This method returns all contracts, where the status had been set to 'bestellt' on given date.
This commit is contained in:
@@ -130,5 +130,32 @@ class Vertragvertragsstatus_model extends DB_Model
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all contracts, where the status had been set to 'bestellt' on given date
|
||||
* @param string $string_date e.g. '01.11.2019' or special Date/Time inputs like 'YESTERDAY', 'TODAY', 'NOW'
|
||||
* @param bool $further_processed If true, ALL ordered contracts of that day are retrieved, even if they were
|
||||
* were ALSO approved/accepted/cancelled (further processed) on that same day.
|
||||
* @return array
|
||||
*/
|
||||
public function getOrdered_fromDate($string_date = 'TODAY', $further_processed = false)
|
||||
{
|
||||
$condition = '
|
||||
vertragsstatus_kurzbz = \'bestellt\' AND
|
||||
(insertamum)::date = date \''. $string_date .'\'
|
||||
';
|
||||
|
||||
if (!$further_processed)
|
||||
{
|
||||
$condition .= '
|
||||
AND
|
||||
vertrag_id NOT IN (
|
||||
SELECT vertrag_id
|
||||
FROM lehre.tbl_vertrag_vertragsstatus
|
||||
WHERE vertragsstatus_kurzbz IN (\'erteilt\', \'akzeptiert\', \'storno\')
|
||||
)
|
||||
';
|
||||
}
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user