Si no existe Pie no muestra reajuste.

Mostrar loading mientras se guarda
This commit is contained in:
Juan Pablo Vial
2025-04-04 13:19:20 -03:00
parent 28fb96db6a
commit 3b38b5d349

View File

@ -23,6 +23,7 @@
</div>
</div>
</div>
@if ($venta->formaPago()->pie !== null)
@if ($venta->formaPago()->pie->reajuste === null)
<h4 class="ui header optional" data-name="reajuste">Reajuste <i class="small plus icon"></i></h4>
<div class="fields optional" id="reajuste">
@ -61,6 +62,7 @@
</div>
</div>
@endif
@endif
@if (!isset($venta->formaPago()->escritura))
<h4 class="ui header optional" data-name="pago">Pago en Escritura <i class="small plus icon"></i></h4>
<div class="fields optional" id="pago">
@ -249,6 +251,7 @@
subsidio.watch()
$('#escriturar_form').submit(event => {
event.preventDefault()
$('.ui.button').addClass('loading')
const url = '{{$urls->api}}/venta/{{$venta->id}}/escriturar'
const body = new FormData(event.currentTarget)
const fecha = $('#fecha').calendar('get date')
@ -268,6 +271,7 @@
}
}
fetchAPI(url, {method: 'post', body}).then(response => {
$('.ui.button').removeClass('loading')
if (response.ok) {
return response.json()
}