mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
wip
This commit is contained in:
parent
c4ff24132e
commit
05cbd30bef
@ -139,6 +139,16 @@ class BillingPortalPurchase extends Component
|
||||
*/
|
||||
public $request_data;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $price;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->price = $this->subscription->service()->price();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle user authentication
|
||||
*
|
||||
@ -331,6 +341,13 @@ class BillingPortalPurchase extends Component
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function handleCoupon()
|
||||
{
|
||||
if ($this->coupon == $this->subscription->promo_code) {
|
||||
$this->price = $this->subscription->promo_price;
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
if ($this->contact instanceof ClientContact) {
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
<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">
|
||||
{{ ctrans('texts.total') }}: {{ $subscription->service()->price() }}
|
||||
{{ ctrans('texts.total') }}: {{ $price }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
@ -184,12 +184,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mt-4">
|
||||
<form wire:submit.prevent="handleCoupon" class="flex items-center mt-4">
|
||||
@csrf
|
||||
|
||||
<label class="w-full mr-2">
|
||||
<input type="text" wire:model.lazy="coupon" class="input w-full m-0"/>
|
||||
<small class="block text-gray-900 mt-2">{{ ctrans('texts.billing_coupon_notice') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button class="button button-primary bg-primary">Apply</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user