new view and components
This commit is contained in:
@@ -54,71 +54,80 @@ function Receipt() {
|
||||
// handleSaveReceipt();
|
||||
}}
|
||||
>
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Folio:</label>
|
||||
<input
|
||||
type='text'
|
||||
value={folio}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (/^\d*$/.test(value)) {
|
||||
setFolio(value);
|
||||
}
|
||||
}}
|
||||
placeholder='Numero de folio...'
|
||||
inputMode='numeric'
|
||||
pattern='[0-9]*'
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Monto:</label>
|
||||
<input
|
||||
type='text'
|
||||
value={amount}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
<div className="gap">
|
||||
|
||||
if (/^\d*\.?\d*$/.test(value)) {
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
if (value === '' || (numericValue <= 1000)) {
|
||||
setAmount(value);
|
||||
} else {
|
||||
setAlert('')
|
||||
setError('El monto no puede superar $1000.00')
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Folio:</label>
|
||||
<input
|
||||
type='text'
|
||||
value={folio}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (/^\d*$/.test(value)) {
|
||||
setFolio(value);
|
||||
}
|
||||
}
|
||||
}}
|
||||
placeholder='Monto recibido...'
|
||||
inputMode='numeric'
|
||||
pattern="^\d*\.?\d+$"
|
||||
/>
|
||||
</div>
|
||||
}}
|
||||
placeholder='Numero de folio...'
|
||||
inputMode='numeric'
|
||||
pattern='[0-9]*'
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Fecha de Pago:</label>
|
||||
<input
|
||||
type='date'
|
||||
value={date}
|
||||
onChange={(e) => setDate(e.target.value)}
|
||||
min={minFecha}
|
||||
max={maxFecha}
|
||||
/>
|
||||
</div>
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Monto:</label>
|
||||
<input
|
||||
type='text'
|
||||
value={amount}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
|
||||
<div className='containerButton'>
|
||||
if (/^\d*\.?\d*$/.test(value)) {
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
{error &&
|
||||
<div className={`messageBox error ${!showError ? 'hidden' : ''}`}>
|
||||
{error}
|
||||
</div>
|
||||
}
|
||||
{alert &&
|
||||
<div className={`messageBox success ${!showAlert ? 'hidden' : ''}`}>
|
||||
{alert}
|
||||
</div>
|
||||
}
|
||||
if (value === '' || (numericValue <= 1000)) {
|
||||
setAmount(value);
|
||||
} else {
|
||||
setAlert('')
|
||||
setError('El monto no puede superar $1000.00')
|
||||
}
|
||||
}
|
||||
}}
|
||||
placeholder='Monto recibido...'
|
||||
inputMode='numeric'
|
||||
pattern="^\d*\.?\d+$"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='groupInput'>
|
||||
<label className='label'>Fecha de Pago:</label>
|
||||
<input
|
||||
type='date'
|
||||
value={date}
|
||||
onChange={(e) => setDate(e.target.value)}
|
||||
min={minFecha}
|
||||
max={maxFecha}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='containerButton'>
|
||||
<button
|
||||
className="button buttonSearch">
|
||||
Guardar
|
||||
</button>
|
||||
|
||||
{error &&
|
||||
<div className={`messageBox error ${!showError ? 'hidden' : ''}`}>
|
||||
{error}
|
||||
</div>
|
||||
}
|
||||
{alert &&
|
||||
<div className={`messageBox success ${!showAlert ? 'hidden' : ''}`}>
|
||||
{alert}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user