Commit 3ac31d3
authored
feat: federal taxation settings UI, percentage_profile mode, and emission integration (#80)
* feat(db): add codigo_tributacao_nacional column to nfse_company_services
Signed-off-by: Vitor Mattos <vitor@php.rio>
* feat(routes): register company services CRUD and settings federal routes
Signed-off-by: Vitor Mattos <vitor@php.rio>
* feat(controller): add CompanyServiceController for service CRUD management
Signed-off-by: Vitor Mattos <vitor@php.rio>
* feat(i18n): add pt-BR labels for federal taxation settings fields
Signed-off-by: Vitor Mattos <vitor@php.rio>
* feat(i18n): add en-GB labels for federal taxation settings fields
Signed-off-by: Vitor Mattos <vitor@php.rio>
* feat(settings): persist federal taxation fields in updateFederal endpoint
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>
* feat(invoice): integrate federal taxation mode into DPS emission
- 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>
* feat(settings-view): add federal taxation tab with mode-conditional visibility
- 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>
* feat(invoices-view): update pending invoices view
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(settings): cover federal taxation fields persistence in updateFederal
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(view): cover federal taxation tab field ids and inputs
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(invoice): cover percentage_profile mode and indicadorTributacao 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>
* test(routes): cover company service CRUD route registration
Signed-off-by: Vitor Mattos <vitor@php.rio>
* chore(gitignore): exclude .env.e2e from version control
Signed-off-by: Vitor Mattos <vitor@php.rio>
* chore(e2e): add .env.e2e.example template for end-to-end test configuration
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(e2e): add Playwright auth helper for NFS-e E2E tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(e2e): add Playwright settings spec for NFS-e federal taxation tab
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(e2e): add Playwright emission spec for NFS-e invoice emission flow
Signed-off-by: Vitor Mattos <vitor@php.rio>
* test(integration): update nfse_endpoints Behat feature with federal routes
Signed-off-by: Vitor Mattos <vitor@php.rio>
* fix(invoice): fallback item lista service to settings when default service 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>
* test(invoice): align national tax code fallback expectation
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>
---------
Signed-off-by: Vitor Mattos <vitor@php.rio>1 parent d286dc7 commit 3ac31d3
19 files changed
Lines changed: 1362 additions & 173 deletions
File tree
- Database/Migrations
- Http/Controllers
- Resources
- lang
- en-GB
- pt-BR
- views
- invoices
- settings
- Routes
- e2e
- support
- tests
- Unit
- Http/Controllers
- Views
- integration/features
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 122 | | |
127 | 123 | | |
128 | 124 | | |
| |||
244 | 240 | | |
245 | 241 | | |
246 | 242 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | 243 | | |
261 | 244 | | |
0 commit comments