A payment needs to be canceled today, but the check box for revocation is gray.
This payment corresponds to a prepayment invoice and a standard invoice.
Because the prepayment invoice has been written off, the other two standard invoices have been written off, and the application has been canceled, and no accounting subject has been created.
Therefore, you cannot cancel the payment.
The following SQL statement cannot cancel the write-off function as long as there is a record.
Select *
From ap_invoice_distributions_all aid_prepay,
Ap_invoice_payments_all AIP,
Ap_invoices_all ai_prepay,
Ap_invoice_distributions_all aid,
Ap_invoice_distributions_all AIDP
Where AIP. check_id = 246319
And AIP. invoice_id = ai_prepay.invoice_id
And ai_prepay.invoice_type_lookup_code = 'prepayment'
And aid_prepay.invoice_id = ai_prepay.invoice_id
And aid_prepay.invoice_distribution_id = aid. prepay_distribution_id
And aid. invoice_id = AIDP. invoice_id
And aid. invoice_line_number = AIDP. invoice_line_number
And aid. parent_reversal_id = AIDP. invoice_distribution_id
And aid. prepay_distribution_id = AIDP. prepay_distribution_id
And aid. prepay_distribution_id is not null
And aid. parent_reversal_id is not null
And aid. amount> 0
And nvl (AID. posted_flag, 'n') = 'n'
And nvl (AIDP. posted_flag, 'n') = 'y ';