Payments not applied correctly to Invoice and Sales order

Overview

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. In addition, deposit payments on Sales Orders will not be applied correctly on the Invoice when the items are shipped.

Solution

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

--purge the associated receipt journal
update BCH_TRAN set AMOUNT_FEX = 0 where BATCH_NO = <receipt_journal#>;
update BATCH set DR_AMT = 0, CR_AMT = 0 where BATCH_NO = <receipt_journal#>;
update BCH_HEAD set IS_SYSTEM = 'F' where BATCH_NO = <receipt_journal#>;
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 queries, it is recommended that you submit a support ticket for assistance from Everest Support. 

Testing

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.

Back to top

Comments

0 comments

Please sign in to leave a comment.