mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for statements
This commit is contained in:
parent
9b9c67c60e
commit
2b20d079ba
@ -219,7 +219,9 @@ class Statement
|
|||||||
*/
|
*/
|
||||||
protected function getInvoices(): Collection
|
protected function getInvoices(): Collection
|
||||||
{
|
{
|
||||||
return Invoice::where('company_id', $this->client->company_id)
|
return Invoice::withTrashed()
|
||||||
|
->where('is_deleted', false)
|
||||||
|
->where('company_id', $this->client->company_id)
|
||||||
->where('client_id', $this->client->id)
|
->where('client_id', $this->client->id)
|
||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID])
|
||||||
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
->whereBetween('date', [$this->options['start_date'], $this->options['end_date']])
|
||||||
@ -234,7 +236,9 @@ class Statement
|
|||||||
*/
|
*/
|
||||||
protected function getPayments(): Collection
|
protected function getPayments(): Collection
|
||||||
{
|
{
|
||||||
return Payment::with('client.country','invoices')
|
return Payment::withTrashed()
|
||||||
|
->with('client.country','invoices')
|
||||||
|
->where('is_deleted', false)
|
||||||
->where('company_id', $this->client->company_id)
|
->where('company_id', $this->client->company_id)
|
||||||
->where('client_id', $this->client->id)
|
->where('client_id', $this->client->id)
|
||||||
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
||||||
@ -286,7 +290,8 @@ class Statement
|
|||||||
$from = $ranges[0];
|
$from = $ranges[0];
|
||||||
$to = $ranges[1];
|
$to = $ranges[1];
|
||||||
|
|
||||||
$amount = Invoice::where('client_id', $this->client->id)
|
$amount = Invoice::withTrashed()
|
||||||
|
->where('client_id', $this->client->id)
|
||||||
->where('company_id', $this->client->company_id)
|
->where('company_id', $this->client->company_id)
|
||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user