mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 06:44:37 -04:00
Clean up for Filters
This commit is contained in:
parent
c4058c502e
commit
afad1245c9
@ -193,9 +193,7 @@ class ClientFilters extends QueryFilters
|
|||||||
->where('clients.company_id', '=', $company_id)
|
->where('clients.company_id', '=', $company_id)
|
||||||
->where('client_contacts.is_primary', '=', true)
|
->where('client_contacts.is_primary', '=', true)
|
||||||
->where('client_contacts.deleted_at', '=', null)
|
->where('client_contacts.deleted_at', '=', null)
|
||||||
//->whereRaw('(clients.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
// DB::raw('COALESCE(clients.currency_id, companies.currency_id) currency_id'),
|
|
||||||
DB::raw('COALESCE(clients.country_id, companies.country_id) country_id'),
|
DB::raw('COALESCE(clients.country_id, companies.country_id) country_id'),
|
||||||
DB::raw("CONCAT(COALESCE(client_contacts.first_name, ''), ' ', COALESCE(client_contacts.last_name, '')) contact"),
|
DB::raw("CONCAT(COALESCE(client_contacts.first_name, ''), ' ', COALESCE(client_contacts.last_name, '')) contact"),
|
||||||
'clients.id',
|
'clients.id',
|
||||||
|
@ -105,7 +105,6 @@ class DesignFilters extends QueryFilters
|
|||||||
$query = DB::table('designs')
|
$query = DB::table('designs')
|
||||||
->join('companies', 'companies.id', '=', 'designs.company_id')
|
->join('companies', 'companies.id', '=', 'designs.company_id')
|
||||||
->where('designs.company_id', '=', $company_id)
|
->where('designs.company_id', '=', $company_id)
|
||||||
//->whereRaw('(designs.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
'designs.id',
|
'designs.id',
|
||||||
'designs.name',
|
'designs.name',
|
||||||
|
@ -205,9 +205,7 @@ class ExpenseFilters extends QueryFilters
|
|||||||
$query = DB::table('expenses')
|
$query = DB::table('expenses')
|
||||||
->join('companies', 'companies.id', '=', 'expenses.company_id')
|
->join('companies', 'companies.id', '=', 'expenses.company_id')
|
||||||
->where('expenses.company_id', '=', $company_id)
|
->where('expenses.company_id', '=', $company_id)
|
||||||
//->whereRaw('(expenses.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
// DB::raw('COALESCE(expenses.currency_id, companies.currency_id) currency_id'),
|
|
||||||
DB::raw('COALESCE(expenses.country_id, companies.country_id) country_id'),
|
DB::raw('COALESCE(expenses.country_id, companies.country_id) country_id'),
|
||||||
DB::raw("CONCAT(COALESCE(expense_contacts.first_name, ''), ' ', COALESCE(expense_contacts.last_name, '')) contact"),
|
DB::raw("CONCAT(COALESCE(expense_contacts.first_name, ''), ' ', COALESCE(expense_contacts.last_name, '')) contact"),
|
||||||
'expenses.id',
|
'expenses.id',
|
||||||
|
@ -104,7 +104,6 @@ class TokenFilters extends QueryFilters
|
|||||||
$query = DB::table('company_tokens')
|
$query = DB::table('company_tokens')
|
||||||
->join('companies', 'companies.id', '=', 'company_tokens.company_id')
|
->join('companies', 'companies.id', '=', 'company_tokens.company_id')
|
||||||
->where('company_tokens.company_id', '=', $company_id)
|
->where('company_tokens.company_id', '=', $company_id)
|
||||||
//->whereRaw('(designs.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
'company_tokens.id',
|
'company_tokens.id',
|
||||||
'company_tokens.name',
|
'company_tokens.name',
|
||||||
|
@ -118,7 +118,6 @@ class VendorFilters extends QueryFilters
|
|||||||
->where('vendors.company_id', '=', $company_id)
|
->where('vendors.company_id', '=', $company_id)
|
||||||
->where('vendor_contacts.is_primary', '=', true)
|
->where('vendor_contacts.is_primary', '=', true)
|
||||||
->where('vendor_contacts.deleted_at', '=', null)
|
->where('vendor_contacts.deleted_at', '=', null)
|
||||||
//->whereRaw('(vendors.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
// DB::raw('COALESCE(vendors.currency_id, companies.currency_id) currency_id'),
|
// DB::raw('COALESCE(vendors.currency_id, companies.currency_id) currency_id'),
|
||||||
DB::raw('COALESCE(vendors.country_id, companies.country_id) country_id'),
|
DB::raw('COALESCE(vendors.country_id, companies.country_id) country_id'),
|
||||||
|
@ -105,7 +105,6 @@ class WebhookFilters extends QueryFilters
|
|||||||
$query = DB::table('webhooks')
|
$query = DB::table('webhooks')
|
||||||
->join('companies', 'companies.id', '=', 'webhooks.company_id')
|
->join('companies', 'companies.id', '=', 'webhooks.company_id')
|
||||||
->where('webhooks.company_id', '=', $company_id)
|
->where('webhooks.company_id', '=', $company_id)
|
||||||
//->whereRaw('(designs.name != "" or contacts.first_name != "" or contacts.last_name != "" or contacts.email != "")') // filter out buy now invoices
|
|
||||||
->select(
|
->select(
|
||||||
'webhooks.id',
|
'webhooks.id',
|
||||||
'webhooks.target_url',
|
'webhooks.target_url',
|
||||||
|
@ -31,6 +31,7 @@ class SubscriptionPlanSwitchController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(ShowPlanSwitchRequest $request, RecurringInvoice $recurring_invoice, Subscription $target)
|
public function index(ShowPlanSwitchRequest $request, RecurringInvoice $recurring_invoice, Subscription $target)
|
||||||
{
|
{
|
||||||
|
|
||||||
$amount = $recurring_invoice->subscription
|
$amount = $recurring_invoice->subscription
|
||||||
->service()
|
->service()
|
||||||
->calculateUpgradePriceV2($recurring_invoice, $target);
|
->calculateUpgradePriceV2($recurring_invoice, $target);
|
||||||
@ -44,7 +45,6 @@ class SubscriptionPlanSwitchController extends Controller
|
|||||||
render('subscriptions.denied');
|
render('subscriptions.denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$amount = max(0,$amount);
|
$amount = max(0,$amount);
|
||||||
|
|
||||||
return render('subscriptions.switch', [
|
return render('subscriptions.switch', [
|
||||||
@ -53,5 +53,6 @@ class SubscriptionPlanSwitchController extends Controller
|
|||||||
'target' => $target,
|
'target' => $target,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user