Skip to content

Commit

Permalink
Merge pull request #61 from corredato/gcred
Browse files Browse the repository at this point in the history
DANFE: gCred for cBenef
  • Loading branch information
antoniospneto authored Feb 26, 2025
2 parents 0d1892a + ead62af commit 5ed1d7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions brazilfiscalreport/danfe/danfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,12 @@ def _build_inf_ad_prod(self, prod, inf_ad_prod):
)

cbenef = extract_text(prod, "cBenef")
ccredpresumido = extract_text(prod, "cCredPresumido")

if cbenef:
add_infos.append(f"cBenef: {cbenef}")
if ccredpresumido:
add_infos.append(f"cCredPresumido: {ccredpresumido}")

if self.product_description_config.display_additional_info and inf_ad_prod:
add_infos.append(inf_ad_prod)
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/nfe_overload.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<cEAN>SEM GTIN</cEAN>
<xProd>Flipover</xProd>
<NCM>96100000</NCM>
<gCred>
<cCredPresumido>SC850065</cCredPresumido>
<pCredPresumido>3.0000</pCredPresumido>
<vCredPresumido>9.60</vCredPresumido>
</gCred>
<CFOP>5102</CFOP>
<uCom>UN</uCom>
<qCom>1.0000</qCom>
Expand Down Expand Up @@ -139,6 +144,7 @@
<cEAN>SEM GTIN</cEAN>
<xProd>Flipover</xProd>
<NCM>96100000</NCM>
<cBenef>SC830015</cBenef>
<CFOP>5102</CFOP>
<uCom>UN</uCom>
<qCom>1.0000</qCom>
Expand Down
Binary file modified tests/generated/danfe/danfe_duplicatas_only.pdf
Binary file not shown.
Binary file modified tests/generated/danfe/danfe_overload.pdf
Binary file not shown.

0 comments on commit 5ed1d7e

Please sign in to comment.