XV-PL-17

StanPrzed belongs to a correction of an invoice or a final invoice (KOR, KOR_ROZ), StanPrzedZ and KursWalutyZK to a correction of an advance invoice (KOR_ZAL), and P_15ZK to a correction of an advance or final invoice (KOR_ZAL, KOR_ROZ); this one is … (FA(3) information sheet, StanPrzed, P_15ZK).

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element

Context
/fa:Faktura/fa:Fa
Test
($kind = ('KOR', 'KOR_ROZ') or not(fa:FaWiersz/fa:StanPrzed)) and ($kind = 'KOR_ZAL' or not(fa:Zamowienie/fa:ZamowienieWiersz/fa:StanPrzedZ | fa:KursWalutyZK)) and ($kind = ('KOR_ZAL', 'KOR_ROZ') or not(fa:P_15ZK))

Checked with KSeF FA(3)