mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Subscription table view client portal
This commit is contained in:
parent
67a7f823e2
commit
c906bcbf93
@ -21,20 +21,20 @@ class SubscriptionController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if (Ninja::isHosted()) {
|
||||
$count = RecurringInvoice::query()
|
||||
->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
->where('company_id', auth()->guard('contact')->user()->client->company_id)
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->where('is_deleted', 0)
|
||||
->whereNotNull('subscription_id')
|
||||
->withTrashed()
|
||||
->count();
|
||||
// if (Ninja::isHosted()) {
|
||||
// $count = RecurringInvoice::query()
|
||||
// ->where('client_id', auth()->guard('contact')->user()->client->id)
|
||||
// ->where('company_id', auth()->guard('contact')->user()->client->company_id)
|
||||
// ->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
// ->where('is_deleted', 0)
|
||||
// ->whereNotNull('subscription_id')
|
||||
// ->withTrashed()
|
||||
// ->count();
|
||||
|
||||
if ($count == 0) {
|
||||
return redirect()->route('client.ninja_contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'company_key' => auth()->guard('contact')->user()->company->company_key]);
|
||||
}
|
||||
}
|
||||
// if ($count == 0) {
|
||||
// return redirect()->route('client.ninja_contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'company_key' => auth()->guard('contact')->user()->company->company_key]);
|
||||
// }
|
||||
// }
|
||||
|
||||
return render('subscriptions.index');
|
||||
}
|
||||
|
@ -132,11 +132,11 @@ class PortalComposer
|
||||
|
||||
$data[] = ['title' => ctrans('texts.statement'), 'url' => 'client.statement', 'icon' => 'activity'];
|
||||
|
||||
// if (Ninja::isHosted() && auth()->guard('contact')->user()->company->id == config('ninja.ninja_default_company_id')) {
|
||||
// $data[] = ['title' => ctrans('texts.plan'), 'url' => 'client.plan', 'icon' => 'credit-card'];
|
||||
// } else {
|
||||
if (Ninja::isHosted() && auth()->guard('contact')->user()->company->id == config('ninja.ninja_default_company_id')) {
|
||||
$data[] = ['title' => ctrans('texts.plan'), 'url' => 'client.plan', 'icon' => 'credit-card'];
|
||||
} else {
|
||||
$data[] = ['title' => ctrans('texts.subscriptions'), 'url' => 'client.subscriptions.index', 'icon' => 'calendar'];
|
||||
// }
|
||||
}
|
||||
|
||||
if (auth()->guard('contact')->user()->client->getSetting('client_initiated_payments')) {
|
||||
$data[] = ['title' => ctrans('texts.pre_payment'), 'url' => 'client.pre_payments.index', 'icon' => 'dollar-sign'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user