Sorting the rowsof expense voucher details child table in Expense Claim

We are using the Expense Claim in HR module. Our employees fill up the expense voucher details table to specify there expenses. But these expenses are filled by them randomly by no particular order of expense date i.e. expenses done are not in ascending or descending of the expense date.
We want to sort the expense voucher child table in accordance to the ascending order of the expense date within the table , with the older date coming in the first row and the latest expense date row coming in the last row.
Is this possible ? If Yes, how to go about it ?

P.S We’re using ERPNext 4


-Now you can sort records manually by using Drag and Drop rows of “Expense Details” table.
-But if you want to sort automatically then you have to customize it.

Shraddha Ranjane
New Indictrans Technologies Pvt. Ltd.

Yes I want to sort automatically . And I know that we need to write scripts for that.
I need some help on how to go about writing script for this purpose?
Do we need both , a server side script and a client side script?
Please help out. Thanks in advance :smile:

P.S: I have written custom scripts on the client side and have a bit idea of writing server side scripts too .
Using ERPNext4.