mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
cambiado reimprimir
This commit is contained in:
@ -2134,6 +2134,9 @@ class PresupuestoService extends BaseService
|
|||||||
$presupuesto->comentarios_safekat = $presupuesto->comentarios_safekat . $text;
|
$presupuesto->comentarios_safekat = $presupuesto->comentarios_safekat . $text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$presupuesto->inc_rei = null;
|
||||||
|
}
|
||||||
$new_id = $modelPresupuesto->insert($presupuesto);
|
$new_id = $modelPresupuesto->insert($presupuesto);
|
||||||
|
|
||||||
$presupuestoAcabadosModel = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
$presupuestoAcabadosModel = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||||
|
|||||||
@ -681,85 +681,48 @@ class PresupuestoAdminEdit {
|
|||||||
reprintPresupuesto() {
|
reprintPresupuesto() {
|
||||||
|
|
||||||
const id = window.location.href.split("/").pop();
|
const id = window.location.href.split("/").pop();
|
||||||
new Ajax('/presupuestoadmin/hasFiles',
|
|
||||||
{ id: id }, {},
|
|
||||||
function (response) {
|
|
||||||
if (response.status === 'success') {
|
|
||||||
if (response.hasFiles) {
|
|
||||||
|
|
||||||
|
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({
|
Swal.fire({
|
||||||
title: 'El presupuesto tiene archivos adjuntos',
|
text: response.message,
|
||||||
text: '¿Desea incluir los mismos ficheros en el nuevo presupuesto?',
|
icon: 'success',
|
||||||
icon: 'warning',
|
confirmButtonColor: '#3085d6',
|
||||||
showCancelButton: true,
|
confirmButtonText: 'Ok',
|
||||||
confirmButtonText: 'Sí',
|
|
||||||
cancelButtonText: 'No',
|
|
||||||
customClass: {
|
customClass: {
|
||||||
confirmButton: 'btn btn-danger me-1',
|
confirmButton: 'btn btn-primary me-1',
|
||||||
cancelButton: 'btn btn-secondary'
|
|
||||||
},
|
},
|
||||||
buttonsStyling: false
|
buttonsStyling: false
|
||||||
}).then((result) => {
|
})
|
||||||
new Ajax('/presupuestoadmin/reprint',
|
window.open('/presupuestoadmin/edit/' + response.id, '_blank');
|
||||||
{ id: id, duplicateFiles: result.isConfirmed ? 1 : 0 }, {},
|
} else {
|
||||||
function (response) {
|
popErrorAlert(response.mensaje);
|
||||||
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();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else {
|
},
|
||||||
new Ajax('/presupuestoadmin/reprint',
|
function (error) {
|
||||||
{ id: id, duplicateFiles: 0 }, {},
|
popErrorAlert(error);
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
popErrorAlert(response.mensaje);
|
|
||||||
}
|
}
|
||||||
},
|
).post();
|
||||||
function (error) {
|
}
|
||||||
console.error(error);
|
});
|
||||||
$('#loader').modal('hide');
|
|
||||||
}
|
|
||||||
).get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user