diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index d383ee55220d..9916b46d0102 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -144,7 +144,7 @@ class BillingPortalPurchase extends Component * * @var int */ - public $quantity = 1; + public $quantity; /** * First-hit request data (queries, locales...). @@ -183,6 +183,8 @@ class BillingPortalPurchase extends Component { MultiDB::setDb($this->company->db); + $this->quantity = 1; + $this->price = $this->subscription->price; if (request()->query('coupon')) { @@ -433,13 +435,14 @@ class BillingPortalPurchase extends Component if ($option == 'increment') { $this->quantity++; - return $this->price = (int)$this->price + $this->subscription->product->price; + $this->price = $this->subscription->promo_price * $this->quantity; + return $this->quantity; } - $this->quantity--; - $this->price = (int)$this->price - $this->subscription->product->price; + $this->quantity--; + $this->price = $this->subscription->promo_price * $this->quantity; - return 0; + return $this->quantity; } public function handleCoupon() diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php index 6c67fbd9e3e2..da5fcadbe9be 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php @@ -51,6 +51,29 @@ @endif + + @if($subscription->per_seat_enabled && $subscription->max_seats_limit > 1) +
+ {{ ctrans('texts.qty') }}: + +
{{ $quantity }}
+ +
+ @endif +
diff --git a/resources/views/portal/ninja2020/purchase_orders/show.blade.php b/resources/views/portal/ninja2020/purchase_orders/show.blade.php index ec4d83f9e178..3f9ad02d9722 100644 --- a/resources/views/portal/ninja2020/purchase_orders/show.blade.php +++ b/resources/views/portal/ninja2020/purchase_orders/show.blade.php @@ -12,7 +12,7 @@ @section('body') - @if($purchase_order->company->getSetting('vendor_portal_enable_uploads') || true) + @if($purchase_order->company->getSetting('vendor_portal_enable_uploads')) @component('portal.ninja2020.purchase_orders.includes.upload', ['purchase_order' => $purchase_order]) @endcomponent @endif