Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Addressed review comment questioning whether IBS/CBS base calculation should check discount type before subtracting, similar to PIS/COFINS/ICMS implementations.

Analysis provided

  • Current implementation unconditionally subtracts discount on line 56
  • Existing tax calculations (CalculaBaseCalculoPis, CalculaBaseCalculoCofins, CalculaBaseCalculoIcms) check TipoDesconto before applying discount:
    • TipoDesconto.Incondicional: subtract from base
    • TipoDesconto.Condincional: add to base (skip subtraction)
  • Test suite only covers unconditional discounts for IBS/CBS
  • Tax reform documentation (NT 2025.002) doesn't specify conditional discount handling

Recommendation

Maintain consistency with existing tax calculation patterns by checking _tipoDesconto parameter before subtracting discount. Can be adjusted if reform-specific documentation emerges.

No code changes made pending approval from @robertorp.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Address feedback on discount details in tax reform implementation Respond to feedback on conditional discount handling in IBS/CBS calculation Nov 6, 2025
Copilot AI requested a review from robertorp November 6, 2025 17:06
@robertorp robertorp marked this pull request as ready for review November 6, 2025 17:09
@robertorp robertorp closed this Nov 6, 2025
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