This article provides a solution when payments are not getting applied correctly to an Invoice and corresponding Sales order.
When this issue occurs, users will report having transactions showing up in Everest Receivables that are not supposed to be there.
When a Sales Order where the payment is being received is not showing the correct outstanding balance, i.e. instead of showing the overpayment balance, it is showing 0 (zero) balance, this can be corrected by adjusting the balance through the back-end directly using the following SQL query:
--getting internal invoice ID
select invoices_id from invoices where status = 8 and order_no = '<order number>';
update invoices set paid_amt = <outstanding>, paid_sofar = <total paid>, pd_amt_fex = <outstanding>, pd_sfar_fex = <total paid>
where invoices_id = <result from previous query> and order_no = '<order number>';
After the balance is updated, the user should be able to refund the payment normally and the payments should apply correctly to the Invoice and Sales Order.