Skip to content

Ajusta tipos de célula e adiciona cálculos na planilha#44

Closed
albertomandlate wants to merge 2 commits intomainfrom
hotfix-preenchimento-campo-numero-excel
Closed

Ajusta tipos de célula e adiciona cálculos na planilha#44
albertomandlate wants to merge 2 commits intomainfrom
hotfix-preenchimento-campo-numero-excel

Conversation

@albertomandlate
Copy link
Copy Markdown
Contributor

Modifica o tipo de célula para várias colunas, assegurando que os dados sejam tratados corretamente como numéricos ou strings. Substitui linhas removidas por novas definições de tipo de célula. Adiciona cálculos para valores relacionados a impostos e totais, melhorando a precisão e clareza dos dados na planilha gerada.

Modifica o tipo de célula para várias colunas, assegurando que os dados sejam tratados corretamente como numéricos ou strings. Substitui linhas removidas por novas definições de tipo de célula. Adiciona cálculos para valores relacionados a impostos e totais, melhorando a precisão e clareza dos dados na planilha gerada.
@albertomandlate albertomandlate requested a review from Copilot June 20, 2025 07:53
@albertomandlate albertomandlate self-assigned this Jun 20, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR explicitly sets Excel cell types for various columns and integrates numeric calculations for tax, totals, and exchange rates to improve data accuracy in the generated spreadsheet.

  • Explicitly assigns CellType.Numeric or CellType.String when creating key cells.
  • Converts and populates numeric values for tax payable, net total, settlement amount, gross total, and payments.
  • Introduces a new cell (23) intended for tax percentage, plus formatted currency code and exchange rate cells.
Comments suppressed due to low confidence (1)

src/SAF-T.Mozambique/Generators/MozambiqueSaftGenerator.cs:344

  • [nitpick] The new cell for tax percentage (cell 23) and its associated calculation aren’t covered by existing tests; consider adding unit or integration tests to verify its value and numeric formatting.
                    row.CreateCell(23).SetCellType(CellType.Numeric);

row.CreateCell(27).SetCellValue(Convert.ToDouble(factura.DocumentTotals?.GrossTotal ?? 0m));
row.CreateCell(28).SetCellValue(auditFile.Header?.CurrencyCode ?? string.Empty);
row.CreateCell(29).SetCellValue(taxaCambio);
row.CreateCell(23).SetCellType(CellType.Numeric);
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cell 23 is set to numeric type but no value is assigned. You likely intended to call SetCellValue here using the computed 'impostos' variable.

Copilot uses AI. Check for mistakes.
Comment thread src/SAF-T.Mozambique/Generators/MozambiqueSaftGenerator.cs Outdated
Muito bem observado

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@albertomandlate
Copy link
Copy Markdown
Contributor Author

Necessita de mais algumas modificações relaccionadas ao tipo de campo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants