diff --git a/app/Utils/Traits/GeneratesConvertedQuoteCounter.php b/app/Utils/Traits/GeneratesConvertedQuoteCounter.php index f4f42a88e978..7c33334cac7c 100644 --- a/app/Utils/Traits/GeneratesConvertedQuoteCounter.php +++ b/app/Utils/Traits/GeneratesConvertedQuoteCounter.php @@ -631,7 +631,7 @@ trait GeneratesConvertedQuoteCounter } $search = ['{$year}']; - $replace = [date('Y')]; + $replace = [Carbon::now($entity->company->timezone()->name)->format('Y')]; $search[] = '{$counter}'; $replace[] = $counter; @@ -646,8 +646,8 @@ trait GeneratesConvertedQuoteCounter $replace[] = $counter; $search[] = '{$year}'; - $replace[] = date('Y'); - + $replace[] = Carbon::now($entity->company->timezone()->name)->format('Y'); + if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) { $user_id = $entity->user_id ? $entity->user_id : 0; $search[] = '{$user_id}'; diff --git a/app/Utils/Traits/GeneratesCounter.php b/app/Utils/Traits/GeneratesCounter.php index d8bce41b7d83..b9606621246a 100644 --- a/app/Utils/Traits/GeneratesCounter.php +++ b/app/Utils/Traits/GeneratesCounter.php @@ -645,9 +645,6 @@ trait GeneratesCounter $search = []; $replace = []; - // $search = ['{$year}']; - //$replace = [Carbon::now($entity->company->timezone()->name)->format('Y')]; - $search[] = '{$counter}'; $replace[] = $counter; @@ -661,7 +658,7 @@ trait GeneratesCounter $replace[] = $counter; $search[] = '{$year}'; - $replace[] = [Carbon::now($entity->company->timezone()->name)->format('Y')]; + $replace[] = Carbon::now($entity->company->timezone()->name)->format('Y'); if (strstr($pattern, '{$user_id}') || strstr($pattern, '{$userId}')) { $user_id = $entity->user_id ? $entity->user_id : 0;