diff --git a/app/Filters/ClientFilters.php b/app/Filters/ClientFilters.php index cd19453991f1..65923049a754 100644 --- a/app/Filters/ClientFilters.php +++ b/app/Filters/ClientFilters.php @@ -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', diff --git a/app/Filters/DesignFilters.php b/app/Filters/DesignFilters.php index 37577562cb2a..5db04472ff30 100644 --- a/app/Filters/DesignFilters.php +++ b/app/Filters/DesignFilters.php @@ -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', diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index 697f4b64f148..8b17219efff4 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -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', diff --git a/app/Filters/TokenFilters.php b/app/Filters/TokenFilters.php index 2f471a1304a7..a771aaab7f59 100644 --- a/app/Filters/TokenFilters.php +++ b/app/Filters/TokenFilters.php @@ -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', diff --git a/app/Filters/VendorFilters.php b/app/Filters/VendorFilters.php index dd2c7e885824..b330d53a334d 100644 --- a/app/Filters/VendorFilters.php +++ b/app/Filters/VendorFilters.php @@ -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'), diff --git a/app/Filters/WebhookFilters.php b/app/Filters/WebhookFilters.php index 5dec35538f32..b42f49909890 100644 --- a/app/Filters/WebhookFilters.php +++ b/app/Filters/WebhookFilters.php @@ -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', diff --git a/app/Http/Controllers/ClientPortal/SubscriptionPlanSwitchController.php b/app/Http/Controllers/ClientPortal/SubscriptionPlanSwitchController.php index aa829ef457e0..34ad3ae061c9 100644 --- a/app/Http/Controllers/ClientPortal/SubscriptionPlanSwitchController.php +++ b/app/Http/Controllers/ClientPortal/SubscriptionPlanSwitchController.php @@ -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, ]); + } }