diff --git a/app/Helpers/Invoice/InvoiceSum.php b/app/Helpers/Invoice/InvoiceSum.php index a66a04d912f1..da45f65a7ca8 100644 --- a/app/Helpers/Invoice/InvoiceSum.php +++ b/app/Helpers/Invoice/InvoiceSum.php @@ -53,6 +53,9 @@ class InvoiceSum { $this->invoice = $invoice; + // if(!$this->invoice->relationLoaded('client')) + // $this->invoice->load('client'); + $this->tax_map = new Collection; } diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 72378bb0ec34..20e7ed40c865 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -629,7 +629,7 @@ class InvoiceController extends BaseController } private function performAction(Invoice $invoice, $action, $bulk = false) - { + { /*If we are using bulk actions, we don't want to return anything */ switch ($action) { case 'clone_to_invoice': diff --git a/app/Mail/Admin/EntityCreatedObject.php b/app/Mail/Admin/EntityCreatedObject.php index c4cfc886c5d0..33bb612a7d9a 100644 --- a/app/Mail/Admin/EntityCreatedObject.php +++ b/app/Mail/Admin/EntityCreatedObject.php @@ -49,6 +49,7 @@ class EntityCreatedObject /* Set customized translations _NOW_ */ $t->replace(Ninja::transformTranslations($this->entity->company->settings)); + $this->entity->load('client.country', 'client.company'); $this->client = $this->entity->client; $this->company = $this->entity->company; diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 039ff44242ff..69557674a4f7 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -87,7 +87,7 @@ class TemplateEmail extends Mailable $this->from(config('mail.from.address'), $email_from_name); if (strlen($settings->bcc_email) > 1) - $this->bcc(explode(",",$settings->bcc_email)); + $this->bcc(explode(",",str_replace(" ", "", $settings->bcc_email)));//remove whitespace if any has been inserted. $this->subject($this->build_email->getSubject()) ->text('email.template.plain', [ diff --git a/app/Repositories/ActivityRepository.php b/app/Repositories/ActivityRepository.php index c2ed5748bbea..c2d0e946a0c9 100644 --- a/app/Repositories/ActivityRepository.php +++ b/app/Repositories/ActivityRepository.php @@ -81,7 +81,8 @@ class ActivityRepository extends BaseRepository || get_class($entity) == Credit::class || get_class($entity) == RecurringInvoice::class ) { - $entity->load('company', 'client'); + + $entity->load('client'); $contact = $entity->client->primary_contact()->first(); $backup->html_backup = $this->generateHtml($entity); $backup->amount = $entity->amount; @@ -95,7 +96,7 @@ class ActivityRepository extends BaseRepository public function getTokenId(array $event_vars) { if ($event_vars['token']) { - $company_token = CompanyToken::whereRaw('BINARY `token`= ?', [$event_vars['token']])->first(); + $company_token = CompanyToken::where('token', $event_vars['token'])->first(); if ($company_token) { return $company_token->id; @@ -117,7 +118,7 @@ class ActivityRepository extends BaseRepository $entity_design_id = 'credit_design_id'; } - $entity->load('client','client.company'); + // $entity->load('client.company'); $entity_design_id = $entity->design_id ? $entity->design_id : $this->decodePrimaryKey($entity->client->getSetting($entity_design_id)); @@ -128,6 +129,8 @@ class ActivityRepository extends BaseRepository return; } + $entity->load('client.company', 'invitations'); + $html = new HtmlEngine($entity->invitations->first()); if ($design->is_custom) { diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 2169a63df6a3..d439b0c9b149 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -64,7 +64,6 @@ class TriggeredActions extends AbstractService { $reminder_template = $this->invoice->calculateTemplate('invoice'); - //$reminder_template = 'payment'; $this->invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($reminder_template) { EmailEntity::dispatch($invitation, $this->invoice->company, $reminder_template); diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index de8cd6698856..d5bd8020bfeb 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -49,7 +49,6 @@ class HtmlEngine public function __construct($invitation) { $this->invitation = $invitation; - // $invitation->load('contact.client.company', 'company'); $this->entity_string = $this->resolveEntityString(); @@ -58,9 +57,9 @@ class HtmlEngine $this->company = $invitation->company; $this->contact = $invitation->contact; - - $this->client = $invitation->contact->client; - $this->client->load('country','company'); + + $this->client = $this->contact->client->load('company','country'); + $this->entity->load('client'); $this->settings = $this->client->getMergedSettings(); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index bc6dbd2e85c8..95d83a86f805 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2479,6 +2479,8 @@ $LANG = array( 'currency_cambodian_riel' => 'Cambodian Riel', 'currency_vanuatu_vatu' => 'Vanuatu Vatu', + 'currency_cuban_peso' => 'Cuban Peso', + 'review_app_help' => 'We hope you\'re enjoying using the app.
If you\'d consider :link we\'d greatly appreciate it!', 'writing_a_review' => 'writing a review',