From f65300d10883c0c82eb8e93a70fb472e15bdd208 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 26 Dec 2016 13:04:16 +0200 Subject: [PATCH] Fix timezone for date invoice number pattern --- app/Models/Account.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 5231fee40465..30e40ef71163 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -103,10 +103,10 @@ class Account extends Eloquent public static $advancedSettings = [ ACCOUNT_INVOICE_SETTINGS, ACCOUNT_INVOICE_DESIGN, + ACCOUNT_CLIENT_PORTAL, ACCOUNT_EMAIL_SETTINGS, ACCOUNT_TEMPLATES_AND_REMINDERS, ACCOUNT_BANKS, - ACCOUNT_CLIENT_PORTAL, ACCOUNT_REPORTS, ACCOUNT_DATA_VISUALIZATIONS, ACCOUNT_API_TOKENS, @@ -939,7 +939,8 @@ class Account extends Eloquent if (count($matches) > 1) { $format = $matches[1]; $search[] = $matches[0]; - $replace[] = str_replace($format, date($format), $matches[1]); + $date = Carbon::now(session(SESSION_TIMEZONE, DEFAULT_TIMEZONE))->format($format); + $replace[] = str_replace($format, $date, $matches[1]); } $pattern = str_replace($search, $replace, $pattern);