Skip to main content

Offsets

How to Create a Mutual Document Offset in REST API?

Written by Lenka Haringerová

A mutual offset is a fictitious bank statement used primarily to settle receivables and payables on the basis of mutual offset principles.

<?xml version="1.0"?>
<winstrom version="1.0">
<faktura-vydana>
<id>code:FAV1</id>
<typDokl>code:FAKTURA</typDokl>
<bezPolozek>true</bezPolozek>
<sumOsv>100.0</sumOsv>
</faktura-vydana>
<faktura-prijata>
<id>code:FAP1</id>
<typDokl>code:FAKTURA</typDokl>
<cisDosle>F123</cisDosle>
<datSplat>2017-12-31+01:00</datSplat>
<bezPolozek>true</bezPolozek>
<sumOsv>100.0</sumOsv>
</faktura-prijata>
</winstrom>

For prepared invoices, an offset can be performed in the following way:

<?xml version="1.0"?>
<winstrom version="1.0">
<vzajemny-zapocet>
<id>code:ZAP+0016/2017</id>
<typDokl>code:ZAPOCET</typDokl>
<typPohybuK>typPohybu.prijem</typPohybuK>
<!-- částka úhrady -->
<sumOsv>1.0</sumOsv>
<bezPolozek>true</bezPolozek>
<sparovani>
<uhrazovanaFak type="faktura-vydana">code:FAV1</uhrazovanaFak>
<zbytek>castecnaUhrada</zbytek>
</sparovani>
<!-- číslo zápočtu -->
<cisSouhrnne>ZAP-123</cisSouhrnne>
</vzajemny-zapocet>
<vzajemny-zapocet>
<id>code:ZAP+0017/2017</id>
<typDokl>code:ZAPOCET</typDokl>
<typPohybuK>typPohybu.vydej</typPohybuK>
<sumOsv>1.0</sumOsv>
<bezPolozek>true</bezPolozek>
<sparovani>
<uhrazovanaFak type="faktura-prijata">code:FAP1</uhrazovanaFak>
<zbytek>castecnaUhrada</zbytek>
</sparovani>
<cisSouhrnne>ZAP-123</cisSouhrnne>
</vzajemny-zapocet>
</winstrom>

It may happen that the amounts on the paying and the paid document do not match (part of the amount remains to be paid); in such a case, the import is governed by the value in the zbytek tag.

Offsets can also be used to settle an issued invoice against an issued credit note. Both amounts are again entered as positive values; the credit note is distinguished by the movement type — outgoing:

<?xml version="1.0"?>
<winstrom version="1.0">
<vzajemny-zapocet>
<typDokl>code:ZAPOCET</typDokl>
<typPohybuK>typPohybu.vydej</typPohybuK>
<bezPolozek>true</bezPolozek>
<sumOsv>1000</sumOsv>
<sparovani>
<uhrazovanaFak type="faktura-vydana">code:DOBROPIS1</uhrazovanaFak>
<zbytek>ne</zbytek>
</sparovani>
<primUcet>code:395000</primUcet>
<protiUcet>code:311001</protiUcet>
<cisSouhrnne>ZAP1</cisSouhrnne>
</vzajemny-zapocet>
<vzajemny-zapocet>
<typDokl>code:ZAPOCET</typDokl>
<typPohybuK>typPohybu.prijem</typPohybuK>
<bezPolozek>true</bezPolozek>
<sumOsv>1000</sumOsv>
<sparovani>
<uhrazovanaFak type="faktura-vydana">code:FAV1</uhrazovanaFak>
<zbytek>ne</zbytek>
</sparovani>
<primUcet>code:395000</primUcet>
<protiUcet>code:311001</protiUcet>
<cisSouhrnne>ZAP1</cisSouhrnne>
</vzajemny-zapocet>
</winstrom>

The following remainder values can be selected:

  • ne: no remainder is allowed; if one occurs, it is treated as an error

  • castecnaUhrada: if the amount on the paying document is less than on the paid document, it is treated as a partial payment

Unpairing can be performed analogously:

<?xml version="1.0"?>
<winstrom version="1.0">
<vzajemny-zapocet>
<id>code:ZAP+0016/2017</id>
<odparovani>
<uhrazovanaFak type="faktura-vydana">code:FAV1</uhrazovanaFak>
</odparovani>
</vzajemny-zapocet>
</winstrom>

Example of creating an offset in JSON format:

  • On the receivables side, there are two issued invoices (VF1-0033/2023 and VF1-0031/2023) with a total amount of CZK 1,210.

  • On the payables side, there is one received invoice also with a total amount of CZK 1,210.

  • The result is the creation of both sides of the offset, paired with each other using a matching offset number ("cisSouhrnne").

{
"winstrom":{
"vzajemny-zapocet":[
{
"datVyst":"2023-09-07",
"sumOsv":1000,
"bezPolozek":true,
"typDokl":"code:ZAPOCET",
"typPohybuK":"typPohybu.prijem",
"sparovani":{
"uhrazovanaFak@type":"faktura-vydana",
"uhrazovanaFak":"code:VF1-0033/2023",
"zbytek":"ne"
},
"cisSouhrnne":"5"
},
{
"datVyst":"2023-09-07",
"sumOsv":210,
"bezPolozek":true,
"typDokl":"code:ZAPOCET",
"typPohybuK":"typPohybu.prijem",
"sparovani":{
"uhrazovanaFak@type":"faktura-vydana",
"uhrazovanaFak":"code:VF1-0031/2023",
"zbytek":"ne"
},
"cisSouhrnne":"5"
},
{
"datVyst":"2023-09-07",
"sumOsv":1210,
"bezPolozek":true,
"typDokl":"code:ZAPOCET",
"typPohybuK":"typPohybu.vydej",
"sparovani":{
"uhrazovanaFak@type":"faktura-prijata",
"uhrazovanaFak":"code:PF0016/2023",
"zbytek":"ne"
},
"cisSouhrnne":"5"
}
]
}
}
Did this answer your question?