al crear el reporte semanal se tomaba de la aduana y patente de las celdas A2 y B2 para buscar el trafico, ahora se toman del renglon que se está leyendo ya que puede haber más de una aduana y patente en el archivo

bugfix/fix_reporte_semanal_newell
Felix Morales 7 months ago
parent a439e3ac55
commit 08e7c8f5ec
  1. 6
      Services/Reportes/Newell/Semanal/ReporteSemanalService.cs

@ -36,8 +36,8 @@ namespace CORRESPONSALBackend.Services.Reportes.Newell.Semanal{
var start = worksheet.Dimension.Start;
var end = worksheet.Dimension.End;
int initialRow = start.Row+1;
var aduana = worksheet.Cells[$"A2"].Value.ToString();
var patente = worksheet.Cells[$"B2"].Value.ToString();
/* var aduana = worksheet.Cells[$"A2"].Value.ToString();
var patente = worksheet.Cells[$"B2"].Value.ToString(); */
worksheet.Cells[$"S1"].Value = "Referencia";
worksheet.Cells[$"T1"].Value = "Contenedor";
worksheet.Cells[$"U1"].Value = "Cuenta de Gastos";
@ -46,6 +46,8 @@ namespace CORRESPONSALBackend.Services.Reportes.Newell.Semanal{
for (int currentRow = initialRow; currentRow <= end.Row; currentRow++)// Recorrer renglon por renglon
{
if(!string.IsNullOrWhiteSpace(worksheet.Cells[$"C{currentRow}"].Value?.ToString()) && !string.IsNullOrEmpty(worksheet.Cells[$"C{currentRow}"].Value?.ToString())){
var aduana = worksheet.Cells[$"A{currentRow}"].Value.ToString();
var patente = worksheet.Cells[$"B{currentRow}"].Value.ToString();
var pedimento = worksheet.Cells[$"C{currentRow}"].Value.ToString();
var dto = await _traficosRepository.GetByPedimento(int.Parse(pedimento), int.Parse(aduana), int.Parse(patente));
worksheet.Cells[$"S{currentRow}"].Value = dto.GC;

Loading…
Cancel
Save