FIX: Venta desistida pero sin resciliacion
This commit is contained in:
@ -54,15 +54,16 @@
|
||||
}
|
||||
$(document).ready(() => {
|
||||
const url = '{{$urls->api}}/ventas/pago/{{$venta->resciliacion()->id}}'
|
||||
let old = new Date({{$venta->resciliacion()?->fecha->format('Y') ?? date('Y')}},
|
||||
{{$venta->resciliacion()?->fecha->format('n') ?? date('n')}}-1, {{$venta->resciliacion()?->fecha->format('j') ?? date('j')}})
|
||||
let old = new Date(Date.parse('{{$venta->resciliacion()?->fecha->format('Y-m-d') ?? $venta->currentEstado()->fecha->format('Y-m-d') ?? $venta->fecha->format('Y-m-d')}}') + 24 * 60 * 60 * 1000)
|
||||
calendar_date_options['initialDate'] = old
|
||||
calendar_date_options['onChange'] = function(date, text, mode) {
|
||||
if (date.getTime() === old.getTime()) {
|
||||
return
|
||||
}
|
||||
const body = new FormData()
|
||||
body.set('fecha', date.toISOString())
|
||||
const fecha = date
|
||||
fecha.setDate(date.getDate() - 1)
|
||||
body.set('fecha', fecha.toISOString())
|
||||
$('#loading-spinner-fecha').show()
|
||||
APIClient.fetch(url, {method: 'post', body}).then(response => {
|
||||
$('#loading-spinner-fecha').hide()
|
||||
|
Reference in New Issue
Block a user