1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Hide/show coupon code field if promo code configured in billing tableclear

This commit is contained in:
Benjamin Beganović 2021-03-22 13:34:59 +01:00
parent 8839bfabd3
commit 8bc4896daa
2 changed files with 16 additions and 14 deletions

View File

@ -262,7 +262,7 @@ class BillingPortalPurchase extends Component
'client_contact_id' => $this->contact->hashed_id,
]],
'user_input_promo_code' => $this->coupon,
'coupon' => $this->coupon,
'coupon' => empty($this->billing_subscription->promo_code) ? '' : $this->coupon,
'quantity' => $this->quantity,
];

View File

@ -139,22 +139,24 @@
</form>
@endif
<div class="relative mt-8">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
@if(!empty($billing_subscription->promo_code))
<div class="relative mt-8">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm leading-5">
<span class="px-2 text-gray-700 bg-white">Have a coupon code?</span>
</div>
</div>
<div class="relative flex justify-center text-sm leading-5">
<span class="px-2 text-gray-700 bg-white">Have a coupon code?</span>
<div class="flex items-center mt-4">
<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>
</div>
<div class="flex items-center mt-4">
<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>
@endif
</div>
</div>
</div>