FIX: Desisitimiento no encontrado
This commit is contained in:
@ -54,8 +54,8 @@
|
|||||||
}
|
}
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
const url = '{{$urls->api}}/ventas/pago/{{$venta->resciliacion()->id}}'
|
const url = '{{$urls->api}}/ventas/pago/{{$venta->resciliacion()->id}}'
|
||||||
let old = new Date({{$venta->resciliacion()->fecha->format('Y')}},
|
let old = new Date({{$venta->resciliacion()?->fecha->format('Y') ?? date('Y')}},
|
||||||
{{$venta->resciliacion()->fecha->format('n')}}-1, {{$venta->resciliacion()->fecha->format('j')}})
|
{{$venta->resciliacion()?->fecha->format('n') ?? date('n')}}-1, {{$venta->resciliacion()?->fecha->format('j') ?? date('j')}})
|
||||||
calendar_date_options['initialDate'] = old
|
calendar_date_options['initialDate'] = old
|
||||||
calendar_date_options['onChange'] = function(date, text, mode) {
|
calendar_date_options['onChange'] = function(date, text, mode) {
|
||||||
if (date.getTime() === old.getTime()) {
|
if (date.getTime() === old.getTime()) {
|
||||||
@ -64,7 +64,7 @@
|
|||||||
const body = new FormData()
|
const body = new FormData()
|
||||||
body.set('fecha', date.toISOString())
|
body.set('fecha', date.toISOString())
|
||||||
$('#loading-spinner-fecha').show()
|
$('#loading-spinner-fecha').show()
|
||||||
fetchAPI(url, {method: 'post', body}).then(response => {
|
APIClient.fetch(url, {method: 'post', body}).then(response => {
|
||||||
$('#loading-spinner-fecha').hide()
|
$('#loading-spinner-fecha').hide()
|
||||||
if (!response) {
|
if (!response) {
|
||||||
return
|
return
|
||||||
@ -79,7 +79,7 @@
|
|||||||
const body = new FormData()
|
const body = new FormData()
|
||||||
body.set('valor', val)
|
body.set('valor', val)
|
||||||
$('#loading-spinner-devolucion').show()
|
$('#loading-spinner-devolucion').show()
|
||||||
fetchAPI(url, {method: 'post', body}).then(response => {
|
APIClient.fetch(url, {method: 'post', body}).then(response => {
|
||||||
$('#loading-spinner-devolucion').hide()
|
$('#loading-spinner-devolucion').hide()
|
||||||
if (!response) {
|
if (!response) {
|
||||||
return
|
return
|
||||||
@ -90,7 +90,7 @@
|
|||||||
$('#eliminar_desistimiento').click(event => {
|
$('#eliminar_desistimiento').click(event => {
|
||||||
const url = '{{$urls->api}}/venta/{{$venta->id}}/desistir/eliminar'
|
const url = '{{$urls->api}}/venta/{{$venta->id}}/desistir/eliminar'
|
||||||
$('#loading-spinner-eliminar').show()
|
$('#loading-spinner-eliminar').show()
|
||||||
fetchAPI(url).then(response => {
|
APIClient.fetch(url).then(response => {
|
||||||
$('#loading-spinner-eliminar').hide()
|
$('#loading-spinner-eliminar').hide()
|
||||||
if (!response) {
|
if (!response) {
|
||||||
alertResponse('No se pudo eliminar el desistimiento', {color: 'red', icon: 'triangle exclamation'})
|
alertResponse('No se pudo eliminar el desistimiento', {color: 'red', icon: 'triangle exclamation'})
|
||||||
|
Reference in New Issue
Block a user