1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Fixes for generates counter

This commit is contained in:
= 2022-05-03 09:33:18 +10:00
parent 342cc10bc2
commit c7a9e2bac7
2 changed files with 4 additions and 7 deletions

View File

@ -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}';

View File

@ -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;