hidden from customers without email

This commit is contained in:
Cihan Şentürk 2022-07-14 01:27:36 +03:00
parent 0c687493fd
commit 6803af130d
2 changed files with 15 additions and 13 deletions

View File

@ -72,7 +72,7 @@ class Transaction extends Model
* *
* @var array * @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. * Clonable relationships.
@ -552,17 +552,19 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
try { try {
$actions[] = [ if (! empty($this->contact) && $this->contact->email) {
'type' => 'button', $actions[] = [
'title' => trans('invoices.send_mail'), 'type' => 'button',
'icon' => 'email', 'title' => trans('invoices.send_mail'),
'url' => route('modals.transactions.emails.create', $this->id), 'icon' => 'email',
'permission' => 'read-banking-transactions', 'url' => route('modals.transactions.emails.create', $this->id),
'attributes' => [ 'permission' => 'read-banking-transactions',
'id' => 'index-more-actions-send-email-' . $this->id, 'attributes' => [
'@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")', 'id' => 'index-more-actions-send-email-' . $this->id,
], '@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")',
]; ],
];
}
} catch (\Exception $e) {} } catch (\Exception $e) {}
$actions[] = [ $actions[] = [

View File

@ -575,7 +575,7 @@ class Document extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
try { try {
if ($this->type == 'invoice') { if (! empty($this->contact) && $this->contact->email && $this->type == 'invoice') {
$actions[] = [ $actions[] = [
'type' => 'button', 'type' => 'button',
'title' => trans('invoices.send_mail'), 'title' => trans('invoices.send_mail'),