falta que se actualize numProducto y los infomes

This commit is contained in:
2024-08-11 18:26:09 -03:00
parent cff13f1e47
commit 4262d66025
42 changed files with 724 additions and 471 deletions

View File

@@ -80,5 +80,29 @@ namespace Modelo
return ret;
}
public bool DisminuirStock(DetalleFactura detalleFactura)
{
bool ret = false;
while (detalleFactura.Cantidad >= 0)
{
var elementoAdisminuir = almacen.Where(x=> x.Habilitado == true)
.First(x => x.Producto.Id == detalleFactura.Producto.Id);
detalleFactura.Cantidad -= elementoAdisminuir.Cantidad;
if (detalleFactura.Cantidad > 0)
{
elementoAdisminuir.Cantidad = 0;
elementoAdisminuir.Habilitado = false;
}
else
{
elementoAdisminuir.Cantidad = -detalleFactura.Cantidad;
ret = true;
}
}
return ret;
}
}
}

View File

@@ -68,5 +68,20 @@ namespace Modelo
{
return orden.MostrarDetalles();
}
public bool MarcarEntregado(OrdenDeCompra orden)
{
bool ret = false;
if (orden == null) return ret;
if (orden.Id < 0) return ret;
if (orden.Entregado == false) return ret;
var ordenAModificar = almacen.FindIndex(x => x.Id == orden.Id);
if (ordenAModificar > -1)
{
almacen[ordenAModificar].Entregado = true;
ret = true;
}
return ret;
}
}
}

View File

@@ -47,7 +47,7 @@ namespace Modelo
return ret;
}
override public bool Del(Remito t)
{
@@ -70,10 +70,5 @@ namespace Modelo
return ret;
}
public ReadOnlyCollection<Lote> MostrarLotes(Remito remito)
{
return remito.MostrarLotes();
}
}
}