mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:04:41 -04:00
wip
This commit is contained in:
parent
6b73d78abe
commit
71d28e691b
@ -30,6 +30,7 @@ class SubscriptionInvoicesTable extends Component
|
|||||||
->where('client_id', auth('contact')->user()->client->id)
|
->where('client_id', auth('contact')->user()->client->id)
|
||||||
->whereNotNull('subscription_id')
|
->whereNotNull('subscription_id')
|
||||||
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
||||||
|
->where('balance', '=', 0)
|
||||||
->paginate($this->per_page);
|
->paginate($this->per_page);
|
||||||
|
|
||||||
return render('components.livewire.subscriptions-invoices-table', [
|
return render('components.livewire.subscriptions-invoices-table', [
|
||||||
|
@ -122,7 +122,8 @@ class SubscriptionService
|
|||||||
'context' => 'is_eligible',
|
'context' => 'is_eligible',
|
||||||
'subscription' => $this->subscription->hashed_id,
|
'subscription' => $this->subscription->hashed_id,
|
||||||
'contact' => $contact->hashed_id,
|
'contact' => $contact->hashed_id,
|
||||||
'contact_email' => $contact->email
|
'contact_email' => $contact->email,
|
||||||
|
'client' => $contact->client->hashed_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = $this->triggerWebhook($context);
|
$response = $this->triggerWebhook($context);
|
||||||
@ -277,4 +278,28 @@ class SubscriptionService
|
|||||||
{
|
{
|
||||||
return Product::whereIn('id', $this->transformKeys(explode(",", $this->subscription->recurring_product_ids)))->get();
|
return Product::whereIn('id', $this->transformKeys(explode(",", $this->subscription->recurring_product_ids)))->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get available upgrades & downgrades for the plan.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
|
||||||
|
*/
|
||||||
|
public function getPlans()
|
||||||
|
{
|
||||||
|
return Subscription::query()
|
||||||
|
->where('company_id', $this->subscription->company_id)
|
||||||
|
->where('group_id', $this->subscription->group_id)
|
||||||
|
->where('id', '!=', $this->subscription->id)
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function completePlanChange(PaymentHash $paymentHash)
|
||||||
|
{
|
||||||
|
// .. handle redirect, after upgrade redirects, etc..
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleCancellation()
|
||||||
|
{
|
||||||
|
// ..
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4202,6 +4202,7 @@ $LANG = array(
|
|||||||
'invoice_task_datelog_help' => 'Add date details to the invoice line items',
|
'invoice_task_datelog_help' => 'Add date details to the invoice line items',
|
||||||
'promo_code' => 'Promo code',
|
'promo_code' => 'Promo code',
|
||||||
'recurring_invoice_issued_to' => 'Recurring invoice issued to',
|
'recurring_invoice_issued_to' => 'Recurring invoice issued to',
|
||||||
|
'subscription' => 'Subscription',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
@ -19,6 +19,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('number')" class="cursor-pointer">
|
||||||
|
{{ ctrans('texts.subscription') }}
|
||||||
|
</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.invoice') }}
|
{{ ctrans('texts.invoice') }}
|
||||||
@ -26,7 +31,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
||||||
<p role="button" wire:click="sortBy('amount')" class="cursor-pointer">
|
<p role="button" wire:click="sortBy('amount')" class="cursor-pointer">
|
||||||
{{ ctrans('texts.total') }}
|
{{ ctrans('texts.amount') }}
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
||||||
@ -39,6 +44,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@forelse($invoices as $invoice)
|
@forelse($invoices as $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-no-wrap text-sm leading-5 text-gray-500">
|
||||||
|
{{ $invoice->subscription->name }}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
<a href="{{ route('client.invoice.show', $invoice->hashed_id) }}"
|
<a href="{{ route('client.invoice.show', $invoice->hashed_id) }}"
|
||||||
class="button-link text-primary">
|
class="button-link text-primary">
|
||||||
|
@ -19,6 +19,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('number')" class="cursor-pointer">
|
||||||
|
{{ ctrans('texts.subscription') }}
|
||||||
|
</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.invoice') }}
|
{{ ctrans('texts.invoice') }}
|
||||||
@ -26,7 +31,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
||||||
<p role="button" wire:click="sortBy('amount')" class="cursor-pointer">
|
<p role="button" wire:click="sortBy('amount')" class="cursor-pointer">
|
||||||
{{ ctrans('texts.total') }}
|
{{ ctrans('texts.amount') }}
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
<th class="px-6 py-3 border-b border-gray-200 bg-primary text-left text-xs leading-4 font-medium text-white uppercase tracking-wider">
|
||||||
@ -39,6 +44,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-no-wrap text-sm leading-5 text-gray-500">
|
||||||
|
{{ $recurring_invoice->subscription->name }}
|
||||||
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||||
<a href="{{ route('client.recurring_invoice.show', $recurring_invoice->hashed_id) }}"
|
<a href="{{ route('client.recurring_invoice.show', $recurring_invoice->hashed_id) }}"
|
||||||
class="button-link text-primary">
|
class="button-link text-primary">
|
||||||
|
@ -85,5 +85,10 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if($invoice->subscription->allow_plan_changes)
|
||||||
|
@foreach($invoice->subscription->service()->getPlans() as $subscription)
|
||||||
|
<a href="#">{{ $subscription->name }}</a>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user