feat: federal taxation settings UI, percentage_profile mode, and emission integration#80
Merged
vitormattos merged 21 commits intomainfrom Mar 31, 2026
Merged
Conversation
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…ement Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…oint Add validation and persistence for PIS/COFINS situacao tributaria, tipo retencao, base calculo, aliquotas, valores, IRRF, CSLL, CP, and tributos percentage profiles. Also persist tributacao_federal_mode radio selection (per_invoice_amounts | percentage_profile). Signed-off-by: Vitor Mattos <vitor@php.rio>
- federalPayloadValues now accepts invoiceAmount for mode-aware calculation - In percentage_profile mode: baseCalculo=invoiceAmount, valorPis and valorCofins calculated from stored aliquotas * invoiceAmount / 100 - Compute indicadorTributacao: 2 when any tributos_* percent setting is non-empty, otherwise 0 - Pass indicadorTributacao to DpsData in both emit() and reemit() Signed-off-by: Vitor Mattos <vitor@php.rio>
…isibility - Add PIS/COFINS situacao tributaria and tipo retencao selects - Add base calculo, aliquota and valor PIS/COFINS inputs - Add IRRF, CSLL, CP retention fields - Add tributacao_federal_mode radio (per_invoice_amounts/percentage_profile) - Add syncFederalMode() JS to toggle BC/valor fields vs tributos% rows - Add tributos percentage profile rows for Perfil padrao and Simples Nacional - Attach HTML ids to toggle targets Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…deral Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…emission Add tests for: - percentage_profile mode calculates valorPis and valorCofins from aliquotas x invoiceAmount and sets baseCalculo = invoiceAmount - indicadorTributacao is set to 2 when any tributos_* percent setting is non-empty, and 0 otherwise - Fix testCompanyServiceSelectionSupport to use source inspection instead of runtime check (Eloquent not available in module vendor) Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…ration Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
…outes Signed-off-by: Vitor Mattos <vitor@php.rio>
…rvice is unavailable When company service selection is supported but no default service is resolved, keep emission readiness by falling back to nfse.item_lista_servico and nfse.codigo_tributacao_nacional settings. Signed-off-by: Vitor Mattos <vitor@php.rio>
Update isolation test to assert fallback to nfse.codigo_tributacao_nacional when default service national tax code is missing. 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
Complete integration of federal taxation (tributação federal) into the NFS-e module settings and invoice emission.
Changes
Controllers
tributacao_federal_modesettingsper_invoice_amounts: use stored absolute amounts from settingspercentage_profile: calculatevBCPISCOFINS = invoiceAmount,vPISandvCOFINSfrom stored aliquotas × invoiceAmount / 100indicadorTributacao = 2when anytributos_*percent setting is non-empty (contributor-estimated), otherwise 0View
tributacao_federal_moderadio togglesyncFederalMode()JS: hides valor fields in percentage_profile mode and shows tributos% rows insteadTests (TDD)
E2E/Integration
.env.e2e.exampletemplate (real.env.e2eis gitignored)Related
Depends on: LibreCodeCoop/nfse-php#13 (DpsData and XmlBuilder federal fields)