diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 836d223162e3..4fc57c4d3233 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -127,6 +127,19 @@ class Utils return $response; } + public static function getLastURL() + { + if (!count(Session::get(RECENTLY_VIEWED))) { + return '#'; + } + + $history = Session::get(RECENTLY_VIEWED); + $last = $history[0]; + $penultimate = count($history) > 1 ? $history[1] : $last; + + return Request::url() == $last->url ? $penultimate->url : $last->url; + } + public static function getProLabel($feature) { if (Auth::check() @@ -394,12 +407,8 @@ class Utils continue; } - // temporary fix to check for new property in session - if (!property_exists($item, 'accountId')) { - continue; - } + array_push($data, $item); - array_unshift($data, $item); if (isset($counts[$item->accountId])) { $counts[$item->accountId]++; } else { diff --git a/app/Models/Account.php b/app/Models/Account.php index 478057883956..46ef59d71ffe 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -336,7 +336,7 @@ class Account extends Eloquent if (strstr($pattern, '{$userId}')) { $search[] = '{$userId}'; - $replace[] = str_pad($invoice->user->public_id, 2, '0', STR_PAD_LEFT); + $replace[] = str_pad(($invoice->user->public_id + 1), 2, '0', STR_PAD_LEFT); } $matches = false; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 93c720f2834a..72de3e1d2362 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -33,7 +33,7 @@ class AppServiceProvider extends ServiceProvider { $types = $type.'s'; $Type = ucfirst($type); $Types = ucfirst($types); - $class = ( Request::is($types) || Request::is('*'.$type.'*')) && !Request::is('*advanced_settings*') ? ' active' : ''; + $class = ( Request::is($types) || Request::is('*'.$type.'*')) && !Request::is('*settings*') ? ' active' : ''; $str = '