An issued or received invoice can be paid in cash via XML in the following way:
<?xml version="1.0"?>
<winstrom version="1.0">
<faktura-vydana>
<!-- uhrazovaný doklad; může být i "faktura-prijata" -->
<id>code:FAKTURA1</id>
<!-- lze normálně uvést další vlastnosti dokladu jako při běžném importu -->
<hotovostni-uhrada>
<uhrazujiciDokl>code:UHRADA1</uhrazujiciDokl>
<!-- nepovinné -->
<pokladna>code:POKLADNA KČ</pokladna>
<!-- nepovinné, pokud je vyplněné a je true, použije se kurz platný k datu úhrady, jinak se použije kurz převzatý z uhrazované faktury -->
<kurzKDatuUhrady>true/false</kurzKDatuUhrady>
<typDokl>code:STANDARD</typDokl>
<!-- typ vytvářeného pokladního dokladu -->
<castka>1000</castka>
<datumUhrady>2011-01-01</datumUhrady>
</hotovostni-uhrada>
</faktura-vydana>
</winstrom>
A cash payment can also have an exchange rate and exchange rate quantity directly imposed on it. If you fill in the exchange rate, you must also fill in the exchange rate quantity (it cannot be omitted).
The resulting request may then look as follows:
<?xml version="1.0"?>
<winstrom version="1.0">
<faktura-vydana>
<id>code:FAKTURA_1</id>
<hotovostni-uhrada>
<pokladna>code:POKLADNA EUR</pokladna>
<!-- není povinný, pokud by nebyl vyplněn, použije se kurz převzatý z uhrazované faktury -->
<kurz>25</kurz>
<kurzMnozstvi>1</kurzMnozstvi>
<typDokl>code:STANDARD</typDokl>
<castka>1000</castka>
<datumUhrady>2021-12-03</datumUhrady>
</hotovostni-uhrada>
</faktura-vydana>
</winstrom>
You can specify the ID of the paying cash document (tag <uhrazujiciDokl> ) according to the standard rules and it works as follows:
New payment: If not specified, a new cash document is always created, so if you import the XML twice, two payments will be created. If specified and a document with the given ID does not exist, it will be created.
Update: If it exists, it must be settling the given invoice (otherwise it is an error), meaning the payment should only be updated with the available amount on the paying document. Other payment parameters are ignored.
If it is not a full payment, you can add the zbytek parameter to the request body. This parameter can take several values.
|
|
|
|
parameter | zbytek = 0 | zbytek > 0 | zbytek < 0 |
| Invoices will be fully settled, or partially settled if the payment was limited by the
The paying document will be matched. | ERROR:
400 – The amounts on the settled and paying documents do not match |
|
| Invoices will be fully settled, or partially settled if the payment was limited by the
The paying document will be matched.
An internal document will be created for the remainder. |
|
|
| Invoices will be fully settled, or partially settled if the payment was limited by the
The paying document will not be matched. |
|
|
| ERROR:
400 – Partial payment does not make sense; the amount on the paying document is greater than on the settled document | The amount of the paying document is progressively "consumed" to settle invoices or the amounts to be settled from them, in the order they appear in the
An invoice for which the remaining payment amount is insufficient for full settlement or settlement of the entire specified amount will be partially settled up to the remaining available funds from the paying amount.
Invoices for which no funds remain from the paying amount are excluded from matching and will remain unpaid. |
|
| Invoices will be fully settled, or partially settled if the payment was limited by the
The paying document will be matched.
An internal document will be created for the remainder. |
|
|
| Invoices will be fully settled, or partially settled if the payment was limited by the
The paying document will not be matched. |
|
|
In the <hotovostni-uhrada> tag, you can also specify the document series for the cash document being created. This is not mandatory and is taken by default from the selected document type or from the selected cash register.
<rada>code:POKLADNA+</rada>
