Custom Docker application for pushing invoicing data to Fakturoid.
{
"parameters": {
"email": "your@email.com",
"#token": "token",
"slug": "slug",
"order": "asc"
}
}
Note: When copying to UI, select only content of parameters
section.
email
: Email#token
: Token. Encrypted.slug
: Slug; Account nameorder
: If order itemsdesc
orasc
byfwr_order
field (default toasc
)
Two files at /data/in/tables
path:
invoice.csv
invoice-items.csv
Sample:
... | fwr_id | fwr_order | subject_id | ... |
---|---|---|---|---|
... | 11 | 1 | 1001 | ... |
... | 12 | 2 | 1002 | ... |
Required fields:
subject_id
(Fakturoid): An ID of contactfwr_id
: Invoice ID (only in terms of this file)fwr_order
: Order (only in terms of this file). Invoices will be sorted and send to API in by this field.
Check Invoices section at Fakturoid API docs: http://docs.fakturoid.apiary.io/#reference/invoices/novy-kontakt
Sample:
... | fwr_invoice_id | name | quantity | unit_price | vat_rate | ... |
---|---|---|---|---|---|---|
... | 11 | Item 1 | 1 | 100 | 0 | ... |
... | 12 | Item 1 | 1 | 100 | 0 | ... |
... | 12 | Item 2 | 3 | 50 | 0 | ... |
Required fields:
fwr_invoice_id
: Invoice ID (foreign key);fwr_id
field value frominvoice.csv
filename
(Fakturoid): Description of itemquantity
(Fakturoid): Quantityunit_price
(Fakturoid): Unit price for itemvat_rate
(Fakturoid): VAT rate (0
for non payers)
Check Lines section at Fakturoid API docs: http://docs.fakturoid.apiary.io/#reference/lines/novy-kontakt
One file at /data/out/tables
path is exported. Each row contains full response from Fakturoid.
Sample:
data |
---|
{""id"":3701,""subject_id"":1001,""items"":[{""name"":""Item 1""}]} |
... |
Requirements:
- Docker Engine and Docker Compose (combination which support
docker-compose.yml
v2)
Application is prepared for run in container, you can start development same way:
- Clone this repository and go to directory with clone
- Build services:
docker-compose build
- Run tests
docker-compose run --rm app-tests
(runs./tests.sh
script)
After seeing all tests green, continue:
- Run service:
docker-compose run --rm app
(starts container withbash
) - Write tests and code
- Run tests:
./tests.sh
To simulate real run:
- Create data dir:
mkdir -p data
- Follow configuration sample and create
config.json
file and place it to your data directory (data/config.json
) - Prepare input data
- Simulate real run (with entrypoint command):
php ./src/app.php run ./data
- all in one:
./tests.sh
- or separately, just check
tests.sh
file contents
MIT licensed, see LICENSE file.