You can use the following simple query:
WHERE trx_number = :TRX_NUMBER AND applied_flag = 'Y';
In case I have answered your question, please mark it helpful/correct.
Also Refer the Below Links,Can you get idea Abount Receivable Tables and Table Relation Ship,
Thanks & Regards,