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
*/
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[] = [

View File

@ -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'),