Merge pull request 'FIX: no permite escriturar cuando se reajusta si no existe pie' (#23) from fix/no-escritura into develop

Reviewed-on: #23
This commit is contained in:
2025-04-04 16:20:39 +00:00

View File

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