1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Fixes for display unpaid invoices with overdue invoices

This commit is contained in:
David Bomba 2019-10-08 08:28:09 +10:00
parent 60e58abab5
commit 9a60e72a56
2 changed files with 17 additions and 15 deletions

View File

@ -53,9 +53,9 @@ class InvoiceFilters extends QueryFilters
$this->builder->where('status_id', Invoice::STATUS_PAID);
if(in_array('unpaid', $status_parameters))
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('due_date', '>', Carbon::now())
->orWhere('partial_due_date', '>', Carbon::now());
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
//->where('due_date', '>', Carbon::now())
//->orWhere('partial_due_date', '>', Carbon::now());
if(in_array('overdue', $status_parameters))
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])

View File

@ -133,21 +133,23 @@ class RandomDataSeeder extends Seeder
event(new InvoiceWasMarkedSent($invoice));
$payment = App\Models\Payment::create([
'user_id' => $user->id,
'company_id' => $company->id,
'client_id' => $client->id,
'amount' => $invoice->balance,
'transaction_reference' => rand(0,500),
'payment_type_id' => PaymentType::CREDIT_CARD_OTHER,
]);
if(rand(0, 1)) {
$payment = App\Models\Payment::create([
'user_id' => $user->id,
'company_id' => $company->id,
'client_id' => $client->id,
'amount' => $invoice->balance,
'transaction_reference' => rand(0,500),
'payment_type_id' => PaymentType::CREDIT_CARD_OTHER,
]);
$payment->invoices()->save($invoice);
$payment->invoices()->save($invoice);
event(new PaymentWasCreated($payment));
UpdateInvoicePayment::dispatchNow($payment);
event(new PaymentWasCreated($payment));
UpdateInvoicePayment::dispatchNow($payment);
}
});
/** Recurring Invoice Factory */