mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -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('client_contacts.is_primary', '=', true)
|
||||
->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(
|
||||
// DB::raw('COALESCE(clients.currency_id, companies.currency_id) currency_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"),
|
||||
'clients.id',
|
||||
|
@ -105,7 +105,6 @@ class DesignFilters extends QueryFilters
|
||||
$query = DB::table('designs')
|
||||
->join('companies', 'companies.id', '=', 'designs.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(
|
||||
'designs.id',
|
||||
'designs.name',
|
||||
|
@ -205,9 +205,7 @@ class ExpenseFilters extends QueryFilters
|
||||
$query = DB::table('expenses')
|
||||
->join('companies', 'companies.id', '=', 'expenses.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(
|
||||
// DB::raw('COALESCE(expenses.currency_id, companies.currency_id) currency_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"),
|
||||
'expenses.id',
|
||||
|
@ -104,7 +104,6 @@ class TokenFilters extends QueryFilters
|
||||
$query = DB::table('company_tokens')
|
||||
->join('companies', 'companies.id', '=', 'company_tokens.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(
|
||||
'company_tokens.id',
|
||||
'company_tokens.name',
|
||||
|
@ -118,7 +118,6 @@ class VendorFilters extends QueryFilters
|
||||
->where('vendors.company_id', '=', $company_id)
|
||||
->where('vendor_contacts.is_primary', '=', true)
|
||||
->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(
|
||||
// DB::raw('COALESCE(vendors.currency_id, companies.currency_id) currency_id'),
|
||||
DB::raw('COALESCE(vendors.country_id, companies.country_id) country_id'),
|
||||
|
@ -105,7 +105,6 @@ class WebhookFilters extends QueryFilters
|
||||
$query = DB::table('webhooks')
|
||||
->join('companies', 'companies.id', '=', 'webhooks.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(
|
||||
'webhooks.id',
|
||||
'webhooks.target_url',
|
||||
|
@ -31,6 +31,7 @@ class SubscriptionPlanSwitchController extends Controller
|
||||
*/
|
||||
public function index(ShowPlanSwitchRequest $request, RecurringInvoice $recurring_invoice, Subscription $target)
|
||||
{
|
||||
|
||||
$amount = $recurring_invoice->subscription
|
||||
->service()
|
||||
->calculateUpgradePriceV2($recurring_invoice, $target);
|
||||
@ -44,7 +45,6 @@ class SubscriptionPlanSwitchController extends Controller
|
||||
render('subscriptions.denied');
|
||||
}
|
||||
|
||||
|
||||
$amount = max(0,$amount);
|
||||
|
||||
return render('subscriptions.switch', [
|
||||
@ -53,5 +53,6 @@ class SubscriptionPlanSwitchController extends Controller
|
||||
'target' => $target,
|
||||
'amount' => $amount,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user