X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdate_functions.inc;h=227a0b3472cdf7eced7cc660ed8e494e55ce67c0;hb=231addc23887aa8b906dca18ea0b2a6fe63c3c39;hp=c681353109eb44ae7548d706fd3b3d0f3e92c3e5;hpb=a5242af68e65661edb7175412444dce536a7f311;p=fa-stable.git diff --git a/includes/date_functions.inc b/includes/date_functions.inc index c6813531..227a0b34 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -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) {