public ActionResult Agregarbodegal(string id) { Maqueta maqueta = db.Maqueta.Find(id); ViewBag.nompropucto = maqueta.Producto.NOMBRE; ViewBag.codpropucto = maqueta.Producto.CODIGO; ViewBag.cantidad = maqueta.CANTIDAD; ViewBag.observaciones = maqueta.OBSERVACION; ViewBag.stock = maqueta.Producto.STOCK; ViewBag.posiblescajas = maqueta.CANTIDAD / maqueta.Producto.UNIDADESXCAJA; var qry = from a in db.Detalle where (a.IDMAQUETA == id && a.TIPO == "STOCK") select a; List<Detalle> lista = new List<Detalle>(); lista = qry.ToList(); List<Facturaciones> Mostrar = new List<Facturaciones>(); for (int i = 0; i < lista.Count(); i++) { Facturaciones var = new Facturaciones(); var.FechA = lista[i].FECHA; var.OrigeN = lista[i].ORIGEN; var.CantidaD = lista[i].CANTIDAD; var.AcumuladO = lista[i].ACUMULADO; Mostrar.Add(var); } return View(Mostrar); }
private bool GenerarFacturacion() { string Reporte = "Listado para facturación"; string FileName = GetFileName(Reporte); if (CheckFile(FileName, Reporte)) { Facturaciones Facturaciones = new Facturaciones(); List <Facturacion> lstReporte = Facturaciones.Generar(semanaToReport); List <string> header = GetHeader(semanaToReport, "Listado para facturación"); string footer = lstReporte.Count.ToString() + " registros"; CreateExcelFile.CreateExcelDocument(lstReporte, Reporte, FileName, header.ToArray(), footer); return(true); } return(false); }