2020-03-23 18:10:42 +01:00
|
|
|
@extends('portal.ninja2020.layout.app')
|
|
|
|
@section('meta_title', ctrans('texts.view_invoice'))
|
|
|
|
|
2020-04-03 22:12:12 +02:00
|
|
|
@push('head')
|
2021-02-18 13:37:27 +01:00
|
|
|
<meta name="show-invoice-terms" content="{{ $settings->show_accept_invoice_terms ? true : false }}">
|
2021-04-10 11:05:50 +02:00
|
|
|
<meta name="require-invoice-signature" content="{{ $client->user->account->hasFeature(\App\Models\Account::FEATURE_INVOICE_SETTINGS) && $settings->require_invoice_signature }}">
|
2021-08-30 15:48:01 +02:00
|
|
|
@include('portal.ninja2020.components.no-cache')
|
2021-10-11 15:06:21 +02:00
|
|
|
<script src="{{ asset('vendor/signature_pad@2.3.2/signature_pad.min.js') }}"></script>
|
2022-02-10 01:07:08 +01:00
|
|
|
|
2020-04-03 22:12:12 +02:00
|
|
|
@endpush
|
|
|
|
|
2024-02-04 17:08:40 +01:00
|
|
|
@section('header')
|
|
|
|
@if($errors->any())
|
|
|
|
<div class="alert alert-failure mb-4">
|
|
|
|
@foreach($errors->all() as $error)
|
|
|
|
<p>{{ $error }}</p>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
@endsection
|
|
|
|
|
2020-03-23 18:10:42 +01:00
|
|
|
@section('body')
|
|
|
|
|
2022-03-19 11:28:11 +01:00
|
|
|
@if($invoice->isPayable() && $client->getSetting('custom_message_unpaid_invoice'))
|
|
|
|
@component('portal.ninja2020.components.message')
|
2023-04-22 01:48:14 +02:00
|
|
|
<pre>{{ $client->getSetting('custom_message_unpaid_invoice') }}</pre>
|
2022-03-19 11:28:11 +01:00
|
|
|
@endcomponent
|
|
|
|
@elseif($invoice->status_id === 4 && $client->getSetting('custom_message_paid_invoice'))
|
2020-04-13 03:48:23 +02:00
|
|
|
@component('portal.ninja2020.components.message')
|
2023-04-22 01:48:14 +02:00
|
|
|
<pre>{{ $client->getSetting('custom_message_paid_invoice') }}</pre>
|
2020-04-13 03:48:23 +02:00
|
|
|
@endcomponent
|
|
|
|
@endif
|
|
|
|
|
2020-03-23 18:10:42 +01:00
|
|
|
@if($invoice->isPayable())
|
2021-02-18 13:37:27 +01:00
|
|
|
<form action="{{ ($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment) ? route('client.invoices.bulk') : route('client.payments.process') }}" method="post" id="payment-form">
|
2020-03-23 18:10:42 +01:00
|
|
|
@csrf
|
2021-02-18 13:37:27 +01:00
|
|
|
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">
|
|
|
|
<input type="hidden" name="action" value="payment">
|
|
|
|
|
|
|
|
<input type="hidden" name="company_gateway_id" id="company_gateway_id">
|
|
|
|
<input type="hidden" name="payment_method_id" id="payment_method_id">
|
|
|
|
<input type="hidden" name="signature">
|
2022-12-22 05:58:18 +01:00
|
|
|
<input type="hidden" name="hash" value="{{ $hash }}">
|
2021-02-18 13:37:27 +01:00
|
|
|
<input type="hidden" name="payable_invoices[0][amount]" value="{{ $invoice->partial > 0 ? \App\Utils\Number::formatValue($invoice->partial, $invoice->client->currency()) : \App\Utils\Number::formatValue($invoice->balance, $invoice->client->currency()) }}">
|
|
|
|
<input type="hidden" name="payable_invoices[0][invoice_id]" value="{{ $invoice->hashed_id }}">
|
2024-02-04 05:46:53 +01:00
|
|
|
<input type="hidden" name="contact_first_name" value="{{ auth()->guard('contact')->user()->first_name }}">
|
|
|
|
<input type="hidden" name="contact_last_name" value="{{ auth()->guard('contact')->user()->last_name }}">
|
|
|
|
<input type="hidden" name="contact_email" value="{{ auth()->guard('contact')->user()->email }}">
|
2024-07-28 08:15:15 +02:00
|
|
|
<input type="hidden" name="client_city" value="{{ auth()->guard('contact')->user()->client->city }}">
|
|
|
|
<input type="hidden" name="client_postal_code" value="{{ auth()->guard('contact')->user()->client->postal_code }}">
|
2021-02-18 13:37:27 +01:00
|
|
|
|
2020-03-23 18:10:42 +01:00
|
|
|
<div class="bg-white shadow sm:rounded-lg mb-4" translate>
|
|
|
|
<div class="px-4 py-5 sm:p-6">
|
|
|
|
<div class="sm:flex sm:items-start sm:justify-between">
|
|
|
|
<div>
|
|
|
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
2021-02-18 13:37:27 +01:00
|
|
|
{{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}}
|
|
|
|
- {{ ctrans('texts.unpaid') }}
|
2020-03-23 18:10:42 +01:00
|
|
|
</h3>
|
|
|
|
</div>
|
2021-06-17 17:12:43 +02:00
|
|
|
<div class="mt-5 sm:mt-0 sm:ml-6 flex justify-end">
|
2020-03-23 18:10:42 +01:00
|
|
|
<div class="inline-flex rounded-md shadow-sm">
|
|
|
|
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">
|
|
|
|
<input type="hidden" name="action" value="payment">
|
2021-02-18 13:37:27 +01:00
|
|
|
|
|
|
|
@if($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment)
|
|
|
|
<button class="button button-primary bg-primary">{{ ctrans('texts.pay_now') }}</button>
|
|
|
|
@else
|
2022-02-28 00:15:36 +01:00
|
|
|
@livewire('pay-now-dropdown', ['total' => $invoice->getPayableAmount(), 'company' => $company])
|
2021-02-18 13:37:27 +01:00
|
|
|
@endif
|
2020-03-23 18:10:42 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2021-01-14 03:57:05 +01:00
|
|
|
@else
|
2021-02-18 13:37:27 +01:00
|
|
|
<div class="bg-white shadow sm:rounded-lg mb-4">
|
|
|
|
<div class="px-4 py-5 sm:p-6">
|
|
|
|
<div class="sm:flex sm:items-start sm:justify-between">
|
|
|
|
<div>
|
|
|
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
|
|
|
{{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}}
|
2021-03-22 11:06:42 +01:00
|
|
|
- {{ \App\Models\Invoice::stringStatus($invoice->status_id) }}
|
2021-02-18 13:37:27 +01:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-14 03:57:05 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-23 18:10:42 +01:00
|
|
|
@endif
|
|
|
|
|
2021-06-30 20:41:03 +02:00
|
|
|
@include('portal.ninja2020.components.entity-documents', ['entity' => $invoice])
|
2023-10-01 02:06:40 +02:00
|
|
|
@livewire('pdf-slot', ['entity' => $invoice, 'invitation' => $invitation, 'db' => $invoice->company->db])
|
2023-07-16 04:40:32 +02:00
|
|
|
|
2020-04-03 22:12:12 +02:00
|
|
|
@endsection
|
2020-03-23 18:10:42 +01:00
|
|
|
|
2020-04-03 22:12:12 +02:00
|
|
|
@section('footer')
|
2024-02-04 05:46:53 +01:00
|
|
|
@include('portal.ninja2020.invoices.includes.required-fields')
|
2023-07-16 04:40:32 +02:00
|
|
|
@include('portal.ninja2020.invoices.includes.signature')
|
2024-01-29 05:43:40 +01:00
|
|
|
@include('portal.ninja2020.invoices.includes.terms', ['entities' => [$invoice], 'variables' => $variables, 'entity_type' => ctrans('texts.invoice')])
|
2023-07-16 04:40:32 +02:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('head')
|
2023-09-04 16:07:34 +02:00
|
|
|
@vite('resources/js/clients/invoices/payment.js')
|
2022-02-10 01:36:44 +01:00
|
|
|
|
2022-02-10 01:07:08 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
2024-07-10 08:06:13 +02:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2023-07-16 04:40:32 +02:00
|
|
|
|
2024-07-10 08:06:13 +02:00
|
|
|
@if($key)
|
|
|
|
window.history.pushState({}, "", "{{ url("client/invoice/{$key}") }}");
|
|
|
|
@endif
|
2022-02-10 01:07:08 +01:00
|
|
|
|
2024-07-10 08:06:13 +02:00
|
|
|
});
|
2023-07-16 04:40:32 +02:00
|
|
|
|
2022-02-10 01:07:08 +01:00
|
|
|
</script>
|
2023-07-16 04:40:32 +02:00
|
|
|
@endpush
|