Mejoras en Facturacion

This commit is contained in:
2023-11-30 18:40:15 -03:00
parent f2efb41977
commit 04478afa2f
14 changed files with 310 additions and 24 deletions

View File

@ -112,15 +112,15 @@
}
}).then(data => {
if (data.total > 0) {
const progress = this.draw().progress(data.ventas.length)
this.data.id = data.proyecto.id
this.data.proyecto = data.proyecto.descripcion
this.data.venta_ids = data.ventas
const promises = []
data.ventas.forEach(venta_id => {
const promise = this.get().venta(venta_id)
/*promise.then(() => {
this.draw().ventas(true)
})*/
const promise = this.get().venta(venta_id).then(() => {
progress.progress('increment')
})
promises.push(promise)
})
Promise.all(promises).then(() => {
@ -185,6 +185,26 @@
parent.show()
parent.find('.item.proyecto').click(this.actions().get)
},
progress: cantidad => {
const parent = $(this.ids.proyectos)
parent.html('')
const progress = $('<div></div>').addClass('ui active progress').append(
$('<div></div>').addClass('bar').append(
$('<div></div>').addClass('centered progress')
)
).append(
$('<div></div>').addClass('label').html('Cargando datos')
)
progress.progress({
total: cantidad,
label: 'ratio',
text: {
ratio: '{value} de {total} ({percent}%)'
}
})
parent.append(progress)
return progress
},
ventas: (loading = false) => {
const title = $(this.ids.title)
const parent = $(this.ids.proyectos)