Fixed bulk action markPaid

This commit is contained in:
Cüneyt Şentürk 2021-01-19 14:59:03 +03:00
parent d45f93f5f1
commit 1f5d764e6c
2 changed files with 10 additions and 1 deletions

View File

@ -47,7 +47,11 @@ class Bills extends BulkAction
{
$bills = $this->getSelectedRecords($request);
foreach ($bills as $bill) {
foreach ($bills as $bill) {// Already in transactions
if ($bill->status == 'paid') {
continue;
}
$this->dispatch(new CreateBankingDocumentTransaction($bill, ['type' => 'expense']));
}
}

View File

@ -48,6 +48,11 @@ class Invoices extends BulkAction
$invoices = $this->getSelectedRecords($request);
foreach ($invoices as $invoice) {
// Already in transactions
if ($invoice->status == 'paid') {
continue;
}
event(new PaymentReceived($invoice, ['type' => 'income']));
}
}