From 1248367cb938503e639828adf56efeca5d30c039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= Date: Thu, 14 Jul 2022 01:25:22 +0300 Subject: [PATCH 1/3] user email checkbox class updated --- resources/views/modals/transactions/email.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/modals/transactions/email.blade.php b/resources/views/modals/transactions/email.blade.php index c4cf336e8..bfdfc50f6 100644 --- a/resources/views/modals/transactions/email.blade.php +++ b/resources/views/modals/transactions/email.blade.php @@ -7,7 +7,7 @@ - + From 0c687493fd269a61cac039fd0516f12407c2e3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= Date: Thu, 14 Jul 2022 01:26:11 +0300 Subject: [PATCH 2/3] transaction email modal size changed --- resources/assets/js/views/banking/transactions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/views/banking/transactions.js b/resources/assets/js/views/banking/transactions.js index 8f5735c3b..b68954255 100644 --- a/resources/assets/js/views/banking/transactions.js +++ b/resources/assets/js/views/banking/transactions.js @@ -52,7 +52,7 @@ const app = new Vue({ this.component = Vue.component('add-new-component', (resolve, reject) => { resolve({ - template: '
', + template: '
', mixins: [ Global From 6803af130d30c4f88baaf23c1a6ffe600654b010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= Date: Thu, 14 Jul 2022 01:27:36 +0300 Subject: [PATCH 3/3] hidden from customers without email --- app/Models/Banking/Transaction.php | 26 ++++++++++++++------------ app/Models/Document/Document.php | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index f0939d374..6e57559e7 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -72,7 +72,7 @@ class Transaction extends Model * * @var array */ - public $sortable = ['type', 'number', 'paid_at', 'amount','category.name', 'account.name', 'customer.name', 'invoice.document_number']; + public $sortable = ['type', 'number', 'paid_at', 'amount', 'category.name', 'account.name', 'customer.name', 'invoice.document_number']; /** * Clonable relationships. @@ -552,17 +552,19 @@ class Transaction extends Model } catch (\Exception $e) {} try { - $actions[] = [ - 'type' => 'button', - 'title' => trans('invoices.send_mail'), - 'icon' => 'email', - 'url' => route('modals.transactions.emails.create', $this->id), - 'permission' => 'read-banking-transactions', - 'attributes' => [ - 'id' => 'index-more-actions-send-email-' . $this->id, - '@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")', - ], - ]; + if (! empty($this->contact) && $this->contact->email) { + $actions[] = [ + 'type' => 'button', + 'title' => trans('invoices.send_mail'), + 'icon' => 'email', + 'url' => route('modals.transactions.emails.create', $this->id), + 'permission' => 'read-banking-transactions', + 'attributes' => [ + 'id' => 'index-more-actions-send-email-' . $this->id, + '@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")', + ], + ]; + } } catch (\Exception $e) {} $actions[] = [ diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index df5587684..d5ca3237a 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -575,7 +575,7 @@ class Document extends Model } catch (\Exception $e) {} try { - if ($this->type == 'invoice') { + if (! empty($this->contact) && $this->contact->email && $this->type == 'invoice') { $actions[] = [ 'type' => 'button', 'title' => trans('invoices.send_mail'),