Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SAF-T.Mozambique/Models/FicheiroSAFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ public record class DocumentoFacturacaoArtigo
public decimal Quantidade { get; init; }
public decimal PrecoTotalComImpostos { get; init; }
public decimal ValorDesconto { get; init; }
public decimal PercentagemDesconto { get => ValorDesconto / PrecoTotalComImpostos * 100; }
public decimal PercentagemDesconto { get => PrecoTotalComImpostos == 0m ? 0m : ValorDesconto / PrecoTotalComImpostos * 100; }
public decimal ValorImpostos { get => Artigo.Impostos.Sum(i => i.Valor + (PrecoTotalComImpostos / (1m + i.Percentagem * 0.01m) * i.Percentagem * 0.01m)); }
public decimal PrecoTotalSemImpostos { get => PrecoTotalComImpostos - ValorImpostos; }
public decimal PrecoUnitarioComImpostos { get => (PrecoTotalComImpostos + ValorDesconto) / Quantidade; }
public decimal PrecoUnitarioSemImpostos { get => PrecoUnitarioComImpostos - (ValorImpostos / Quantidade); }
public decimal PrecoUnitarioComImpostos { get => Quantidade == 0m ? 0m : (PrecoTotalComImpostos + ValorDesconto) / Quantidade; }
public decimal PrecoUnitarioSemImpostos { get => Quantidade == 0m ? 0m : PrecoUnitarioComImpostos - (ValorImpostos / Quantidade); }
Comment thread
albertomandlate marked this conversation as resolved.

}

Expand Down
Loading