mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Exclude deleted client/vendor
This commit is contained in:
parent
c27d5ad8e9
commit
45f2970579
@ -58,7 +58,10 @@ class ContactExport extends BaseExport
|
||||
}
|
||||
|
||||
$query = ClientContact::query()
|
||||
->where('company_id', $this->company->id);
|
||||
->where('company_id', $this->company->id)
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
});
|
||||
|
||||
$query = $this->addDateRange($query);
|
||||
|
||||
|
@ -102,6 +102,9 @@ class CreditExport extends BaseExport
|
||||
$query = Credit::query()
|
||||
->withTrashed()
|
||||
->with('client')
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -70,6 +70,9 @@ class InvoiceItemExport extends BaseExport
|
||||
$query = Invoice::query()
|
||||
->withTrashed()
|
||||
->with('client')
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -56,6 +56,9 @@ class PaymentExport extends BaseExport
|
||||
|
||||
$query = Payment::query()
|
||||
->withTrashed()
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', 0);
|
||||
|
||||
|
@ -120,6 +120,9 @@ class ProductSalesExport extends BaseExport
|
||||
//insert the header
|
||||
$query = Invoice::query()
|
||||
->withTrashed()
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', 0)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL, Invoice::STATUS_PAID]);
|
||||
|
@ -58,6 +58,9 @@ class PurchaseOrderExport extends BaseExport
|
||||
$query = PurchaseOrder::query()
|
||||
->withTrashed()
|
||||
->with('vendor')
|
||||
->whereHas('vendor', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -62,6 +62,9 @@ class PurchaseOrderItemExport extends BaseExport
|
||||
|
||||
$query = PurchaseOrder::query()
|
||||
->withTrashed()
|
||||
->whereHas('vendor', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->with('vendor')->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -64,6 +64,9 @@ class QuoteExport extends BaseExport
|
||||
$query = Quote::query()
|
||||
->withTrashed()
|
||||
->with('client')
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -65,6 +65,9 @@ class QuoteItemExport extends BaseExport
|
||||
|
||||
$query = Quote::query()
|
||||
->withTrashed()
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->with('client')->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
@ -56,6 +56,9 @@ class RecurringInvoiceExport extends BaseExport
|
||||
$query = RecurringInvoice::query()
|
||||
->withTrashed()
|
||||
->with('client')
|
||||
->whereHas('client', function ($q){
|
||||
$q->where('is_deleted', false);
|
||||
})
|
||||
->where('company_id', $this->company->id)
|
||||
->where('is_deleted', $this->input['include_deleted'] ?? false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user