diff --git a/Services/Reportes/Alen/ReportesAlenService.cs b/Services/Reportes/Alen/ReportesAlenService.cs index fa5225d..0dba41b 100644 --- a/Services/Reportes/Alen/ReportesAlenService.cs +++ b/Services/Reportes/Alen/ReportesAlenService.cs @@ -19,45 +19,49 @@ namespace CORRESPONSALBackend.Services.Reportes.Alen{ ExcelPackage.LicenseContext = LicenseContext.NonCommercial; using (ExcelPackage excelPackage = new ExcelPackage()){ var worksheet = excelPackage.Workbook.Worksheets.Add("sheet1"); - worksheet.Cells["A1"].Value = "Numero de Factura"; - worksheet.Cells["B1"].Value = "Folio Fiscal"; - worksheet.Cells["C1"].Value = "Fecha de Factura"; - worksheet.Cells["D1"].Value = "Numero de COVE"; - worksheet.Cells["E1"].Value = "Valor Factura"; - worksheet.Cells["F1"].Value = "Entrega"; - worksheet.Cells["G1"].Value = "Transporte"; - worksheet.Cells["H1"].Value = "Pedimento"; - worksheet.Cells["I1"].Value = "Fecha-Hora Cruce"; - worksheet.Cells["J1"].Value = "Fecha Cuenta Corresponsal"; - worksheet.Cells["K1"].Value = "Honorarios"; - worksheet.Cells["L1"].Value = "Maniobras"; - worksheet.Cells["M1"].Value = "Validacion"; - worksheet.Cells["N1"].Value = "Prevalidacion"; - worksheet.Cells["O1"].Value = "IVA"; - worksheet.Cells["P1"].Value = "Total M.N. por Operacion"; + worksheet.Cells["A1"].Value = "Numero de Remesa"; + worksheet.Cells["B1"].Value = "Numero de Factura"; + worksheet.Cells["C1"].Value = "Folio Fiscal"; + worksheet.Cells["D1"].Value = "Fecha de Factura"; + worksheet.Cells["E1"].Value = "Numero de COVE"; + worksheet.Cells["F1"].Value = "Valor Factura"; + worksheet.Cells["G1"].Value = "Entrega"; + worksheet.Cells["H1"].Value = "Transporte"; + worksheet.Cells["I1"].Value = "Pedimento"; + worksheet.Cells["J1"].Value = "Fecha-Hora Cruce"; + worksheet.Cells["K1"].Value = "Fecha Cuenta Corresponsal"; + worksheet.Cells["L1"].Value = "Honorarios"; + worksheet.Cells["M1"].Value = "Maniobras"; + worksheet.Cells["N1"].Value = "Validacion"; + worksheet.Cells["O1"].Value = "Contraprestacion"; + worksheet.Cells["P1"].Value = "Prevalidacion"; + worksheet.Cells["Q1"].Value = "IVA"; + worksheet.Cells["R1"].Value = "Total M.N. por Operacion"; int currentRow = 2; foreach(var factura in facturas){ var fechaCruce = factura.IdContenedor != null && factura.IdContenedor != 0 ? contenedores.FirstOrDefault(x => x.id == factura.IdContenedor).FSemaforo : ""; - worksheet.Cells[$"A{currentRow}"].Value = factura.Factura; - worksheet.Cells[$"B{currentRow}"].Value = factura.UUID; - worksheet.Cells[$"C{currentRow}"].Value = factura.FechaFactura; - worksheet.Cells[$"D{currentRow}"].Value = factura.COVE; - worksheet.Cells[$"E{currentRow}"].Value = factura.ValorFacturaDls; - worksheet.Cells[$"F{currentRow}"].Value = factura.Entrega; - worksheet.Cells[$"G{currentRow}"].Value = factura.Transporte; - worksheet.Cells[$"H{currentRow}"].Value = trafico.Pedimento; - worksheet.Cells[$"I{currentRow}"].Value = fechaCruce; - worksheet.Cells[$"J{currentRow}"].Value = trafico.FechaCuenta; - worksheet.Cells[$"K{currentRow}"].Value = "$0.00"; + worksheet.Cells[$"A{currentRow}"].Value = $"{trafico.FolioGemco}-{currentRow-1}"; + worksheet.Cells[$"B{currentRow}"].Value = factura.Factura; + worksheet.Cells[$"C{currentRow}"].Value = factura.UUID; + worksheet.Cells[$"D{currentRow}"].Value = factura.FechaFactura; + worksheet.Cells[$"E{currentRow}"].Value = factura.COVE; + worksheet.Cells[$"F{currentRow}"].Value = factura.ValorFacturaDls; + worksheet.Cells[$"G{currentRow}"].Value = factura.Entrega; + worksheet.Cells[$"H{currentRow}"].Value = factura.Transporte; + worksheet.Cells[$"I{currentRow}"].Value = trafico.Pedimento; + worksheet.Cells[$"J{currentRow}"].Value = fechaCruce; + worksheet.Cells[$"K{currentRow}"].Value = trafico.FechaCuenta; worksheet.Cells[$"L{currentRow}"].Value = "$0.00"; worksheet.Cells[$"M{currentRow}"].Value = "$0.00"; worksheet.Cells[$"N{currentRow}"].Value = "$0.00"; worksheet.Cells[$"O{currentRow}"].Value = "$0.00"; worksheet.Cells[$"P{currentRow}"].Value = "$0.00"; + worksheet.Cells[$"Q{currentRow}"].Value = "$0.00"; + worksheet.Cells[$"R{currentRow}"].Value = "$0.00"; currentRow++; } //Se crea la tabla en el rango de celdas donde se mostrara la inforamcion. - ExcelRange range = worksheet.Cells[1, 1,facturas.Count() + 1, 16]; + ExcelRange range = worksheet.Cells[1, 1,facturas.Count() + 1, 18]; ExcelTable tab = worksheet.Tables.Add(range, "Table1"); tab.TableStyle = TableStyles.Light1; worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();