https://github.com/codesyntax/pytbai
pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.
https://github.com/codesyntax/pytbai
Last synced: about 1 year ago
JSON representation
pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.
- Host: GitHub
- URL: https://github.com/codesyntax/pytbai
- Owner: codesyntax
- License: mit
- Created: 2023-06-15T10:51:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T16:40:08.000Z (about 2 years ago)
- Last Synced: 2024-05-29T04:09:44.275Z (about 2 years ago)
- Language: Python
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-spain - pytbai - square&label=%E2%AD%90)](https://github.com/codesyntax/pytbai/stargazers) [](https://github.com/codesyntax/pytbai/commits/main) [](https://github.com/codesyntax/pytbai) [](https://github.com/codesyntax/pytbai/blob/main/LICENSE) [](https://www.batuz.eus/) - Crea, gestiona y envía facturas TicketBAI a las autoridades fiscales vascas en Python. (Facturación Electrónica / TicketBAI)
README



# pytbai
pytbai allows to create, manage and send TicketBai invoices to the Basque tax authorities.
## Usage
You need to configure your bussiness and software info in a JSON file:
```json
{
"subject": {
"entity_id": "99999974E",
"name": "BUSSINESS NAME"
},
"software": {
"license": "TBAIGIPRE00000000501",
"dev_entity": "P2000000F",
"soft_name": "TBAI",
"soft_version": "1.0"
}
}
```
Then create a invoice:
```python
from pytbai import TBai
from decimal import Decimal
tbai = TBai(json)
invoice = tbai.create_invoice("TB-2021-S", 1, "First invoice", "S")
invoice.create_line("First product", Decimal("1"), Decimal("200"), Decimal("20"))
invoice.create_line("Second product", Decimal("2"), Decimal("350"))
```
The `json` parameter is a previous JSON file you've created.
Finally sign and send the invoice:
```python
result = tbai.sign_and_send("/path_to_p12_certificate", "password")
```
You can also get the full structure of TBai invoice:
```python
json_structure = tbai.get_json(invoice)
```
## TODO
- [ ] Recipient data
- [ ] Multiple recipient data
- [ ] Third party / Recipient's invoices
- [ ] Corrective invoices
- [ ] Corrected or replaced invoices
- [ ] Tax free invoices
- [ ] Invoices without national counterparty
- [x] Chaining of previous invoice
## How to contribute
Please read the [Code of Conduct documentation](CODE_OF_CONDUCT.md) first, then all contributions are done via Pull Requests on GitHub but don´t hesitate to open a new issue.
## Credits
This project is made by [CodeSyntax](https://codesyntax.com).