From c54fbb4da5bcd69a6fff79983bcdeedb14727204 Mon Sep 17 00:00:00 2001 From: Dariusz Aniszewski Date: Sun, 14 Jun 2015 00:20:58 +0200 Subject: [PATCH] Updated readme --- readme.md | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/readme.md b/readme.md index 85ba1f9..14b64bd 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Extremely simple wrapper for iFirma API. - generating invoice in iFirma service -**Planned** +**Very soon** - downloading invoice PDF - generating proforma invoice @@ -30,39 +30,37 @@ iFirma offers [demo account](https://www.ifirma.pl/cgi-bin/WebObjects/ifirma-dem ##Usage - -1. Create instance of iFirmaAPI - +#####1. Create instance of iFirmaAPI ```python ifirma_client = iFirmaAPI(TEST_IFIRMA_USER, TEST_IFIRMA_INVOICE_KEY, TEST_IFIRMA_USER_KEY) ``` -2. Create invoice parameters - +#####2. Create invoice parameters ```python +client = Client( + "Dariusz Aniszewski's Company", # company name + "PL1231231212", # Tax ID + Address( + "Otwock", # City + "00-000" # Zip code + ), + email="email@server.com", +) - client = Client( - "Dariusz", - "1231231212", - Address( - "Warszawa", - "03-185" - ), - email="email@server.com", - ) - - position = Position( - VAT.VAT_23, - 1, - 1000, - "nazwa", - "szt" - ) +position = Position( + VAT.VAT_23, # VAT rate + 1, # Quantity + 1000, # Unit price + "nazwa", # Position name + "szt" # Position unit +) ``` -3. Create invoice in iFirma service and get it's id +#####3. Create invoice in iFirma service and get it's id ```python invoice = NewInvoiceParams(client, [position]) invoice_id = ifirma_client.generate_invoice(invoice) ``` -That's all folks \ No newline at end of file +In near futore you can use `invoice_id` to perform other actions like downloading PDF or getting details. + +**That's all folks**