mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-11 15:34:21 -04:00
- Fix typo in BaseController.php
- Add labels on top of billing page (one-time, or/and subscription) - Show products - Pull the price from the service
This commit is contained in:
parent
c2406563ef
commit
d37d727d2c
@ -92,7 +92,7 @@ class BaseController extends Controller
|
|||||||
'company.quotes.invitations.company',
|
'company.quotes.invitations.company',
|
||||||
'company.quotes.documents',
|
'company.quotes.documents',
|
||||||
'company.tasks.documents',
|
'company.tasks.documents',
|
||||||
'company.subcsriptions',
|
'company.subscriptions',
|
||||||
'company.tax_rates',
|
'company.tax_rates',
|
||||||
'company.tokens_hashed',
|
'company.tokens_hashed',
|
||||||
'company.vendors.contacts.company',
|
'company.vendors.contacts.company',
|
||||||
@ -215,7 +215,7 @@ class BaseController extends Controller
|
|||||||
|
|
||||||
if(!$user->hasPermission('view_client'))
|
if(!$user->hasPermission('view_client'))
|
||||||
$query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
$query->where('clients.user_id', $user->id)->orWhere('clients.assigned_user_id', $user->id);
|
||||||
|
|
||||||
},
|
},
|
||||||
'company.company_gateways' => function ($query) use ($user) {
|
'company.company_gateways' => function ($query) use ($user) {
|
||||||
$query->whereNotNull('updated_at');
|
$query->whereNotNull('updated_at');
|
||||||
@ -340,14 +340,14 @@ class BaseController extends Controller
|
|||||||
|
|
||||||
if(!$user->isAdmin())
|
if(!$user->isAdmin())
|
||||||
$query->where('activities.user_id', $user->id);
|
$query->where('activities.user_id', $user->id);
|
||||||
|
|
||||||
},
|
},
|
||||||
'company.subscriptions'=> function ($query) use($updated_at, $user) {
|
'company.subscriptions'=> function ($query) use($updated_at, $user) {
|
||||||
$query->where('updated_at', '>=', $updated_at);
|
$query->where('updated_at', '>=', $updated_at);
|
||||||
|
|
||||||
if(!$user->isAdmin())
|
if(!$user->isAdmin())
|
||||||
$query->where('subscriptions.user_id', $user->id);
|
$query->where('subscriptions.user_id', $user->id);
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -443,7 +443,7 @@ class BaseController extends Controller
|
|||||||
if ($this->serializer && $this->serializer != EntityTransformer::API_SERIALIZER_JSON) {
|
if ($this->serializer && $this->serializer != EntityTransformer::API_SERIALIZER_JSON) {
|
||||||
$this->entity_type = null;
|
$this->entity_type = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = new Item($item, $transformer, $this->entity_type);
|
$resource = new Item($item, $transformer, $this->entity_type);
|
||||||
|
|
||||||
if (auth()->user() && request()->include_static) {
|
if (auth()->user() && request()->include_static) {
|
||||||
|
@ -5,60 +5,62 @@
|
|||||||
alt="{{ $subscription->company->present()->name }}">
|
alt="{{ $subscription->company->present()->name }}">
|
||||||
|
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<p
|
@if(!empty($subscription->product_ids))
|
||||||
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-primary text-white">
|
<p
|
||||||
Subscription
|
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-primary text-white">
|
||||||
</p>
|
One-time purchase
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(!empty($subscription->recurring_product_ids))
|
||||||
|
<p
|
||||||
|
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-primary text-white">
|
||||||
|
Subscription
|
||||||
|
</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
<h1 id="billing-page-company-logo" class="text-3xl font-bold tracking-wide">
|
<h1 id="billing-page-company-logo" class="text-3xl font-bold tracking-wide">
|
||||||
Invoice Ninja Pro+
|
{{ $subscription->name }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if(!empty($subscription->product_ids))
|
@if(!empty($subscription->product_ids))
|
||||||
<div class="flex flex-col mt-8">
|
<div class="flex flex-col mt-8">
|
||||||
<span
|
<p
|
||||||
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center rounded-full text-xs font-medium">
|
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center rounded-full text-xs font-medium">
|
||||||
One-time purchases:
|
One-time purchases:
|
||||||
</span>
|
</p>
|
||||||
|
|
||||||
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
@foreach($subscription->service()->products() as $product)
|
||||||
<div class="text-sm">Pro+ plan</div>
|
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
||||||
<div data-ref="price-and-quantity-container">
|
<div class="text-sm">{{ $product->product_key }}</div>
|
||||||
<span data-ref="price">$10</span>
|
<div data-ref="price-and-quantity-container">
|
||||||
<span data-ref="quantity" class="text-sm">(1x)</span>
|
<span
|
||||||
|
data-ref="price">{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}</span>
|
||||||
|
{{-- <span data-ref="quantity" class="text-sm">(1x)</span>--}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endforeach
|
||||||
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
|
||||||
<div class="text-sm">Another awesome product</div>
|
|
||||||
<div data-ref="price-and-quantity-container">
|
|
||||||
<span data-ref="price">$5</span>
|
|
||||||
<span data-ref="quantity" class="text-sm">(2x)</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(!empty($subscription->recurring_product_ids))
|
@if(!empty($subscription->recurring_product_ids))
|
||||||
<div class="flex flex-col mt-8">
|
<div class="flex flex-col mt-8">
|
||||||
<span
|
<p
|
||||||
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center rounded-full text-xs font-medium">
|
class="mb-4 uppercase leading-4 tracking-wide inline-flex items-center rounded-full text-xs font-medium">
|
||||||
Recurring purchases:
|
Recurring purchases:
|
||||||
</span>
|
</p>
|
||||||
|
|
||||||
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
@foreach($subscription->service()->recurring_products() as $product)
|
||||||
<div class="text-sm">Pro+ plan</div>
|
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
||||||
<div data-ref="price-and-quantity-container">
|
<div class="text-sm">{{ $product->product_key }}</div>
|
||||||
<span data-ref="price">$10</span>
|
<div data-ref="price-and-quantity-container">
|
||||||
<span data-ref="quantity" class="text-sm">(1x)</span>
|
<span
|
||||||
|
data-ref="price">{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}</span>
|
||||||
|
{{-- <span data-ref="quantity" class="text-sm">(1x)</span>--}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endforeach
|
||||||
<div class="flex items-center justify-between mb-4 bg-white rounded px-6 py-4 shadow-sm border">
|
|
||||||
<div class="text-sm">Another awesome product</div>
|
|
||||||
<div data-ref="price-and-quantity-container">
|
|
||||||
<span data-ref="price">$5</span>
|
|
||||||
<span data-ref="quantity" class="text-sm">(2x)</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -69,7 +71,7 @@
|
|||||||
|
|
||||||
<div class="relative flex justify-center text-sm leading-5">
|
<div class="relative flex justify-center text-sm leading-5">
|
||||||
<h1 class="text-2xl font-bold tracking-wide bg-gray-50 px-6 py-0">
|
<h1 class="text-2xl font-bold tracking-wide bg-gray-50 px-6 py-0">
|
||||||
{{ ctrans('texts.total') }}: {{ App\Utils\Number::formatMoney(20, $subscription->company) }}
|
{{ ctrans('texts.total') }}: {{ $subscription->service()->price() }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user