================
InvoiceGenerator
================
.. image:: https://travis-ci.org/by-cx/InvoiceGenerator.svg?branch=master
:target: https://travis-ci.org/by-cx/InvoiceGenerator
.. image:: https://img.shields.io/pypi/v/InvoiceGenerator.svg
:target: https://pypi.python.org/pypi/InvoiceGenerator/
:alt: Latest Version
This is library to generate a simple invoices.
Currently supported formats are PDF and XML for Pohoda accounting system.
PDF invoice is based on ReportLab.
Installation
============
Run this command as root::
pip install InvoiceGenerator
If you want upgrade to new version, add ``--upgrade`` flag::
pip install InvoiceGenerator --upgrade
You can use setup.py from GitHub repository too::
python setup.py install
Documentation
-------------
Complete documentation is available on
`Read The Docs <http://readthedocs.org/docs/InvoiceGenerator/>`_.
Example
=======
Basic API
---------
Define invoice data first::
import os
from tempfile import NamedTemporaryFile
from InvoiceGenerator.api import Invoice, Item, Client, Provider, Creator
# choose english as language
os.environ["INVOICE_LANG"] = "en"
client = Client('Client company')
provider = Provider('My company', bank_account='2600420569', bank_code='2010')
creator = Creator('John Doe')
invoice = Invoice(client, provider, creator)
invoice.currency_locale = 'en_US.UTF-8'
invoice.add_item(Item(32, 600, description="Item 1"))
invoice.add_item(Item(60, 50, description="Item 2", tax=21))
invoice.add_item(Item(50, 60, description="Item 3", tax=0))
invoice.add_item(Item(5, 600, description="Item 4", tax=15))
Note: Due to Python's representational error, write numbers as integer ``tax=10``,
Decimal ``tax=Decimal('10.1')`` or string ``tax='1.2'`` to avoid getting results with
lot of decimal places.
PDF
---
Generate PDF invoice file::
from InvoiceGenerator.pdf import SimpleInvoice
pdf = SimpleInvoice(invoice)
pdf.gen("invoice.pdf", generate_qr_code=True)
Pohoda XML
----------
Generate XML invoice file::
from InvoiceGenerator.pohoda import SimpleInvoice
pdf = SimpleInvoice(invoice)
pdf.gen("invoice.xml")
Note: Pohoda uses three tax rates: none: 0%, low: 15%, high: 21%.
If any item doesn't meet those percentage, the rateVat parameter will
not be set for those items resulting in 0% tax rate.
Only SimpleInvoice is currently supported for Pohoda XML format.
Hacking
=======
Fork the `repository on github <https://github.com/creckx/InvoiceGenerator>`_ and
write code. Make sure to add tests covering your code under `/tests/`. You can
run tests using::
python setup.py test
Then propose your patch via a pull request.
Documentation is generated from `doc/source/` using `Sphinx
<http://sphinx-doc.org/>`_::
python setup.py build_sphinx
Then head to `doc/build/html/index.html`.
History
=======
1.1.0 - 2020-04-24
------------------
- Fix QR code on invoice
- Drop Python 2 support
- Add pt_BR translation
- Add support for transparent PNGs
1.0.0 - 2018-05-17
------------------
- Add support for Pohoda XML format
- Added much more complex documentation
- Parameter ``Address.zip`` was renamed to ``Address.zip_code``
- Add parameters ``division`` and ``country`` to the ``Address``
- Added parameter ``Address.bank_code``
If present, the bank code will be written after dash to
the account number, otherwise whole
``Address.bank_account`` will be used
- Address are rendered to fit the area on the PDF invoice
- Code style fixes
- Fixes for rounding: usage of ``decimal.Decimal`` and
added parameter ``Invoice.rounding_strategy``
- Fix for QR code
- Allow to set line width in ``SimpleInvoice``
0.5.4 - 2017-03-22
------------------
- Fix locale in build package
0.5.3 - 2017-01-09
------------------
- Use Babel for currency formating; fix and improve tests
0.5.2 - 2014-12-04
------------------
- Stop mentionning python2.6 support
- Make invoice.variable_symbol optional
0.5.1 - 2014-10-28
------------------
- Fix conf relative import
- Use python native function splitlines for notes
0.5.0 - 2014-09-21
------------------
- Add property number to object Invoice
- Replaced variable symbol for invoice number in invoice header
- Update Czech translations
0.4.9 - 2014-07-3
-----------------
- Bug fix previous commit
0.4.8 - 2014-07-3
-----------------
- Create proforma invoice
0.4.7 - 2014-07-1
-----------------
- Change date format for qr code generator
- Disable converting datetime to string on Invoice
- Disable rendering empty values
0.4.6 - 2014-05-14
------------------
- The displayed number of pages only when there is more than one
- Rename Date to Date of exposure
- Use pillow instead of PIL
0.4.5 - 2014-04-21
------------------
- Support for multipage items printout
- Support for multiline item description
- Use locale to print currency strings and values
- Adding logo to provider header
No notes on earlier releases.
Contributors
============
- Adam Strauch (@creckx)
- Martin Voldrich (@rbas)
- Petr Dlouhy (@PetrDlouhy)
- Antoine Musso (@hashar)
Raw data
{
"_id": null,
"home_page": "https://github.com/creckx/InvoiceGenerator",
"name": "generateur-facture",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "invoice invoices generator",
"author": "Quentin DAVIN",
"author_email": "quentin@rezonia.fr",
"download_url": "https://files.pythonhosted.org/packages/5e/0b/a63e626cbeca4f469e7c79c6ce58c7916e8e750904ca287599736cabd945/generateur_facture-1.0.2.tar.gz",
"platform": null,
"description": "================\r\nInvoiceGenerator\r\n================\r\n.. image:: https://travis-ci.org/by-cx/InvoiceGenerator.svg?branch=master\r\n :target: https://travis-ci.org/by-cx/InvoiceGenerator\r\n \r\n.. image:: https://img.shields.io/pypi/v/InvoiceGenerator.svg\r\n :target: https://pypi.python.org/pypi/InvoiceGenerator/\r\n :alt: Latest Version\r\n\r\nThis is library to generate a simple invoices.\r\nCurrently supported formats are PDF and XML for Pohoda accounting system.\r\nPDF invoice is based on ReportLab.\r\n\r\nInstallation\r\n============\r\n\r\nRun this command as root::\r\n\r\n\tpip install InvoiceGenerator\r\n\r\nIf you want upgrade to new version, add ``--upgrade`` flag::\r\n\r\n\tpip install InvoiceGenerator --upgrade\r\n\r\nYou can use setup.py from GitHub repository too::\r\n\r\n\tpython setup.py install\r\n\r\n\r\nDocumentation\r\n-------------\r\n\r\nComplete documentation is available on\r\n`Read The Docs <http://readthedocs.org/docs/InvoiceGenerator/>`_.\r\n\r\n\r\nExample\r\n=======\r\n\r\nBasic API\r\n---------\r\n\r\nDefine invoice data first::\r\n\r\n\timport os\r\n\r\n\tfrom tempfile import NamedTemporaryFile\r\n\r\n\tfrom InvoiceGenerator.api import Invoice, Item, Client, Provider, Creator\r\n\r\n\t# choose english as language\r\n\tos.environ[\"INVOICE_LANG\"] = \"en\"\r\n\r\n\tclient = Client('Client company')\r\n\tprovider = Provider('My company', bank_account='2600420569', bank_code='2010')\r\n\tcreator = Creator('John Doe')\r\n\r\n\tinvoice = Invoice(client, provider, creator)\r\n\tinvoice.currency_locale = 'en_US.UTF-8'\r\n\tinvoice.add_item(Item(32, 600, description=\"Item 1\"))\r\n\tinvoice.add_item(Item(60, 50, description=\"Item 2\", tax=21))\r\n\tinvoice.add_item(Item(50, 60, description=\"Item 3\", tax=0))\r\n\tinvoice.add_item(Item(5, 600, description=\"Item 4\", tax=15))\r\n\r\nNote: Due to Python's representational error, write numbers as integer ``tax=10``,\r\nDecimal ``tax=Decimal('10.1')`` or string ``tax='1.2'`` to avoid getting results with\r\nlot of decimal places.\r\n\r\nPDF\r\n---\r\n\r\nGenerate PDF invoice file::\r\n\r\n\tfrom InvoiceGenerator.pdf import SimpleInvoice\r\n\r\n\tpdf = SimpleInvoice(invoice)\r\n\tpdf.gen(\"invoice.pdf\", generate_qr_code=True)\r\n\r\n\r\nPohoda XML\r\n----------\r\n\r\nGenerate XML invoice file::\r\n\r\n\tfrom InvoiceGenerator.pohoda import SimpleInvoice\r\n\r\n\tpdf = SimpleInvoice(invoice)\r\n\tpdf.gen(\"invoice.xml\")\r\n\r\nNote: Pohoda uses three tax rates: none: 0%, low: 15%, high: 21%.\r\nIf any item doesn't meet those percentage, the rateVat parameter will\r\nnot be set for those items resulting in 0% tax rate.\r\n\r\nOnly SimpleInvoice is currently supported for Pohoda XML format.\r\n\r\n\r\nHacking\r\n=======\r\n\r\nFork the `repository on github <https://github.com/creckx/InvoiceGenerator>`_ and\r\nwrite code. Make sure to add tests covering your code under `/tests/`. You can\r\nrun tests using::\r\n\r\n python setup.py test\r\n\r\nThen propose your patch via a pull request.\r\n\r\nDocumentation is generated from `doc/source/` using `Sphinx\r\n<http://sphinx-doc.org/>`_::\r\n\r\n python setup.py build_sphinx\r\n\r\nThen head to `doc/build/html/index.html`.\r\n\r\n\r\nHistory\r\n=======\r\n\r\n1.1.0 - 2020-04-24\r\n------------------\r\n- Fix QR code on invoice\r\n- Drop Python 2 support\r\n- Add pt_BR translation\r\n- Add support for transparent PNGs\r\n\r\n1.0.0 - 2018-05-17\r\n------------------\r\n- Add support for Pohoda XML format\r\n- Added much more complex documentation\r\n- Parameter ``Address.zip`` was renamed to ``Address.zip_code``\r\n- Add parameters ``division`` and ``country`` to the ``Address``\r\n- Added parameter ``Address.bank_code``\r\n If present, the bank code will be written after dash to\r\n the account number, otherwise whole\r\n ``Address.bank_account`` will be used\r\n- Address are rendered to fit the area on the PDF invoice\r\n- Code style fixes\r\n- Fixes for rounding: usage of ``decimal.Decimal`` and\r\n added parameter ``Invoice.rounding_strategy``\r\n- Fix for QR code\r\n- Allow to set line width in ``SimpleInvoice``\r\n\r\n\r\n0.5.4 - 2017-03-22\r\n------------------\r\n- Fix locale in build package\r\n\r\n\r\n0.5.3 - 2017-01-09\r\n------------------\r\n- Use Babel for currency formating; fix and improve tests\r\n\r\n0.5.2 - 2014-12-04\r\n------------------\r\n- Stop mentionning python2.6 support\r\n- Make invoice.variable_symbol optional\r\n\r\n0.5.1 - 2014-10-28\r\n------------------\r\n- Fix conf relative import\r\n- Use python native function splitlines for notes\r\n\r\n0.5.0 - 2014-09-21\r\n------------------\r\n- Add property number to object Invoice\r\n- Replaced variable symbol for invoice number in invoice header\r\n- Update Czech translations\r\n\r\n0.4.9 - 2014-07-3\r\n-----------------\r\n- Bug fix previous commit\r\n\r\n0.4.8 - 2014-07-3\r\n-----------------\r\n- Create proforma invoice\r\n\r\n0.4.7 - 2014-07-1\r\n-----------------\r\n- Change date format for qr code generator\r\n- Disable converting datetime to string on Invoice\r\n- Disable rendering empty values\r\n\r\n0.4.6 - 2014-05-14\r\n------------------\r\n- The displayed number of pages only when there is more than one\r\n- Rename Date to Date of exposure\r\n- Use pillow instead of PIL\r\n\r\n0.4.5 - 2014-04-21\r\n------------------\r\n\r\n- Support for multipage items printout\r\n- Support for multiline item description\r\n- Use locale to print currency strings and values\r\n- Adding logo to provider header\r\n\r\n\r\nNo notes on earlier releases.\r\n\r\n\r\nContributors\r\n============\r\n\r\n- Adam Strauch (@creckx)\r\n- Martin Voldrich (@rbas)\r\n- Petr Dlouhy (@PetrDlouhy)\r\n- Antoine Musso (@hashar)\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Library to generate PDF invoice.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/creckx/InvoiceGenerator"
},
"split_keywords": [
"invoice",
"invoices",
"generator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "05f008c34bff01ee73e43435a9fe5a96b302628f57869fa049044dfa6088aab0",
"md5": "2e066019316d654ea3ff2436e1dd0e88",
"sha256": "ed0164069f4062faf6fd36fba13135f3b3d9e01123541b88ba2dcac883221c18"
},
"downloads": -1,
"filename": "generateur_facture-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e066019316d654ea3ff2436e1dd0e88",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1149850,
"upload_time": "2023-06-14T12:55:47",
"upload_time_iso_8601": "2023-06-14T12:55:47.516342Z",
"url": "https://files.pythonhosted.org/packages/05/f0/08c34bff01ee73e43435a9fe5a96b302628f57869fa049044dfa6088aab0/generateur_facture-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5e0ba63e626cbeca4f469e7c79c6ce58c7916e8e750904ca287599736cabd945",
"md5": "66891fecd30d82db51a49864fb7a2f7b",
"sha256": "7d0a6c08aa8eb131c45df5aaaf6f36715e7bc7eb314841427e4af24a2f4d412a"
},
"downloads": -1,
"filename": "generateur_facture-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "66891fecd30d82db51a49864fb7a2f7b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16549,
"upload_time": "2023-06-14T12:55:49",
"upload_time_iso_8601": "2023-06-14T12:55:49.881155Z",
"url": "https://files.pythonhosted.org/packages/5e/0b/a63e626cbeca4f469e7c79c6ce58c7916e8e750904ca287599736cabd945/generateur_facture-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-14 12:55:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "creckx",
"github_project": "InvoiceGenerator",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "generateur-facture"
}