falta que se actualize numProducto y los infomes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user