diff --git a/include/geschaeftsjahr.class.php b/include/geschaeftsjahr.class.php index bdad78fe0..29f2ec7ed 100644 --- a/include/geschaeftsjahr.class.php +++ b/include/geschaeftsjahr.class.php @@ -20,6 +20,7 @@ * Karl Burkhart . */ require_once('basis_db.class.php'); +require_onve('datum.class.php'); class geschaeftsjahr extends basis_db { @@ -224,5 +225,29 @@ class geschaeftsjahr extends basis_db return false; } } + + /** + * + * Liefert das Geschäftsjahr eines Datums zurück + * @param $datum + */ + public function getSpecific($datum) + { + $date = new datum; + $newDatum = $date->formatDatum($datum,'Y-m-d'); + + $qry = "SELECT * FROM public.tbl_geschaeftsjahr + WHERE '$newDatum' > public.tbl_geschaeftsjahr.start AND + '$newDatum' < public.tbl_geschaeftsjahr.ende;"; + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + return $row->geschaeftsjahr_kurbz; + } + } + return false; + } } ?> \ No newline at end of file