What is ICV (Invoice Counter Value) what it should be?

Please I need to know what value should assigned to ICV
Invoice Counter Value? should it be random value. or max invoice number or what it should be?

Salam,
An auto generated sequence like 1,2,3

thanks

1 Like

Dear @Malik
I need to ask about ICV & PIH

for example , i have three invoice and need to report them ,

ICV for first one is 1 and Invoice hash = “test_1” => “reporting success”
ICV for second one is 2 and Invoice hash = “test_2” => “reporting success”

when create xml_invoice for third invoice the ICV must equal 3 and PIH must be equal “test_2” ?

and if reporting of second invoice is failed what is expected ICV and PIH ?

Hi,
Let me explain it to you,

For ZATCA you need to consider two parts 1st is your own company internal record keeping and 2nd is to report to ZATCA for their records. Now I assume you have an accounting system in which users are creating transactions of all 3 types invoices, debit notes and credit notes. Now if you will report from accounting system then might be your 1st invoice and then 5th invoice approved/completed/confirmed first and later 2,3,4 now it will be like 1,5,2,3,4. Later you might have an audit so it will be bit difficult for you to have a proper or easy audit. ZATCA wants that your invoices should have a sequence ICV which is a counter. Now if we have a table for ZATCA reporting header and lines then the above trnasactions will be inserted as below,

ID/ICV Accounting_Sequence PIH
1 1 0
2 5 of 1
3 2 of 2 -------Failed
4 3 of 3
5 4 of 4
6 2 of 5 -------Resubmitted failed as no 3

here in this table ID/ICV is a primary key so there will be/must not be any gap means when there is audit you have a proper audit trail even of failed and then later success as failed you can retry but you have to resubmit as different ID/ICV.

Hope it is clear now. thanks

1 Like