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:
Cris
2019-11-25 08:55:30 +01:00
committed by hainberg
parent 0a335b7627
commit 24db32f658
@@ -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);
}
}