mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 04:04:47 -04:00
Working on subscriptions
This commit is contained in:
parent
c7923d706a
commit
f67959fb06
@ -23,6 +23,8 @@ class SubscriptionPurchaseController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(Subscription $subscription, Request $request)
|
public function index(Subscription $subscription, Request $request)
|
||||||
{
|
{
|
||||||
|
App::setLocale($subscription->company->locale());
|
||||||
|
|
||||||
/* Make sure the contact is logged into the correct company for this subscription */
|
/* Make sure the contact is logged into the correct company for this subscription */
|
||||||
if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id) {
|
if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id) {
|
||||||
auth()->guard('contact')->logout();
|
auth()->guard('contact')->logout();
|
||||||
@ -42,6 +44,9 @@ class SubscriptionPurchaseController extends Controller
|
|||||||
|
|
||||||
public function upgrade(Subscription $subscription, Request $request)
|
public function upgrade(Subscription $subscription, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
App::setLocale($subscription->company->locale());
|
||||||
|
|
||||||
/* Make sure the contact is logged into the correct company for this subscription */
|
/* Make sure the contact is logged into the correct company for this subscription */
|
||||||
if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id) {
|
if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id) {
|
||||||
auth()->guard('contact')->logout();
|
auth()->guard('contact')->logout();
|
||||||
|
@ -39,9 +39,9 @@ class SubscriptionsTable extends Component
|
|||||||
->where('company_id', $this->company->id)
|
->where('company_id', $this->company->id)
|
||||||
->whereNotNull('subscription_id')
|
->whereNotNull('subscription_id')
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
->whereIn('status_id', [RecurringInvoice::STATUS_ACTIVE, RecurringInvoice::STATUS_PAUSED])
|
||||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
||||||
->paginate($this->per_page);
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.subscriptions-table', [
|
return render('components.livewire.subscriptions-table', [
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
<table class="min-w-full shadow rounded border border-gray-200 mt-4 credits-table">
|
<table class="min-w-full shadow rounded border border-gray-200 mt-4 credits-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-white uppercase border-b border-gray-200 bg-primary">
|
||||||
|
<p role="button" wire:click="sortBy('status_id')" class="cursor-pointer">
|
||||||
|
{{ ctrans('texts.status') }}
|
||||||
|
</p>
|
||||||
|
</th>
|
||||||
<th class="px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-white uppercase border-b border-gray-200 bg-primary">
|
<th class="px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-white uppercase border-b border-gray-200 bg-primary">
|
||||||
<p role="button" wire:click="sortBy('number')" class="cursor-pointer">
|
<p role="button" wire:click="sortBy('number')" class="cursor-pointer">
|
||||||
{{ ctrans('texts.subscription') }}
|
{{ ctrans('texts.subscription') }}
|
||||||
@ -47,6 +52,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@forelse($recurring_invoices as $recurring_invoice)
|
@forelse($recurring_invoices as $recurring_invoice)
|
||||||
<tr class="bg-white group hover:bg-gray-100">
|
<tr class="bg-white group hover:bg-gray-100">
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
|
{!! $recurring_invoice->badgeForStatus($recurring_invoice->status_id) !!}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
{{ $recurring_invoice->subscription->name }}
|
{{ $recurring_invoice->subscription->name }}
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user