Skip to main content

Calculate BR taxes from NF total value, and calculate the original value of a NF from a received payment

Project description

br-regras-fiscais

A lib to calculate taxes on Brasil for NFe, and also get total NFe value from a payment.

It takes in account if Imposto de Renda is less than R$ 10,00, and same for CRF (PIS, COFINS,CSLL)

Installation

br-regras-fiscais can be installed via pypi.

pip install br-regras-fiscais

Usage

original_nota_value

Using the paid valued from a Transaction it returns the original total value of a NF

>>> from br_regras_fiscais.taxes_calc import original_nota_value
>>> original_nota_value(1000)
Decimal('1065.53')

tax_dict

Returns a Data Class with the taxes values:

@dataclass
class TaxesValues:
    cofins: Decimal
    csll: Decimal
    ir: Decimal
    pis: Decimal

    @property
    def sum_crf(self) -> Decimal:
        return self.pis + self.csll + self.cofins
>>> from br_regras_fiscais.taxes_calc import tax_dict
>>> tax_dict(1000)
TaxesValues(cofins=Decimal('30.00'), csll=Decimal('10.00'), ir=Decimal('15.00'), pis=Decimal('6.50'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

br_regras_fiscais-0.2.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

br_regras_fiscais-0.2.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file br_regras_fiscais-0.2.0.tar.gz.

File metadata

  • Download URL: br_regras_fiscais-0.2.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for br_regras_fiscais-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f537fb2b2f6ae16b730601e19f801a7cac61a963b78aa0bc0603e24dbdc22423
MD5 64736661d8efe617ba212d726da028b2
BLAKE2b-256 937b1aa023b075a80e8a8b83020b8ab8652a612f06d930ab6f39748354a1c041

See more details on using hashes here.

Provenance

The following attestation bundles were made for br_regras_fiscais-0.2.0.tar.gz:

Publisher: deploy.yml on admdocbr/br-regras-fiscais

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file br_regras_fiscais-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for br_regras_fiscais-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acb082ad277be128425e141debb9bd9ee7830a473f78dd5928e56a7338e529fa
MD5 c8d4fb8f7bed10b0a32c2482d2606b13
BLAKE2b-256 3fc5645077dafdcc3c414bef329fda75141b9b2a824d97938acd425d3d813446

See more details on using hashes here.

Provenance

The following attestation bundles were made for br_regras_fiscais-0.2.0-py3-none-any.whl:

Publisher: deploy.yml on admdocbr/br-regras-fiscais

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page