Fixes for generates counter

This commit is contained in:
= 2022-05-02 12:50:55 +10:00
parent e989644718
commit d7d3c8d591

View File

@ -642,9 +642,12 @@ trait GeneratesCounter
return $counter;
}
$search = ['{$year}'];
$replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
$search = [];
$replace = [];
// $search = ['{$year}'];
//$replace = [Carbon::now($entity->company->timezone()->name)->format('Y')];
$search[] = '{$counter}';
$replace[] = $counter;
@ -658,7 +661,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;