SDI-00409
Fattura duplicata nel lotto
In English Two invoices in the same file have the same number and year (the same date for invoices under art. 73); a credit note may share the number of an invoice.
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.
/p:FatturaElettronica/FatturaElettronicaBody
not(../FatturaElettronicaBody[not(. is current())][DatiGenerali/DatiGeneraliDocumento[Numero = $number and (if ($art73) then xs:date(Data) = $date else year-from-date(xs:date(Data)) = year-from-date($date)) and ((TipoDocumento = 'TD04') = ($type = 'TD04'))]])
Checked with FatturaPA 1.2.3
/s:FatturaElettronicaSemplificata/FatturaElettronicaBody
not(../FatturaElettronicaBody[not(. is current())][DatiGenerali/DatiGeneraliDocumento[Numero = $number and year-from-date(xs:date(Data)) = year-from-date($date) and ((TipoDocumento = 'TD08') = ($type = 'TD08'))]])
Checked with FatturaPA simplified 1.0.2