mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Update price per quantity
This commit is contained in:
parent
edbcb0690e
commit
6e714747bd
@ -138,6 +138,13 @@ class BillingPortalPurchase extends Component
|
||||
*/
|
||||
public $request_data;
|
||||
|
||||
/**
|
||||
* Price of product.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $price;
|
||||
|
||||
/**
|
||||
* Handle user authentication
|
||||
*
|
||||
@ -313,9 +320,15 @@ class BillingPortalPurchase extends Component
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
return $option == 'increment'
|
||||
? $this->quantity++
|
||||
: $this->quantity--;
|
||||
if ($option == 'increment') {
|
||||
$this->quantity++;
|
||||
return $this->price = (int) $this->price + $this->billing_subscription->product->price;
|
||||
}
|
||||
|
||||
$this->quantity--;
|
||||
$this->price = (int) $this->price - $this->billing_subscription->product->price;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
@ -2,7 +2,7 @@
|
||||
@section('meta_title', $billing_subscription->product->product_key)
|
||||
|
||||
@section('body')
|
||||
@livewire('billing-portal-purchase', ['billing_subscription' => $billing_subscription, 'contact' => auth('contact')->user(), 'hash' => $hash, 'request_data' => $request_data])
|
||||
@livewire('billing-portal-purchase', ['billing_subscription' => $billing_subscription, 'contact' => auth('contact')->user(), 'hash' => $hash, 'request_data' => $request_data, 'price' => $billing_subscription->product->price])
|
||||
@stop
|
||||
|
||||
@push('footer')
|
||||
|
@ -13,7 +13,7 @@
|
||||
<span class="text-sm uppercase font-bold">{{ ctrans('texts.price') }}:</span>
|
||||
|
||||
<div class="flex space-x-2">
|
||||
<h1 class="text-2xl font-bold tracking-wide">{{ App\Utils\Number::formatMoney($billing_subscription->product->price, $billing_subscription->company) }}</h1>
|
||||
<h1 class="text-2xl font-bold tracking-wide">{{ App\Utils\Number::formatMoney($price, $billing_subscription->company) }}</h1>
|
||||
</div>
|
||||
|
||||
@if($billing_subscription->per_seat_enabled && $billing_subscription->max_seats_limit > 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user