1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixed problem sorting data tables by client

This commit is contained in:
Hillel Coren 2016-04-27 11:49:54 +03:00
parent bc2880f05e
commit 6ba27c2475
5 changed files with 8 additions and 8 deletions

View File

@ -27,7 +27,7 @@ class CreditRepository extends BaseRepository
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'), DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'), DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
'credits.public_id', 'credits.public_id',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.user_id as client_user_id', 'clients.user_id as client_user_id',
'credits.amount', 'credits.amount',

View File

@ -96,7 +96,7 @@ class ExpenseRepository extends BaseRepository
'vendors.name as vendor_name', 'vendors.name as vendor_name',
'vendors.public_id as vendor_public_id', 'vendors.public_id as vendor_public_id',
'vendors.user_id as vendor_user_id', 'vendors.user_id as vendor_user_id',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.user_id as client_user_id', 'clients.user_id as client_user_id',
'contacts.first_name', 'contacts.first_name',

View File

@ -58,7 +58,7 @@ class InvoiceRepository extends BaseRepository
'clients.user_id as client_user_id', 'clients.user_id as client_user_id',
'invoice_number', 'invoice_number',
'invoice_status_id', 'invoice_status_id',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'invoices.public_id', 'invoices.public_id',
'invoices.amount', 'invoices.amount',
'invoices.balance', 'invoices.balance',
@ -115,7 +115,7 @@ class InvoiceRepository extends BaseRepository
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'), DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'), DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'invoices.public_id', 'invoices.public_id',
'invoices.amount', 'invoices.amount',
'frequencies.name as frequency', 'frequencies.name as frequency',
@ -169,7 +169,7 @@ class InvoiceRepository extends BaseRepository
'invoices.balance as balance', 'invoices.balance as balance',
'invoices.due_date', 'invoices.due_date',
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'invoices.public_id', 'invoices.public_id',
'invoices.amount', 'invoices.amount',
'invoices.start_date', 'invoices.start_date',

View File

@ -34,7 +34,7 @@ class PaymentRepository extends BaseRepository
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'), DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'), DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
'payments.transaction_reference', 'payments.transaction_reference',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.user_id as client_user_id', 'clients.user_id as client_user_id',
'payments.amount', 'payments.amount',
@ -101,7 +101,7 @@ class PaymentRepository extends BaseRepository
'invitations.invitation_key', 'invitations.invitation_key',
'payments.public_id', 'payments.public_id',
'payments.transaction_reference', 'payments.transaction_reference',
'clients.name as client_name', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'payments.amount', 'payments.amount',
'payments.payment_date', 'payments.payment_date',

View File

@ -25,7 +25,7 @@ class TaskRepository
->where('clients.deleted_at', '=', null) ->where('clients.deleted_at', '=', null)
->select( ->select(
'tasks.public_id', 'tasks.public_id',
'clients.name as client_name', \DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"),
'clients.public_id as client_public_id', 'clients.public_id as client_public_id',
'clients.user_id as client_user_id', 'clients.user_id as client_user_id',
'contacts.first_name', 'contacts.first_name',