Filter buy now clients and invoices
This commit is contained in:
parent
5560d65c4a
commit
4c5b4d5164
2 changed files with 2 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ class ClientRepository extends BaseRepository
|
|||
->where('clients.account_id', '=', \Auth::user()->account_id)
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->where('contacts.deleted_at', '=', null)
|
||||
->whereRaw('(clients.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
||||
->select(
|
||||
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
|
||||
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class InvoiceRepository extends BaseRepository
|
|||
->where('contacts.deleted_at', '=', null)
|
||||
->where('invoices.is_recurring', '=', false)
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->whereRaw('(clients.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
||||
->select(
|
||||
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
|
||||
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue