1
0
Fork 0
mirror of https://github.com/Findus23/invoices.git synced 2024-09-19 15:13:47 +02:00
Quickly creating invoices with the power of LaTeX and Python
Find a file
2020-09-22 14:26:41 +02:00
.gitignore update gitignore 2018-12-19 12:38:58 +01:00
invoice.py more OOP 2018-05-15 17:49:23 +02:00
LICENSE Create LICENSE 2018-03-13 22:08:58 +01:00
main.py compile in nonstopmode 2020-09-22 14:01:19 +02:00
poetry.lock move to poetry 2019-12-27 11:07:22 +01:00
pyproject.toml move to poetry 2019-12-27 11:07:22 +01:00
README.md restructured readme 2020-09-22 14:26:41 +02:00
strings.yaml support bank fees 2018-05-05 13:04:30 +02:00
template.tex use bank info from config 2020-09-22 13:59:20 +02:00
utils.py minor improvements 2019-10-09 20:16:08 +02:00

Invoices

To generate invoices, you need multiple local configs. Your own information should be present in from.yaml, the person (or company) you write the invoice to should be present as a file in recipients/<rname>.yaml, where rname is the selector. The specific information about this invoice should be in config.yaml.

Your own information: from.yaml

Have a file called from.yaml with your own information structured like this:

Field descriptions

Field Type description
name string Your full name.
address string Your Address. Both street and number.
zip int Your area ZIP code.
city string The city you live in.
cityShort string Shortened version of your city name.
countryDE strang Name of your country in german, used for an invoice in german.
countryEN strang Name of your country in english, used for an invoice in english.
IBAN string The IBAN of your bank account.
BIC string The BIC of your bank account.
bank string The name of your bank.

Example

name: <name>
address: <address>
zip: <zip>
city: <name of city>
cityShort: <short name of city>
countryDE: Deutschland
countryEN: Germany
IBAN: <IBAN>
BIC: <BIC>
bank: <name of bank>

Clients: recipients/<rname>.yaml

For every clients rname, have a recipients/<rname>.yaml file structured like this:

Field descriptions

Field Type description
name string Your clients name.
address string Your clients business address. Both street and number.
zip int ZIP code of your clients address.
city string City correlating to the zip code.
country string Country of your clients business address.

Example

name: <name>
address: <address>
zip: <zip>
city: <city>
country: <country>

Config: config.yaml

The main config is in a file called config.yaml:

Field descriptions

Field Type description
title string Title of the invoice.
description string Description of the work you did.
range string Timeframe during which you accumulated the given number of hours.
hours int Number of hours you worked for the given timeframe and client.
default_recipient string Filename (before the .yaml) of your default client.
last_id int Since invoices need to have unique IDs, this number will be increased by one. After that, the config will be written back to the file. This deletes any prior comments.
invoice_dir string Directory in which the invoice will be generated. Needs to exist prior to execution.
default_hourly_rate int The hourly rate you bill for in this receipt.
bank_fee int Optional. Amount of bank fees you can invoice.

Example

title: <invoice title>
description: <work description>
range: <timeframe in which you worked>
hours: <hours worked>
default_recipient: <rname>
last_id: <int>
invoice_dir: invoice    # directory needs to exist
default_hourly_rate: <int>

Structure

mkdir invoice
mkdir recipients

Setup

virtualenv -p python3 .venv
source .venv/bin/activate
# apparently this is one of the few ways to install poetry?
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
poetry install              # install dependencies

Usage

$ python main.py create
...     # you will be asked for details and further information here
$ python main.py compile