improvements for validation of over/under payments

This commit is contained in:
David Bomba 2024-07-02 16:13:52 +10:00 committed by Benjamin Beganović
parent 6983104f40
commit 96a3599b7e
2 changed files with 6 additions and 6 deletions

View File

@ -43,8 +43,6 @@ class InvoicePay extends Component
public $required_fields = false;
public $ready = true;
public array $context = [];
#[On('update.context')]
@ -122,7 +120,6 @@ class InvoicePay extends Component
// if($this->ready)
nlog("computed");
return ProcessPayment::class;
}

View File

@ -1,4 +1,4 @@
<div x-data="{ payableAmount: '{{ $payableAmount }}' }" class="px-4 py-5 bg-white sm:gap-4 sm:px-6">
<div x-data="{ payableAmount: '{{ $payableAmount }}', errors: @entangle('errors') }" class="px-4 py-5 bg-white sm:gap-4 sm:px-6">
<dt class="text-sm font-medium leading-5 text-gray-500">
{{ ctrans('texts.payment_amount') }}
@ -17,6 +17,10 @@
</label>
</div>
<template x-if="errors.length > 0">
<div x-text="errors" class="alert alert-failure mb-4"></div>
</template>
@if($settings->client_portal_allow_under_payment)
<span class="mt-1 text-sm text-gray-800">{{ ctrans('texts.minimum_payment') }}: {{ $settings->client_portal_under_payment_minimum }}</span>
@endif
@ -25,7 +29,7 @@
<div class="bg-white px-4 py-5 flex w-full justify-end">
<button
class="button button-primary bg-primary payment-method flex items-center justify-center relative py-4"
@click="$wire.dispatch('payable-amount', { payable_amount: payableAmount })">
wire:click="checkValue(payableAmount)">
<svg class="animate-spin h-5 w-5 text-white hidden" 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>
@ -33,5 +37,4 @@
<span>{{ ctrans('texts.next') }}</span>
</button>
</div>
</div>