feat: taxation settings UX, regime-aware tributos profile, IBGE fallback and municipality fixes#86
Merged
vitormattos merged 11 commits intomainfrom Apr 1, 2026
Merged
Conversation
…centage hints Signed-off-by: Vitor Mattos <vitor@php.rio>
…icas de percentual Signed-off-by: Vitor Mattos <vitor@php.rio>
…t fields, add BrasilAPI fallback Signed-off-by: Vitor Mattos <vitor@php.rio>
…rage Signed-off-by: Vitor Mattos <vitor@php.rio>
…, emit totalTributosPercentual Signed-off-by: Vitor Mattos <vitor@php.rio>
…overage Signed-off-by: Vitor Mattos <vitor@php.rio>
…d municipality IBGE reset on UF change Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…XML field assertions Signed-off-by: Vitor Mattos <vitor@php.rio>
cc03902 to
a2b3de9
Compare
…tion behavior Signed-off-by: Vitor Mattos <vitor@php.rio>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR consolidates multiple rounds of improvements to the NFS-e taxation settings and emission flow:
Taxation Settings Simplification
tributacao_federal_moderadio group —percentage_profilemode is now fixed/enforced via hidden inputbase_calculo,valor_pis,valor_cofins) from validation and persistence; purge them from existing settings on savepiscofins_base_calculostring key topiscofins_preview_note(computed note, not user input)BrasilAPIas IBGE fallback for the municipalities endpoint; return graceful 200 with empty data instead of 502 when both sources failRegime-aware Tributos Profile
opcao_simples_nacionalat emission time: usetributos_fed/est/mun_snkeys when the company is a Simples Nacional optant; usetributos_fed/est/mun_pkeys otherwisetotalTributosPercentualFederal/Estadual/Municipalfields into DpsData (requires nfse-php companion PR)company_id()call inresolveCompanyId()with try/catch to prevent broken test environment failures fromCompany::getCurrent()opcao_simples_nacionalsettingMunicipality UF → IBGE Reset (front-end fix)
loadMunicipalities()now clears bothibgeHiddenandibgeDisplaybefore fetching so stale IBGE codes from the previous UF are never submittedTests & E2E
SettingsControllerTest: add municipality fallback + graceful failure pathsInvoiceControllerTest: cover regime-aware profile selection and XML element orderingOperationalViewsExistenceTest: extend view existence assertionsnfse-settings.spec.ts: add E2E for municipality IBGE reset when UF changesnfse-emission.spec.ts: extend emission flow specs with tributos and XML field assertionsPackage dependency
totalTributosPercentualfields inDpsDataand theXmlBuilderelement ordering fix are in companion PR: feat: fix XML element ordering and add totalTributosPercentual fields nfse-php#14