Package: billingyard
Billing YardBilling Yard is an open source CLI tool written in Python 3.9 for generating invoices fromJSONfor business entities in the Czech republic. It supports invoices for both VAT payers and non VAT payers.If you like this software, pleasebuy me a coffee.InstallationFirst, please note that the software hasWeasyPrintas a dependency and WeasyPrint needs some external third party libraries for correct functioning. The way to install
these libraries will differ based on your operating system. So first you need to install these dependencies according to
the manual below, then you can install Billing Yard itself.The installation manual below expects you to know and understand how to work withpipandVirtual Environment.LinuxBelow, you can find how to install external third party libraries on different Linux distributions.Debian / UbuntuDebian 10 Buster or newer / Ubuntu 18.04 Bionic Beaver or newersudoapt-getinstallbuild-essentialpython3-devpython3-pippython3-setuptoolspython3-wheelpython3-cffilibcairo2libpango-1.0-0libpangocairo-1.0-0libgdk-pixbuf2.0-0libffi-devshared-mime-infoFedorasudoyuminstallredhat-rpm-configpython-develpython-pippython-setuptoolspython-wheelpython-cffilibffi-develcairopangogdk-pixbuf2Archlinuxsudopacman-Spython-pippython-setuptoolspython-wheelcairopangogdk-pixbuf2libffipkg-configGentooemergepipsetuptoolswheelcairopangogdk-pixbufcffiAlpineAlpine Linux 3.6 or newerapk--update--upgradeaddgccmusl-devjpeg-devzlib-devlibffi-devcairo-devpango-devgdk-pixbuf-devmacOSInstallation on macOS is recommended viaHomebrew.brewinstallpython3cairopangogdk-pixbuflibffiWindows and further supportFor installation on Windows or further support, please see the
officialWeasyPrint installation guide.Installing Billing YardFirst you need to decide whether you want to use Virtual Environment or install Billing Yard globally. But note that
installing in Virtual Environment is always preferred way. Then just make sure you are using Python 3.9 or newer and run
following command, and you are done.pipinstallbillingyardBasic usageFirst step is to create configuration and data source files for generating an invoice. All configuration and data
sources for an invoice are stored in JSON files. There are three schemas of JSON files, one for business entity (sender,
receiver), one for an invoice without VAT and one for an invoice with VAT. Then you can generate the invoice itself.Business entityWe create two business entities, sender (entity which issues the invoice) and receiver (entity which pays the invoice).{"company":"Company s.r.o.","street":"Ulice 38","city":"Praha","zip_code":"100 00","country":"Česká republika","company_id":"00011000","vat_id":"CZ00011000"}company- the business name of the business entitystreet- the street in the address of the business entitycity- the city in the address of the business entityzip_code- the zip code in the address of the business entitycountry- the country in the address of the business entitycompany- the identifier given by Czech authority of the business entitystreet- the identifier for VAT purpose of the business entityoptional if business entity is not a VAT payerInvoice for a non VAT payerBelow you can find the self explaining example of a non VAT payer invoice with further description.{"invoice_number":"2021001","issue_date":"01. 01. 2021","due_date":"31. 01. 2021","currency":"Kč","bank":"Bank a.s.","bank_account":"1234567890/1234","payment_method":"bank transfer","register_info":"Fyzická osoba zapsaná v živnostenském rejstříku.","invoice_lines":[{"description":"software development","unit":"hr","quantity":20,"unit_price":1500}]}invoice_number- a unique identifier of the invoicecompletely up to you, but keep in mind local policies from governmaneissue_date- the date of issue of the invoiceoptional, if not set current date is useddue_date- the last day, when the invoice must be paidcurrency- the currency in which is the invoice issuedbank- the bank of the sender business entitybank_account- the bank account number of the sender business entitypayment_method- the agreed instrument to pay the invoicee.g. bank transfer, cash, credit cardthis text is directly rendered in the invoiceregister_info- the info about record in government registers of the sender business entitythe typical examples in Czech are "Fyzická osoba zapsaná v živnostenském rejstříku." or "Společnost je zapsána v
obchodním rejstříku vedeném u Městského soudu v Praze, oddílu C, vložce 2396."invoice_lines- the list of items that are invoicedEach invoice line consists of following properties.description- the name or more exhaustive description of the invoiced itemunit- the unit which we can use to count the invoiced iteme.g. hour, piece, meter, square meter etcquantity- the amount of invoiced items in previously specified unitunit_price- the price of the invoiced item for one unitAll dates haveDD. MM. YYYYformat.Invoice for a VAT payerBelow you can find the self explaining example of a VAT payer invoice with further description.{"invoice_number":"2021001","issue_date":"01. 01. 2021","supply_date":"01. 01. 2021","due_date":"31. 01. 2021","currency":"Kč","bank":"Bank a.s.","bank_account":"1234567890/1234","payment_method":"bank transfer","register_info":"Fyzická osoba zapsaná v živnostenském rejstříku.","invoice_lines":[{"description":"software development","unit":"hr","quantity":20,"unit_price":1500,"vat_rate":0.21}]}invoice_number- a unique identifier of the invoicecompletely up to you, but keep in mind local policies from governmaneissue_date- the date of issue of the invoiceoptional, if not set current date is usedsupply_date- the date of taxable supplyoptional, if not set current date is useddue_date- the last day, when the invoice must be paidcurrency- the currency in which is the invoice issuedbank- the bank of the sender business entitybank_account- the bank account number of the sender business entitypayment_method- the agreed instrument to pay the invoicee.g. bank transfer, cash, credit cardthis text is directly rendered in the invoiceregister_info- the info about record in government registers of the sender business entitythe typical examples in Czech are "Fyzická osoba zapsaná v živnostenském rejstříku." or "Společnost je zapsána v
obchodním rejstříku vedeném u Městského soudu v Praze, oddílu C, vložce 2396."invoice_lines- the list of items that are invoicedEach invoice line consists of following properties.description- the name or more exhaustive description of the invoiced itemunit- the unit which we can use to count the invoiced iteme.g. hour, piece, meter, square meter etcquantity- the amount of invoiced items in previously specified unitunit_price- the price of the invoiced item for one unit without VATvat_rate- the rate of VAT for this invoiced itemAll dates haveDD. MM. YYYYformat.Generating an invoiceIf you installed Billing Yard using Virtual Environment, just activate this environment and run one of the following
commands, depending on whether you are a VAT payer or not. If you installed Billing Yard globally, just run one of the
commands.billingyard-ssender.jsonissue-invoice-iinvoice.json-rreceiver.jsonThe option-sexpects path to JSON data file with information about a sender business entity. It can be omitted, if
its name issender.jsonand it is located in the same directory from which is the command executed.The option-iexpects path to JSON data file with the invoice data.The option-rexpects path to JSON data file with information about a sender business entity.billingyard-ssender.jsonissue-invoice-iinvoice_vat.json-rreceiver.json--vatThe option--vatis used to generate an invoice for a VAT payer sender business entity. Please do not forget, that in
this case, you have to also provide correct invoice JSON data file with all needed attributes.LicenseThis software is released under MIT License and use other third party software.ClickJinja2WeasyPrint