📄 Stupid simple invoice generator, because, why not.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
invoices
layout
.eslintrc.json
.gitignore
LICENSE.md
README.md
TODO.md
config.json.dist
index.js
package-lock.json
package.json

README.md

invoice

Simple JSON-based, HTML invoice generator, with optional custom template.

Screenshot

Requirements

  • Node >= 9 (async / await)

Usage

Configuration file

First, you need to create a configuration file based on config.js.dist.

It can be overriden by the configuration inside the json invoice.

{
    "company": {
        "name": "My Company",
        "email": "invoice@my-company.tld",
        "address": {
            "street": "Company Street Name",
            "postcode": "Company Post Code",
            "city": "Company City",
            "country": "Company Country"
        },
        "vat": "123456789",
        "coc": "123456789",
        "iban": "123456789",
        "swift": "CODE42CODE"
    },
    "payment_term": "30 days",
    "tax": {
        "rate": 0.42
    },
    "currency": {
        "code": "EUR",
        "text": "€"
    }
}

Invoice file

Create an invoice file based on the sample invoice

{
    "id": 10001,
    "issued_date": "2018-07-05",
    "mode": {
        "unit": "Hours",
        "rate": "Hourly Rate"
    },
    "client": {
        "id": "great-client",
        "name": "Great Client Ltd",
        "address": {
            "street": "Client Street",
            "postcode": "Client Post code",
            "city": "Client City",
            "country": "Client Country"
        },
        "vat": "CL123456789",
        "coc": {
            "name": "CoC",
            "value": "123456789"
        }
    },
    "tasks": [
        {
            "description": "A well executed task",
            "rate": 42,
            "quantity": 5
        }
    ]
}

Commands

Create an HTML invoice.

node index.js create --invoice invoices/sample.json

or

Development

Testing

npm run test

TODO

TODO

License

MIT