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