diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index fc3630d6646a..4219b6863c0d 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -463,7 +463,10 @@ class CompanySettings extends BaseSettings public $accept_client_input_quote_approval = false; + public $allow_billable_task_items = false; + public static $casts = [ + 'allow_billable_task_items' => 'bool', 'accept_client_input_quote_approval' => 'bool', 'custom_sending_email' => 'string', 'show_paid_stamp' => 'bool', diff --git a/app/Models/Scheduler.php b/app/Models/Scheduler.php index 569958ff6166..cc0f61a7c2f0 100644 --- a/app/Models/Scheduler.php +++ b/app/Models/Scheduler.php @@ -42,6 +42,7 @@ class Scheduler extends BaseModel 'template', 'is_paused', 'parameters', + 'remaining_cycles', ]; protected $casts = [ @@ -71,44 +72,21 @@ class Scheduler extends BaseModel { return $this->belongsTo(Company::class); } - - // public function nextScheduledDate(): ?Carbon - // { - // $offset = 0; - - // $entity_send_time = $this->company->settings->entity_send_time; - - // if ($entity_send_time != 0) { - // $timezone = $this->company->timezone(); - - // $offset -= $timezone->utc_offset; - // $offset += ($entity_send_time * 3600); - // } - - // /* - // As we are firing at UTC+0 if our offset is negative it is technically firing the day before so we always need - // to add ON a day - a day = 86400 seconds - // */ - - // if ($offset < 0) { - // $offset += 86400; - // } - - // switch ($this->repeat_every) { - // case self::DAILY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addDay()->addSeconds($offset); - // case self::WEEKLY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addWeek()->addSeconds($offset); - // case self::BIWEEKLY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addWeeks(2)->addSeconds($offset); - // case self::MONTHLY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addMonthNoOverflow()->addSeconds($offset); - // case self::QUARTERLY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addMonthsNoOverflow(3)->addSeconds($offset); - // case self::ANNUALLY: - // return Carbon::parse($this->scheduled_run)->startOfDay()->addYearNoOverflow()->addSeconds($offset); - // default: - // return null; - // } - // } + + /** + * remainingCycles + * + * @return int + */ + public function remainingCycles() : int + { + if ($this->remaining_cycles == 0) { + return 0; + } elseif ($this->remaining_cycles == -1) { + return -1; + } else { + return $this->remaining_cycles - 1; + } + } + } diff --git a/app/Providers/MailCssInlinerServiceProvider.php b/app/Providers/MailCssInlinerServiceProvider.php index c1c5984c1c93..e47be7180aee 100644 --- a/app/Providers/MailCssInlinerServiceProvider.php +++ b/app/Providers/MailCssInlinerServiceProvider.php @@ -45,8 +45,8 @@ class MailCssInlinerServiceProvider extends ServiceProvider // return new CssInlinerPlugin([]); // }); - $this->app->bind(CssInlinerPlugin::class, function ($app) { - return new CssInlinerPlugin([]); - }); + // $this->app->bind(CssInlinerPlugin::class, function ($app) { + // return new CssInlinerPlugin([]); + // }); } } diff --git a/database/migrations/2023_02_14_064135_create_react_settings_column_company_user_table.php b/database/migrations/2023_02_14_064135_create_react_settings_column_company_user_table.php index a763630ffbf8..aa6eb0e6db18 100644 --- a/database/migrations/2023_02_14_064135_create_react_settings_column_company_user_table.php +++ b/database/migrations/2023_02_14_064135_create_react_settings_column_company_user_table.php @@ -1,7 +1,6 @@ mediumText('react_settings')->nullable(); + }); - \Illuminate\Support\Facades\Artisan::call('ninja:design-update'); + \Illuminate\Support\Facades\Artisan::call('ninja:design-update'); + + Schema::table('schedulers', function (Illuminate\Database\Schema\Blueprint $table) { + $table->integer('remaining_cycles')->nullable(); }); } diff --git a/resources/views/email/admin/download_credits.blade.php b/resources/views/email/admin/download_credits.blade.php index c9c9e4abb608..a715ab6df337 100644 --- a/resources/views/email/admin/download_credits.blade.php +++ b/resources/views/email/admin/download_credits.blade.php @@ -3,19 +3,26 @@

{{ ctrans('texts.credits_backup_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - - - -
- - {{ ctrans('texts.download') }} - + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_documents.blade.php b/resources/views/email/admin/download_documents.blade.php index 3c8da4cb4434..f3fc42cc9dd0 100644 --- a/resources/views/email/admin/download_documents.blade.php +++ b/resources/views/email/admin/download_documents.blade.php @@ -3,19 +3,25 @@

{{ ctrans('texts.document_download_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - - - - -
- - {{ ctrans('texts.download') }} - + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_files.blade.php b/resources/views/email/admin/download_files.blade.php index 035c303e0608..08e0e6359b68 100644 --- a/resources/views/email/admin/download_files.blade.php +++ b/resources/views/email/admin/download_files.blade.php @@ -3,15 +3,26 @@

{{ ctrans('texts.download_backup_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - -
- - {{ ctrans('texts.download') }} - + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_invoices.blade.php b/resources/views/email/admin/download_invoices.blade.php index 600f04a4346a..dbae16a9f4bc 100644 --- a/resources/views/email/admin/download_invoices.blade.php +++ b/resources/views/email/admin/download_invoices.blade.php @@ -3,19 +3,25 @@

{{ ctrans('texts.invoices_backup_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - - - - -
- - {{ ctrans('texts.download') }} - + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_purchase_orders.blade.php b/resources/views/email/admin/download_purchase_orders.blade.php index e8d1d089efef..114ddf666d83 100644 --- a/resources/views/email/admin/download_purchase_orders.blade.php +++ b/resources/views/email/admin/download_purchase_orders.blade.php @@ -3,19 +3,25 @@

{{ ctrans('texts.purchase_orders_backup_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - - - - -
- - {{ ctrans('texts.download') }} - + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_quotes.blade.php b/resources/views/email/admin/download_quotes.blade.php index c54446e42487..3517e4ddbade 100644 --- a/resources/views/email/admin/download_quotes.blade.php +++ b/resources/views/email/admin/download_quotes.blade.php @@ -2,20 +2,27 @@

{{ ctrans('texts.quotes_backup_subject') }}

{{ ctrans('texts.download_timeframe') }}

- - - - - +
- - {{ ctrans('texts.download') }} + + + + + + +
+ + {{ ctrans('texts.download') }} +
+ @endcomponent diff --git a/resources/views/email/admin/download_report.blade.php b/resources/views/email/admin/download_report.blade.php index 132d2ff6507a..93e7e88d52a4 100644 --- a/resources/views/email/admin/download_report.blade.php +++ b/resources/views/email/admin/download_report.blade.php @@ -1,6 +1,6 @@ @component('email.template.admin', ['logo' => $logo, 'settings' => $settings])
-

{{ ctrans('texts.download_files') }}

+

{{ ctrans('texts.reports') }}

{{ ctrans('texts.download_report_description') }}

@endcomponent diff --git a/resources/views/email/admin/generic_email.blade.php b/resources/views/email/admin/generic_email.blade.php index be32dcf1aa21..7b0d776f8777 100644 --- a/resources/views/email/admin/generic_email.blade.php +++ b/resources/views/email/admin/generic_email.blade.php @@ -6,13 +6,26 @@ @isset($view_link) - - - + +
- {{ $view_text }} -
+ + -
+ + {{ $view_text }} + +
+
+ @endisset diff --git a/tests/Feature/TaskApiTest.php b/tests/Feature/TaskApiTest.php index 24a5de247f58..ae396b069577 100644 --- a/tests/Feature/TaskApiTest.php +++ b/tests/Feature/TaskApiTest.php @@ -220,6 +220,16 @@ class TaskApiTest extends TestCase } + public function testTimeLogChecker12() + { + $log = [ + [1,2,'a',true], + [3,4,'d',false], + ]; + + $this->assertTrue($this->checkTimeLog($log)); + } + public function testTaskListClientStatus() { $response = $this->withHeaders([