From 0c429984b9b3e5b342c97cc29b123971027ce63a Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Fri, 26 Mar 2021 18:43:05 +0100 Subject: [PATCH] add new function to bisverwendung --- include/bisverwendung.class.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 774fe413f..94126f5c5 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -785,5 +785,29 @@ class bisverwendung extends basis_db return false; } } + + public function inZeitaufzeichnungspflichtigPeriod($date) + { + $dateToCheck = date('Y-m-d', strtotime($date)); + $beginn = date('Y-m-d', strtotime($this->beginn)); + $end = date('Y-m-d', strtotime($this->ende)); + $zp = $this->zeitaufzeichnungspflichtig; + + if ($zp) + { + if (($dateToCheck >= $beginn) && (($dateToCheck <= $end) OR is_null($this->ende))) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } } ?>