Credit entry is made before debit entry in GL & CoA does not reflect income & expense amount

I have configured ERPNext (erpnext 12.9.4, frappe 12.6.1) for Education domain and am seeing that COA does not reflect income & expense amounts.

After having spent considerable time on this issue, I have probably figured out the root cause. I see that credit entry is made before the debit entry when Fees record was created.