close #2616 Enhancement: Add payment from invoice/bill index ( #3g3rnd2 )

This commit is contained in:
Cüneyt Şentürk
2022-09-05 18:19:11 +03:00
parent cf565f55e0
commit 8c61a4ee73
3 changed files with 22 additions and 8 deletions

View File

@ -595,6 +595,26 @@ class Document extends Model
'type' => 'divider',
];
if ((empty($this->transactions->count()) || (! empty($this->transactions->count()) && $this->paid != $this->amount))) {
try {
$actions[] = [
'type' => 'button',
'title' => trans('invoices.add_payment'),
'icon' => 'payments',
'url' => route('modals.documents.document.transactions.create', $this->id),
'permission' => 'read-' . $group . '-' . $permission_prefix,
'attributes' => [
'id' => 'index-more-actions-payment-' . $this->id,
'@click' => 'onPayment("' . $this->id . '")',
],
];
} catch (\Exception $e) {}
$actions[] = [
'type' => 'divider',
];
}
if ($this->status != 'cancelled') {
try {
$actions[] = [