As of version 2021.9.1 it is possible to round prices on a received invoice or cash voucher via the REST API. The service is available in the faktura-prijata and pokladni-pohyb (expenditure) registers.
Service description
This is the same service available in the desktop application:
received invoice detail > Services > Round document prices
cash voucher detail (expenditure) > Services > Round document prices
Rounding document prices can only be used on itemized documents. When using the zaokrouhli service, the endpoint of the given register is called using the POST or PUT method:
or
Service input parameters
The zaokrouhli service has an input parameter pozadovaneCeny, which contains the required document prices for each VAT rate:
pozadovaneCeny: Prices used to calculate the rounding difference:
zklZakl,dphZaklandcelkZakl(Base, VAT and VAT-inclusive): for the standard ratezklSniz,dphSnizandcelkSniz(Base, VAT and VAT-inclusive): for the reduced ratezklSniz2,dphSniz2andcelkSniz2(Base, VAT and VAT-inclusive): for the second reduced rateosv: for the tax-exempt amount
Usage examples
1. Rounding a received invoice, rounding prices at the standard rate:
<winstrom version="1.0">
<faktura-prijata>
<!-- Přijatá faktura, která bude zaokrouhlena. -->
<id>code:PF0001/2021</id>
<!-- Lze uvést i další vlastnosti dokladu, jako př importu. -->
<zaokrouhli>
<pozadovaneCeny>
<!-- Požadované ceny dokladu. -->
<zklZakl>110</zklZakl>
<!-- Základ částky pro základní sazbu. -->
<dphZakl>23.1</zklZakl>
<!-- DPH částky pro základní sazbu. -->
<celkZakl>133.1</zklZakl>
<!-- Částka pro základní sazbu Včetně DPH. -->
</pozadovaneCeny>
</zaokrouhli>
</faktura-prijata>
</winstrom>
The result will be a rounding line item on the document:
<winstrom version="1.0">
<faktura-prijata>
<id>code:PF0001/2021</id>
<sumCelkem>133.1</sumCelkem>
<polozkyFaktury>
<faktura-prijata-polozka>
<!-- Původní položka dokladu. -->
<typPolozkyK>typPolozky.obecny</typPolozkyK>
<sumZkl>100.0</sumZkl>
<sumDph>21.0</sumDph>
<sumCelkem>121.0</sumCelkem>
</faktura-prijata-polozka>
<faktura-prijata-polozka>
<!-- Položka, která vznikla při zaokrouhlení. -->
<typPolozkyK>typPolozky.ucetni</typPolozkyK>
<sumZkl>10.0</sumZkl>
<sumDph>2.1</sumDph>
<sumCelkem>12.1</sumCelkem>
</faktura-prijata-polozka>
</polozkyFaktury>
</faktura-prijata>
</winstrom>
2. Rounding a cash voucher, rounding prices at the 0% rate:
<winstrom version="1.0">
<pokladni-pohyb>
<!-- Pokladní pohyb, který bude zaokrouhlen. -->
<id>code:P-0001/2021</id>
<!-- Lze uvést i další vlastnosti dokladu, jako př importu. -->
<zaokrouhli>
<pozadovaneCeny>
<!-- Požadované ceny dokladu. -->
<osv>140</osv>
</pozadovaneCeny>
</zaokrouhli>
</pokladni-pohyb>
</winstrom>
The result will be a rounding line item on the document:
<winstrom version="1.0">
<pokladni-pohyb>
<id>code:P-0001/2021</id>
<sumCelkem>140</sumCelkem>
<polozkyDokladu>
<pokladni-pohyb-polozka>
<!-- Původní položka dokladu. -->
<typPolozkyK>typPolozky.obecny</typPolozkyK>
<sumZkl>130.0</sumZkl>
<sumDph>0.0</sumDph>
<sumCelkem>130.0</sumCelkem>
</pokladni-pohyb-polozka>
<pokladni-pohyb-polozka>
<!-- Položka, která vznikla při zaokrouhlení. -->
<typPolozkyK>typPolozky.ucetni</typPolozkyK>
<sumZkl>10.0</sumZkl>
<sumDph>0.0</sumDph>
<sumCelkem>10.0</sumCelkem>
</pokladni-pohyb-polozka>
</polozkyDokladu>
</pokladni-pohyb>
</winstrom>
