PBA-S provides script which may be used to correct customers balance:
This script calls blocks tables which can affect customers balance:
LOCK TABLE acc_balance WRITE, acc_transaction WRITE, ar_doc READ, hspc_setting READ, account READ, vendor_currency as list READ
NOTE: While script is working all others processes which require these tables will wait until tables will be unlocked. You should run this script in minimal activity period.
Run the script without any parameters and it will recalculate balance of all customers from their AR documents. The script will report IDs of accounts whose balance was adjusted:
# /usr/sbin/hspc-acc-balance-fix.pl Shifting balance of account #6 on -4.00
Depending on the number of customer accounts in PBA-S program execution may take significant time.