Often we have the requirement for printing the cheque/check report in a specific sequence say line number or account number etc so that it is easy to validate and match with the payments report:
Below is the class and method to modify for doing this:
Add the following line of code at the end to sort the cheque number assignment basis line number:
queryrun.query().dataSourceTable(tablenum(LedgerJournalTrans)).addSortField(fieldnum(LedgerJournalTrans, LineNum), SortOrder::Ascending);
Hope this helps.