1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Multi payment invoices with filtering of already paid invoices

This commit is contained in:
David Bomba 2019-10-08 13:06:27 +10:00
parent accbbcf67b
commit 75b089fa19
2 changed files with 8 additions and 3 deletions

View File

@ -142,7 +142,7 @@ class InvoiceController extends Controller
'invoices' => $invoices,
'formatted_total' => $formatted_total,
'payment_methods' => $payment_methods,
'hashed_ids' => $ids,
'hashed_ids' => $invoices->pluck('hashed_ids'),
'total' => $total,
];

View File

@ -103,9 +103,14 @@ class PaymentController extends Controller
$amount = $invoices->sum('balance');
$invoices->filter(function ($invoice){
$invoices = $invoices->filter(function ($invoice){
return $invoice->isPayable();
})->map(function ($invoice){
});
if($invoices->count() == 0)
return back()->with(['warning' => 'No payable invoices selected']);
$invoices->map(function ($invoice){
$invoice->balance = Number::formatMoney($invoice->balance, $invoice->client);
$invoice->due_date = $this->formatDate($invoice->due_date, $invoice->client->date_format());
return $invoice;