diff --git a/app/Http/ValidationRules/Payment/ValidInvoicesRules.php b/app/Http/ValidationRules/Payment/ValidInvoicesRules.php index 8eb7262376..3460b85915 100644 --- a/app/Http/ValidationRules/Payment/ValidInvoicesRules.php +++ b/app/Http/ValidationRules/Payment/ValidInvoicesRules.php @@ -54,7 +54,8 @@ class ValidInvoicesRules implements Rule } $unique_array = []; - + + //todo optimize this into a single query foreach ($this->input['invoices'] as $invoice) { $unique_array[] = $invoice['invoice_id']; diff --git a/app/Repositories/PaymentRepository.php b/app/Repositories/PaymentRepository.php index 3888b845f9..366610d906 100644 --- a/app/Repositories/PaymentRepository.php +++ b/app/Repositories/PaymentRepository.php @@ -114,6 +114,7 @@ class PaymentRepository extends BaseRepository $payment->invoices()->saveMany($invoices); + //todo optimize this into a single query foreach ($data['invoices'] as $paid_invoice) { $invoice = Invoice::whereId($paid_invoice['invoice_id'])->first(); @@ -133,6 +134,7 @@ class PaymentRepository extends BaseRepository $credits = Credit::whereIn('id', $this->transformKeys(array_column($data['credits'], 'credit_id')))->get(); $payment->credits()->saveMany($credits); + //todo optimize into a single query foreach ($data['credits'] as $paid_credit) { $credit = Credit::find($this->decodePrimaryKey($paid_credit['credit_id'])); diff --git a/resources/views/email/admin/download_files.blade.php b/resources/views/email/admin/download_files.blade.php index 2c58fef1d6..b1c86d2b10 100644 --- a/resources/views/email/admin/download_files.blade.php +++ b/resources/views/email/admin/download_files.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header', ['p' => '', 'logo' => $url]) diff --git a/resources/views/email/admin/generic.blade.php b/resources/views/email/admin/generic.blade.php index dbc4c3170d..c2685697a1 100644 --- a/resources/views/email/admin/generic.blade.php +++ b/resources/views/email/admin/generic.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header', ['p' => $title, 'logo' => $logo]) diff --git a/resources/views/email/admin/generic_email.blade.php b/resources/views/email/admin/generic_email.blade.php index f9ed5418ae..47e58035e3 100644 --- a/resources/views/email/admin/generic_email.blade.php +++ b/resources/views/email/admin/generic_email.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header', ['p' => $title, 'logo' => $logo]) diff --git a/resources/views/email/invoices/paid.blade.php b/resources/views/email/invoices/paid.blade.php index 551ae48d58..5e8f36f315 100644 --- a/resources/views/email/invoices/paid.blade.php +++ b/resources/views/email/invoices/paid.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header', ['p' => 'Payment for your invoice has been completed!', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png']) diff --git a/resources/views/email/migration/completed.blade.php b/resources/views/email/migration/completed.blade.php index a34ca1c47b..fb0b335f7d 100644 --- a/resources/views/email/migration/completed.blade.php +++ b/resources/views/email/migration/completed.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header') diff --git a/resources/views/email/migration/existing.blade.php b/resources/views/email/migration/existing.blade.php index 615e8c88e5..3454441ece 100644 --- a/resources/views/email/migration/existing.blade.php +++ b/resources/views/email/migration/existing.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header') diff --git a/resources/views/email/quotes/approved.blade.php b/resources/views/email/quotes/approved.blade.php index fcded100d7..8c2680138e 100644 --- a/resources/views/email/quotes/approved.blade.php +++ b/resources/views/email/quotes/approved.blade.php @@ -1,4 +1,4 @@ -@component('email.template.master', ['design' => 'light']) +@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @slot('header') @component('email.components.header', ['p' => 'Your quote was approved!', 'logo' => 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])