Carry forward Valor da NF in controle recebidos

This commit is contained in:
Eduardo Lopes 2026-01-28 11:57:02 -03:00
parent 7ebd4588b0
commit 9424ddfeb3
1 changed files with 10 additions and 0 deletions

View File

@ -1481,6 +1481,7 @@ namespace line_gestao_api.Controllers
var firstRow = ws.FirstRowUsed()?.RowNumber() ?? 1;
var lastRow = ws.LastRowUsed()?.RowNumber() ?? firstRow;
var rowIndex = firstRow;
decimal? lastValorDaNf = null;
while (rowIndex <= lastRow)
{
@ -1503,6 +1504,7 @@ namespace line_gestao_api.Controllers
&& GetColAny(map, "CHIP") == 0
&& GetColAny(map, "SERIAL") == 0;
lastValorDaNf = null;
rowIndex++;
for (; rowIndex <= lastRow; rowIndex++)
@ -1524,6 +1526,14 @@ namespace line_gestao_api.Controllers
var numeroLinha = NullIfEmptyDigits(GetCellByHeaderAny(ws, rowIndex, map, "NÚMERO DA LINHA", "NUMERO DA LINHA"));
var valorUnit = TryDecimal(GetCellByHeaderAny(ws, rowIndex, map, "VALOR UNIT.", "VALOR UNIT", "VALOR UNITÁRIO", "VALOR UNITARIO"));
var valorDaNf = TryDecimal(GetCellByHeaderAny(ws, rowIndex, map, "VALOR DA NF", "VALOR DA N F"));
if (valorDaNf.HasValue)
{
lastValorDaNf = valorDaNf;
}
else
{
valorDaNf = lastValorDaNf;
}
var dataDaNf = TryDate(ws, rowIndex, map, "DATA DA NF");
var dataReceb = TryDate(ws, rowIndex, map, "DATA DO RECEBIMENTO");
var qtd = TryNullableInt(GetCellByHeaderAny(ws, rowIndex, map, "QTD.", "QTD", "QUANTIDADE"));