1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-23 09:51:35 +02:00
invoiceninja/resources/views/portal/ninja2020/components/livewire/subscription-plan-switch.blade.php

137 lines
6.2 KiB
PHP
Raw Normal View History

2022-09-02 02:38:27 +02:00
<div>
2021-04-07 18:08:26 +02:00
<div class="grid grid-cols-12 gap-8 mt-8">
<div class="col-span-12 md:col-span-5 md:col-start-4 px-4 py-5">
@if($errors->any())
<div class="alert alert-failure mb-4">
@foreach($errors->all() as $error)
<p>{{ $error }}</p>
@endforeach
</div>
@endif
@if($state['show_rff'])
<div class="mt-2">
@if(strlen(auth()->guard('contact')->user()->first_name) === 0)
<div class="col-span-6 sm:col-span-3">
<label for="first_name" class="input-label">{{ ctrans('texts.first_name') }}</label>
<input id="first_name" class="input w-full" wire:model="first_name" />
</div>
@endif
2021-04-15 05:40:03 +02:00
@if(strlen(auth()->guard('contact')->user()->last_name) === 0)
<div class="col-span-6 sm:col-span-3 mt-2">
<label for="last_name" class="input-label">{{ ctrans('texts.last_name') }}</label>
<input id="last_name" class="input w-full" wire:model="last_name" />
</div>
@endif
@if(strlen(auth()->guard('contact')->user()->email) === 0)
<div class="col-span-6 sm:col-span-3 mt-2">
<label for="email" class="input-label">{{ ctrans('texts.email') }}</label>
<input id="email" class="input w-full" wire:model="email" />
</div>
@endif
<div class="flex justify-center my-4">
<button wire:click="handleRff" class="button button-primary bg-primary">
{{ ctrans('texts.next_step') }}
</button>
</div>
</div>
@endif
<!-- Total price -->
@if($amount > 0 && $state['show_rff'] == false)
2021-04-15 05:40:03 +02:00
2021-04-07 18:08:26 +02:00
<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">
2021-06-27 13:55:15 +02:00
<span class="font-bold tracking-wide bg-gray-100 px-6 py-0">{{ ctrans('texts.select_payment_method')}}</span>
<h1 class="text-2xl font-bold tracking-wide bg-gray-100 px-6 py-0">
{{ ctrans('texts.total') }}: {{ \App\Utils\Number::formatMoney($amount, $subscription->company) }}
</h1>
2021-04-07 18:08:26 +02:00
</div>
</div>
<form action="{{ route('client.payments.process', ['hash' => $hash, 'sidebar' => 'hidden']) }}"
method="post" id="payment-method-form">
@csrf
@if($state['invoice'] instanceof \App\Models\Invoice)
<input type="hidden" name="invoices[]" value="{{ $state['invoice']->hashed_id }}">
<input type="hidden" name="payable_invoices[0][amount]"
value="{{ $state['invoice']->partial > 0 ? \App\Utils\Number::formatValue($state['invoice']->partial, $state['invoice']->client->currency()) : \App\Utils\Number::formatValue($state['invoice']->balance, $state['invoice']->client->currency()) }}">
<input type="hidden" name="payable_invoices[0][invoice_id]"
value="{{ $state['invoice']->hashed_id }}">
@endif
<input type="hidden" name="action" value="payment">
<input type="hidden" name="company_gateway_id" value="{{ $state['company_gateway_id'] }}"/>
<input type="hidden" name="payment_method_id" value="{{ $state['payment_method_id'] }}"/>
<input type="hidden" name="contact_first_name" value="{{ $contact->first_name }}">
<input type="hidden" name="contact_last_name" value="{{ $contact->last_name }}">
<input type="hidden" name="contact_email" value="{{ $contact->email }}">
</form>
<!-- Payment methods -->
2021-04-07 18:08:26 +02:00
<div class="mt-8 flex flex-col items-center">
<div>
@if(!$state['payment_initialised'])
@foreach($this->methods as $method)
<button
2024-01-28 01:05:50 +01:00
wire:click="handleMethodSelectingEvent('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}'); $wire.$refresh();"
class="px-3 py-2 border bg-white rounded mr-4 hover:border-blue-600">
{{ $method['label'] }}
</button>
@endforeach
@endif
@if($state['show_loading_bar'])
<div class="flex justify-center">
<svg class="animate-spin h-8 w-8 text-primary" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor"
stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
</div>
@endif
2021-04-07 18:08:26 +02:00
</div>
</div>
@elseif($amount <= 0 && $state['show_rff'] == false)
2022-09-02 02:38:27 +02:00
2021-06-27 13:55:15 +02:00
<div class="relative flex justify-center text-sm leading-5">
<h1 class="text-2xl font-bold tracking-wide bg-gray-100 px-6 py-0">
{{ ctrans('texts.total') }}: {{ \App\Utils\Number::formatMoney($amount, $subscription->company) }}
</h1>
</div>
<div class="relative flex justify-center text-sm leading-5 mt-10">
2022-09-02 02:38:27 +02:00
<button wire:click="handlePaymentNotRequired" class="px-3 py-2 border rounded mr-4 hover:border-blue-600" wire:loading.attr="disabled" @if($hide_button) disabled @endif>
@if($hide_button) {{ ctrans('texts.loading') }} @else {{ ctrans('texts.click_to_continue') }} @endif
2021-04-15 05:40:03 +02:00
</button>
2021-06-27 13:55:15 +02:00
</div>
2021-04-15 05:40:03 +02:00
@endif
2021-04-07 18:08:26 +02:00
</div>
</div>
2022-09-02 02:38:27 +02:00
2024-01-28 01:05:50 +01:00
<script>
2022-09-02 02:38:27 +02:00
2024-01-28 01:05:50 +01:00
document.addEventListener('livewire:init', () => {
Livewire.on('redirectRoute', (event) => {
window.location.href = event[0].route;
});
});
2022-09-02 02:38:27 +02:00
</script>
2024-01-28 01:05:50 +01:00
2022-09-02 02:38:27 +02:00
</div>