ISDOC-4.1.6

Jednotka v rozpisu všech šarží/sériových čísel (element StoreBatches) musí být stejná jako jednotka pro množství na řádce faktury. Jednotky u šarží jedné řádky faktury musí být stejné. Pokud atribut pro jednotku v rozpisu šarží/sériových čísel není uveden, tak se předpokládá, že je množství uvedeno ve stejné jednotce jako množství na řádce faktury.

In English The units of the batches or serial numbers of a line (StoreBatches) must be the same, and the same as the unit of the line's quantity. A batch quantity without a unit is taken to be in the line's unit.

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
isdoc:Invoice/isdoc:InvoiceLines/isdoc:InvoiceLine[isdoc:Item/isdoc:StoreBatches]
Test
count(distinct-values(isdoc:Item/isdoc:StoreBatches/isdoc:StoreBatch/isdoc:Quantity/@unitCode)) le 1

Checked with ISDOC 6.0.2

Context
isdoc:Invoice/isdoc:InvoiceLines/isdoc:InvoiceLine[isdoc:Item/isdoc:StoreBatches]
Test
if (isdoc:InvoicedQuantity/@unitCode) then every $q in (isdoc:Item/isdoc:StoreBatches/isdoc:StoreBatch/isdoc:Quantity) satisfies $q/@unitCode = isdoc:InvoicedQuantity/@unitCode else true()

Checked with ISDOC 6.0.2