diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 22f6a1563b38..5defc097b45d 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -112,7 +112,6 @@ class CreateSingleAccount extends Command $company = Company::factory()->create([ 'account_id' => $account->id, 'slack_webhook_url' => config('ninja.notification.slack'), - 'use_credits_payment' => 'always', ]); $account->default_company_id = $company->id; diff --git a/app/DataMapper/EmailTemplateDefaults.php b/app/DataMapper/EmailTemplateDefaults.php index 8d502c64f39a..ed50c437c021 100644 --- a/app/DataMapper/EmailTemplateDefaults.php +++ b/app/DataMapper/EmailTemplateDefaults.php @@ -124,11 +124,6 @@ class EmailTemplateDefaults public static function emailInvoiceTemplate() { - $converter = new CommonMarkConverter([ - 'html_input' => 'strip', - 'allow_unsafe_links' => false, - ]); - $invoice_message = '
'.self::transformText('invoice_message').'
$view_link
'; return $invoice_message; @@ -141,12 +136,9 @@ class EmailTemplateDefaults public static function emailQuoteTemplate() { - $converter = new CommonMarkConverter([ - 'html_input' => 'strip', - 'allow_unsafe_links' => false, - ]); + $quote_message = ''.self::transformText('quote_message').'
$view_link
'; - return $converter->convertToHtml(self::transformText('quote_message')); + return $quote_message; } public static function emailPaymentSubject() @@ -167,13 +159,9 @@ class EmailTemplateDefaults public static function emailCreditTemplate() { - $converter = new CommonMarkConverter([ - 'html_input' => 'strip', - 'allow_unsafe_links' => false, - ]); - - return $converter->convertToHtml(self::transformText('credit_message')); + $credit_message = ''.self::transformText('credit_message').'
$view_link
'; + return $credit_message; } public static function emailPaymentPartialTemplate() diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 15e80d5f0fce..73ec742d1709 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -222,7 +222,6 @@ class InvoiceService public function updateStatus() { - info("invoice balance = {$this->invoice->balance}"); if((int)$this->invoice->balance == 0) $this->setStatus(Invoice::STATUS_PAID); diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 4c5dcc2a9dfa..cb3df61e8317 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -154,6 +154,7 @@ class CompanyTransformer extends EntityTransformer 'invoice_task_timelog' => (bool) $company->invoice_task_timelog, 'auto_start_tasks' => (bool) $company->auto_start_tasks, 'invoice_task_documents' => (bool) $company->invoice_task_documents, + 'use_credits_payment' => 'always', //todo remove ]; } diff --git a/app/Transformers/TaskTransformer.php b/app/Transformers/TaskTransformer.php index 37e22603b1b3..427c7a86b222 100644 --- a/app/Transformers/TaskTransformer.php +++ b/app/Transformers/TaskTransformer.php @@ -48,15 +48,15 @@ class TaskTransformer extends EntityTransformer 'assigned_user_id' => (string) $this->encodePrimaryKey($task->assigned_user_id), 'number' => (string) $task->number ?: '', 'start_time' => (int) $task->start_time, - 'description' => $task->description ?: '', - 'duration' => 0, + 'description' => (string) $task->description ?: '', + 'duration' => (int) $task->duration ?: 0, 'rate' => (float) $task->rate ?: 0, 'created_at' => (int) $task->created_at, 'updated_at' => (int) $task->updated_at, 'archived_at' => (int) $task->deleted_at, - 'invoice_id' => $this->encodePrimaryKey($task->invoice_id), - 'client_id' => $this->encodePrimaryKey($task->client_id), - 'project_id' => $this->encodePrimaryKey($task->project_id), + 'invoice_id' => $this->encodePrimaryKey($task->invoice_id) ?: '', + 'client_id' => $this->encodePrimaryKey($task->client_id) ?: '', + 'project_id' => $this->encodePrimaryKey($task->project_id) ?: '', 'is_deleted' => (bool) $task->is_deleted, 'time_log' => $task->time_log ?: '', 'is_running' => (bool) $task->is_running, @@ -64,7 +64,7 @@ class TaskTransformer extends EntityTransformer 'custom_value2' => $task->custom_value2 ?: '', 'custom_value3' => $task->custom_value3 ?: '', 'custom_value4' => $task->custom_value4 ?: '', - 'status_id' => $this->encodePrimaryKey($task->status_id), + 'status_id' => $this->encodePrimaryKey($task->status_id) ?: '', 'status_sort_order' => (int) $task->status_sort_order, ]; }