falta boton borrar albaranes!

This commit is contained in:
2025-04-26 14:16:32 +02:00
parent 96bd24ae8b
commit 25b6d14423
7 changed files with 141 additions and 3 deletions

View File

@ -1,14 +1,17 @@
import DatePicker from "./datepicker.js";
class AlbaranComponent {
constructor(item) {
constructor(item, url_after_delete = '') {
this.url_after_delete = url_after_delete;
this.item = item;
this.id = item.id;
this.numero = item.numero_albaran;
this.cliente = item.cliente;
this.att = item.att;
this.direccion = item.direccion;
this.envio_id = item.envio_id;
this.envio_id = item.envio_id != null ? item.envio_id : '';
this.fecha = null;
if(this.item.fecha_albaran != null){
const [dia, mes, anio] = item.fecha_albaran.split('/');
@ -461,6 +464,9 @@ class AlbaranComponent {
if (response.success) {
// quitar del dom el albarán
$(`#accordioAlbaran${albaranId}`).remove();
if(this.url_after_delete != ''){
window.location.href = this.url_after_delete;
}
} else {
Swal.fire({
title: 'Error',