Adjustments for reports

This commit is contained in:
David Bomba 2024-02-21 14:01:52 +11:00
parent 1f1716a3cd
commit efa6743edf
3 changed files with 5 additions and 2 deletions

View File

@ -90,6 +90,9 @@ class ARDetailReport extends BaseExport
$query = Invoice::query()
->withTrashed()
->whereHas('client', function ($query){
$query->where('is_deleted', 0);
})
->where('company_id', $this->company->id)
->where('is_deleted', 0)
->where('balance', '>', 0)

View File

@ -125,9 +125,9 @@ class ARSummaryReport extends BaseExport
$amount = Invoice::withTrashed()
->where('client_id', $this->client->id)
->where('company_id', $this->client->company_id)
->where('is_deleted', 0)
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('balance', '>', 0)
->where('is_deleted', 0)
->where(function ($query) {
$query->where('due_date', '>', now()->startOfDay())
->orWhereNull('due_date');

View File

@ -75,8 +75,8 @@ class TaxSummaryReport extends BaseExport
$query = Invoice::query()
->withTrashed()
->whereIn('status_id', [2,3,4])
->where('company_id', $this->company->id)
->whereIn('status_id', [2,3,4])
->where('is_deleted', 0)
->orderBy('balance', 'desc');