mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into fix/maquina-padre-hijo-select
This commit is contained in:
@ -180,6 +180,7 @@ class PresupuestoAdminEdit {
|
||||
this.fileUploadDropzone.init()
|
||||
}
|
||||
|
||||
$('#reprint').on('click', this.reprintPresupuesto.bind(this));
|
||||
}
|
||||
|
||||
|
||||
@ -401,12 +402,12 @@ class PresupuestoAdminEdit {
|
||||
self.tipo_impresion.val(response.data.tipo_impresion);
|
||||
self.POD.val(response.data.POD);
|
||||
|
||||
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
||||
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
||||
response.data.total_aceptado_revisado : response.data.resumen.total_aceptado;
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(totalAceptadoRevisado);
|
||||
|
||||
|
||||
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
||||
|
||||
|
||||
$('#created_by').html(response.data.created_by);
|
||||
$('#updated_by').html(response.data.updated_by);
|
||||
$('#created_at').html(response.data.created_at);
|
||||
@ -677,6 +678,53 @@ class PresupuestoAdminEdit {
|
||||
})
|
||||
}
|
||||
|
||||
reprintPresupuesto() {
|
||||
|
||||
const id = window.location.href.split("/").pop();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Reimpresion',
|
||||
text: "¿Quiere usar los mismos ficheros para la reimpresión?\n(Si no usa los mismos, deberá subir unos nuevos)",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Usar los MISMOS',
|
||||
cancelButtonText: 'Cancelar',
|
||||
denyButtonText: "Usar OTROS",
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
denyButton: 'btn btn-primary me-1',
|
||||
cancelButton: 'btn btn-secondary'
|
||||
},
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isDenied || result.isConfirmed) {
|
||||
new Ajax('/presupuestoadmin/reprint',
|
||||
{ id: id, duplicateFiles: result.isConfirmed ? 1 : 0 }, {},
|
||||
function (response) {
|
||||
if (response.success === true) {
|
||||
Swal.fire({
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Ok',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
window.open('/presupuestoadmin/edit/' + response.id, '_blank');
|
||||
} else {
|
||||
popErrorAlert(response.mensaje);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
popErrorAlert(error);
|
||||
}
|
||||
).post();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
@ -704,4 +752,5 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
console.log("Error getting translations:", error);
|
||||
}
|
||||
).post();
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user