diff --git a/app/Mail/Admin/EntityFailedSendObject.php b/app/Mail/Admin/EntityFailedSendObject.php index 1120115dd855..d1a9ea3cac8b 100644 --- a/app/Mail/Admin/EntityFailedSendObject.php +++ b/app/Mail/Admin/EntityFailedSendObject.php @@ -77,7 +77,6 @@ class EntityFailedSendObject private function setTemplate() { - // nlog($this->template); switch ($this->template) { case 'invoice': diff --git a/app/Mail/Admin/EntitySentObject.php b/app/Mail/Admin/EntitySentObject.php index 469830f8b532..da2c1030fbc1 100644 --- a/app/Mail/Admin/EntitySentObject.php +++ b/app/Mail/Admin/EntitySentObject.php @@ -104,7 +104,6 @@ class EntitySentObject private function setTemplate() { - // nlog($this->template); switch ($this->template) { case 'invoice': diff --git a/app/Repositories/CompanyRepository.php b/app/Repositories/CompanyRepository.php index 542b30ead9c0..3d29e6da907b 100644 --- a/app/Repositories/CompanyRepository.php +++ b/app/Repositories/CompanyRepository.php @@ -40,9 +40,7 @@ class CompanyRepository extends BaseRepository $company->fill($data); /** Only required to handle v4 migration workloads */ - // if(Ninja::isHosted() && $company->isDirty('is_disabled') && !$company->is_disabled) { - if($company->isDirty('is_disabled') && !$company->is_disabled) { - nlog("trigger"); + if(Ninja::isHosted() && $company->isDirty('is_disabled') && !$company->is_disabled) { Ninja::triggerForwarding($company->company_key, $company->owner()->email); } diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index ab9d447b82bc..c55fadf26c47 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -319,73 +319,6 @@ class Design extends BaseDesign return $elements; } - //@deprecated - // public function entityDetailsx(): array - // { - // if ($this->type === 'statement') { - // $s_date = $this->translateDate($this->options['start_date'], $this->client->date_format(), $this->client->locale()) . " - " . $this->translateDate($this->options['end_date'], $this->client->date_format(), $this->client->locale()); - - // return [ - // ['element' => 'p', 'content' => "

".ctrans('texts.statement')."

", 'properties' => ['data-ref' => 'statement-label']], - // ['element' => 'p', 'content' => ctrans('texts.statement_date'), 'properties' => ['data-ref' => 'statement-label'],'elements' => - // ['element' => 'span', 'content' => "{$s_date} "] - // ], - // ['element' => 'p', 'content' => '$balance_due_label', 'properties' => ['data-ref' => 'statement-label'],'elements' => - // ['element' => 'span', 'content' => Number::formatMoney($this->invoices->sum('balance'), $this->client)] - // ], - // ]; - // } - - // $variables = $this->context['pdf_variables']['invoice_details']; - - // if ($this->entity instanceof Quote) { - // $variables = $this->context['pdf_variables']['quote_details']; - - // if ($this->entity->partial > 0) { - // $variables[] = '$quote.balance_due'; - // } - // } - - // if ($this->entity instanceof Credit) { - // $variables = $this->context['pdf_variables']['credit_details']; - // } - - // if ($this->vendor) { - // $variables = $this->context['pdf_variables']['purchase_order_details']; - // } - - // $elements = []; - - // // We don't want to show account balance or invoice total on PDF.. or any amount with currency. - // if ($this->type == self::DELIVERY_NOTE) { - // $variables = array_filter($variables, function ($m) { - // return !in_array($m, ['$invoice.balance_due', '$invoice.total']); - // }); - // } - - // foreach ($variables as $variable) { - // $_variable = explode('.', $variable)[1]; - // $_customs = ['custom1', 'custom2', 'custom3', 'custom4']; - - // /* 2/7/2022 don't show custom values if they are empty */ - // $var = str_replace("custom", "custom_value", $_variable); - - // if (in_array($_variable, $_customs) && !empty($this->entity->{$var})) { - // $elements[] = ['element' => 'div', 'properties' => ['style' => "display: table-row; visibility: {$this->entityVariableCheck($_variable)};"],'elements' => [ - // ['element' => 'div', 'content' => $variable . '_label', 'properties' => ['class' => 'entity-details-cell', 'data-ref' => 'entity_details-' . substr($variable, 1) . '_label']], - // ['element' => 'div', 'content' => $variable, 'properties' => ['class' => 'entity-details-cell', 'data-ref' => 'entity_details-' . substr($variable, 1)]], - // ]]; - // } else { - // $elements[] = ['element' => 'div', 'properties' => ['style' => "display: table-row; visibility: {$this->entityVariableCheck($variable)};"], 'elements' => [ - // ['element' => 'div', 'content' => $variable . '_label', 'properties' => ['class' => 'entity-details-cell','data-ref' => 'entity_details-' . substr($variable, 1) . '_label']], - // ['element' => 'div', 'content' => $variable, 'properties' => ['class' => 'entity-details-cell','data-ref' => 'entity_details-' . substr($variable, 1)]], - // ]]; - // } - // } - - // return $elements; - // } - public function entityDetails(): array { if ($this->type === 'statement') { @@ -911,7 +844,6 @@ class Design extends BaseDesign $variables = $this->context['pdf_variables']['total_columns']; - $elements = [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ ['element' => 'p', 'content' => strtr(str_replace(["labels","values"], ["",""], $_variables['values']['$entity.public_notes']), $_variables), 'properties' => ['data-ref' => 'total_table-public_notes', 'style' => 'text-align: left;']], diff --git a/app/Services/PdfMaker/PdfMaker.php b/app/Services/PdfMaker/PdfMaker.php index 26c375c5671e..21d4098c6c80 100644 --- a/app/Services/PdfMaker/PdfMaker.php +++ b/app/Services/PdfMaker/PdfMaker.php @@ -84,8 +84,8 @@ class PdfMaker /** * Final method to get compiled HTML. * - * @param bool $final @deprecated // is it? i still see it being called elsewhere - * @return mixed + * @param bool + * @return string */ public function getCompiledHTML($final = false) { diff --git a/app/Services/Quote/SendEmail.php b/app/Services/Quote/SendEmail.php index 2530fe598bbf..445d321ff97c 100644 --- a/app/Services/Quote/SendEmail.php +++ b/app/Services/Quote/SendEmail.php @@ -37,8 +37,6 @@ class SendEmail */ public function run() { - nlog($this->reminder_template); - nlog("is there a template"); if (! $this->reminder_template) { $this->reminder_template = $this->quote->calculateTemplate('quote'); diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index 98584eed484a..e5defbd3ee37 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -67,9 +67,12 @@ trait Inviteable $writer = new Writer($renderer); $qr = $writer->writeString($this->getPaymentLink(), 'utf-8'); + + return $qr; + // return "

{$qr}

"; - return " - {$qr}"; + // return "

+ // {$qr}

"; } public function getUnsubscribeLink() diff --git a/tests/Feature/Account/AccountEmailQuotaTest.php b/tests/Feature/Account/AccountEmailQuotaTest.php index fa70035d97bd..6d242e52a38e 100644 --- a/tests/Feature/Account/AccountEmailQuotaTest.php +++ b/tests/Feature/Account/AccountEmailQuotaTest.php @@ -126,7 +126,7 @@ class AccountEmailQuotaTest extends TestCase $account->save(); - Cache::put($account->key, 3000); + Cache::put("email_quota".$account->key, 3000); $count = $account->emailsSent();