Fixed bulk action markPaid
This commit is contained in:
parent
d45f93f5f1
commit
1f5d764e6c
@ -47,7 +47,11 @@ class Bills extends BulkAction
|
|||||||
{
|
{
|
||||||
$bills = $this->getSelectedRecords($request);
|
$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']));
|
$this->dispatch(new CreateBankingDocumentTransaction($bill, ['type' => 'expense']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,11 @@ class Invoices extends BulkAction
|
|||||||
$invoices = $this->getSelectedRecords($request);
|
$invoices = $this->getSelectedRecords($request);
|
||||||
|
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
|
// Already in transactions
|
||||||
|
if ($invoice->status == 'paid') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
event(new PaymentReceived($invoice, ['type' => 'income']));
|
event(new PaymentReceived($invoice, ['type' => 'income']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user