diff --git a/src/Danfse/DanfseTemplate.php b/src/Danfse/DanfseTemplate.php index eaf033d..aac8690 100644 --- a/src/Danfse/DanfseTemplate.php +++ b/src/Danfse/DanfseTemplate.php @@ -169,7 +169,7 @@ public function buildData(array $nfse): array 'tributacao_federal' => [ 'irrf' => $this->currencyOrDash($this->val($tribFed, 'vRetIRRF')), 'cp' => $this->currencyOrDash($this->val($tribFed, 'vRetCP')), - 'contribuicoes_sociais' => $this->currencyOrDash($this->val($tribFed, 'vRetCSLL')), + 'csll' => $this->currencyOrDash($this->val($tribFed, 'vRetCSLL')), 'pis' => $this->currencyOrDash($this->val($tribFed, 'piscofins', 'vPis')), 'cofins' => $this->currencyOrDash($this->val($tribFed, 'piscofins', 'vCofins')), 'descricao_retencao' => $this->pisCofinsRetentionLabel( diff --git a/src/Danfse/HTMLTemplate.php b/src/Danfse/HTMLTemplate.php index 35e531f..b0cf30e 100644 --- a/src/Danfse/HTMLTemplate.php +++ b/src/Danfse/HTMLTemplate.php @@ -483,8 +483,8 @@ - Contribuições Sociais - Retidas - + CSLL - Retida + @@ -498,7 +498,7 @@ - Descrição Contrib. Sociais - Retidas + Tipo de retenção PIS/COFINS/CSLL diff --git a/src/Dto/DpsData.php b/src/Dto/DpsData.php index ea4ab4b..a2b21e9 100644 --- a/src/Dto/DpsData.php +++ b/src/Dto/DpsData.php @@ -176,7 +176,7 @@ public function __construct( /** Valor do IRRF. */ public string $federalValorIrrf = '', - /** Valor das contribuições sociais retidas (CSLL). */ + /** Valor da CSLL retida. */ public string $federalValorCsll = '', /** Valor da contribuição previdenciária retida. */ diff --git a/tests/Unit/Danfse/DanfseGoldenReferenceTest.php b/tests/Unit/Danfse/DanfseGoldenReferenceTest.php index 4cccbf0..6cb7b5c 100644 --- a/tests/Unit/Danfse/DanfseGoldenReferenceTest.php +++ b/tests/Unit/Danfse/DanfseGoldenReferenceTest.php @@ -120,23 +120,23 @@ public function testAuthorizedXmlWithoutIbsCbsStillRendersRequiredV2Section(): v self::assertStringContainsString('DANFSe v2.0', $html); } - public function testFederalRetentionUsesOfficialV2Semantics(): void + public function testFederalRetentionKeepsCsllSeparateFromPisAndCofins(): void { $nfse = $this->fixtureData(); $nfse['infNFSe']['DPS']['infDPS']['valores']['trib']['tribFed']['piscofins']['tpRetPisCofins'] = '4'; - $nfse['infNFSe']['DPS']['infDPS']['valores']['trib']['tribFed']['vRetCSLL'] = '1149.75'; + unset($nfse['infNFSe']['DPS']['infDPS']['valores']['trib']['tribFed']['vRetCSLL']); $template = new DanfseTemplate(); $data = $template->buildData($nfse); $html = $template->render($nfse, new DanfseConfig()); - self::assertSame('R$ 1.149,75', $data['tributacao_federal']['contribuicoes_sociais']); + self::assertSame('-', $data['tributacao_federal']['csll']); self::assertSame( '4 - PIS/COFINS Retidos, CSLL Não Retido', $data['tributacao_federal']['descricao_retencao'], ); - self::assertStringContainsString('Contribuições Sociais - Retidas', $html); - self::assertStringContainsString('Descrição Contrib. Sociais - Retidas', $html); + self::assertStringContainsString('CSLL - Retida', $html); + self::assertStringContainsString('Tipo de retenção PIS/COFINS/CSLL', $html); } public function testHomologationReferenceCarriesVisibleMarker(): void