X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdate_functions.inc;h=227a0b3472cdf7eced7cc660ed8e494e55ce67c0;hb=3bf71dd6f93ecac6b93fe98d23b247869cbeb720;hp=24f3b8f8b78bb1e52be9cd8056aa6bc77de457f4;hpb=818719f38b8327cdca616d58b13913dbd174d96a;p=fa-stable.git diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 24f3b8f8..227a0b34 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -1,13 +1,13 @@ . + See the License here . ***********************************************************************/ /* date validation and parsing functions @@ -141,6 +141,19 @@ function Now() else return date("H:i"); } +// +// Retrieve and optionaly set default date for new document. +// +function new_doc_date($date=null) +{ + if (isset($date)) + $_SESSION['_default_date'] = $date; + + if (!isset($_SESSION['_default_date']) || !sticky_doc_date()) + $_SESSION['_default_date'] = Today(); + + return $_SESSION['_default_date']; +} function is_date_in_fiscalyear($date, $convert=false) {