mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 04:14:34 -04:00
Fixes for display unpaid invoices with overdue invoices
This commit is contained in:
parent
60e58abab5
commit
9a60e72a56
@ -53,9 +53,9 @@ class InvoiceFilters extends QueryFilters
|
|||||||
$this->builder->where('status_id', Invoice::STATUS_PAID);
|
$this->builder->where('status_id', Invoice::STATUS_PAID);
|
||||||
|
|
||||||
if(in_array('unpaid', $status_parameters))
|
if(in_array('unpaid', $status_parameters))
|
||||||
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
|
||||||
->where('due_date', '>', Carbon::now())
|
//->where('due_date', '>', Carbon::now())
|
||||||
->orWhere('partial_due_date', '>', Carbon::now());
|
//->orWhere('partial_due_date', '>', Carbon::now());
|
||||||
|
|
||||||
if(in_array('overdue', $status_parameters))
|
if(in_array('overdue', $status_parameters))
|
||||||
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
|
@ -133,21 +133,23 @@ class RandomDataSeeder extends Seeder
|
|||||||
|
|
||||||
event(new InvoiceWasMarkedSent($invoice));
|
event(new InvoiceWasMarkedSent($invoice));
|
||||||
|
|
||||||
$payment = App\Models\Payment::create([
|
if(rand(0, 1)) {
|
||||||
'user_id' => $user->id,
|
$payment = App\Models\Payment::create([
|
||||||
'company_id' => $company->id,
|
'user_id' => $user->id,
|
||||||
'client_id' => $client->id,
|
'company_id' => $company->id,
|
||||||
'amount' => $invoice->balance,
|
'client_id' => $client->id,
|
||||||
'transaction_reference' => rand(0,500),
|
'amount' => $invoice->balance,
|
||||||
'payment_type_id' => PaymentType::CREDIT_CARD_OTHER,
|
'transaction_reference' => rand(0,500),
|
||||||
]);
|
'payment_type_id' => PaymentType::CREDIT_CARD_OTHER,
|
||||||
|
]);
|
||||||
|
|
||||||
$payment->invoices()->save($invoice);
|
$payment->invoices()->save($invoice);
|
||||||
|
|
||||||
event(new PaymentWasCreated($payment));
|
event(new PaymentWasCreated($payment));
|
||||||
|
|
||||||
UpdateInvoicePayment::dispatchNow($payment);
|
|
||||||
|
|
||||||
|
UpdateInvoicePayment::dispatchNow($payment);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Recurring Invoice Factory */
|
/** Recurring Invoice Factory */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user