mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
botones albaran finalizado
This commit is contained in:
@ -471,6 +471,83 @@ class AlbaranComponent {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#add_iva_albaran_' + this.id).on('click', (e) => {
|
||||
|
||||
e.preventDefault();
|
||||
const albaranId = this.id;
|
||||
const url = `/albaranes/addIvaAlbaran`;
|
||||
const data = { albaranId: albaranId };
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: (response) => {
|
||||
if (response.success) {
|
||||
this.table.ajax.reload(null, false);
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error',
|
||||
text: 'No se ha podido añadir el IVA al albarán',
|
||||
icon: 'error',
|
||||
showCancelButton: false,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Ok',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#nueva_linea_albaran_' + this.id).on('click', (e) => {
|
||||
|
||||
e.preventDefault();
|
||||
const albaranId = this.id;
|
||||
const url = `/albaranes/nuevaLineaAlbaran`;
|
||||
const data = { albaranId: albaranId };
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: (response) => {
|
||||
if (response.success) {
|
||||
this.table.ajax.reload(null, false);
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error',
|
||||
text: 'No se ha podido añadir la línea al albarán',
|
||||
icon: 'error',
|
||||
showCancelButton: false,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Ok',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#imprimir_albaran_' + this.id).on('click', (e) => {
|
||||
|
||||
var albaran_id = this.id;
|
||||
window.open('/print-albaran/generar/'+ albaran_id , '_blank');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
_initAutoNumericInputs() {
|
||||
|
||||
Reference in New Issue
Block a user