Duplication of VAT

Previously, VAT was being deducted on retention withheld. Later, we stopped calculating VAT on the retention withheld amount, and the resulting VAT difference was paid directly to ZATCA in Final VAT return through the portal. For this purpose, only a tax invoice was recorded in the system and VAT was submitted and paid manually via the ZATCA portal.

Now, the retention release invoice needs to be issued. The VAT related to this retention has already been paid to ZATCA through the earlier manual submission and corresponding system entry. However, we now need to recover the VAT amount from the client.

To collect the VAT, the retention release invoice must be shared with the client including VAT and submitted to ZATCA. If the invoice is submitted to ZATCA with VAT, the VAT will be reported again, resulting in duplication at ZATCA.

Given this situation, the question is:
How can we issue and clear the retention release invoice through ZATCA, collect VAT from the client, and at the same time ensure that the VAT is not reported again to ZATCA for the same transaction?