Payments not applied correctly to Invoice and Sales order


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>';

--Running update
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>';
Note: This query should be accordingly edited with the correct invoices_id and amounts before execution. It is recommended that you make a backup of the invoices table before executing the above update which should ideally only be executed under close supervision. If unsure of how to use the query, it is recommended that you submit a support ticket for assistance from Everest Support. 


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.





Please sign in to leave a comment.