Updated readme
This commit is contained in:
parent
33bd9b1e6d
commit
c54fbb4da5
48
readme.md
48
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
|
||||
In near futore you can use `invoice_id` to perform other actions like downloading PDF or getting details.
|
||||
|
||||
**That's all folks**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user