MIFOSX-1348 sorting for RD transactions

This commit is contained in:
Madhukar 2014-06-18 21:06:20 +05:30
parent e02f788b05
commit e8af78c18f
4 changed files with 37 additions and 23 deletions

View File

@ -286,6 +286,20 @@
};
};
scope.transactionSort = {
column: 'date',
descending: true
};
scope.changeTransactionSort = function(column) {
var sort = scope.transactionSort;
if (sort.column == column) {
sort.descending = !sort.descending;
} else {
sort.column = column;
sort.descending = true;
}
};
}
});
mifosX.ng.application.controller('ViewRecurringDepositAccountDetailsController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$route', 'dateFilter','$modal', mifosX.controllers.ViewRecurringDepositAccountDetailsController]).run(function ($log) {

View File

@ -204,17 +204,17 @@
<colgroup span="4"></colgroup>
<thead>
<tr>
<th>{{'label.heading.id' | translate}}</th>
<th>{{'label.heading.transactiondate' | translate}}</th>
<th>{{'label.heading.transactiontype' | translate}}</th>
<th>{{'label.heading.debit' | translate}}</th>
<th>{{'label.heading.credit' | translate}}</th>
<th>{{'label.heading.balance' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('id')">{{'label.heading.id' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('date')">{{'label.heading.transactiondate' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('transactionType.value')">{{'label.heading.transactiontype' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.debit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.credit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('runningBalance')">{{'label.heading.balance' | translate}}</th>
</tr>
</thead>
<tbody>
<tr class="pointer-main" ng-class="{strikeoff : transaction.reversed==true}"
ng-repeat="transaction in savingaccountdetails.transactions">
ng-repeat="transaction in savingaccountdetails.transactions | orderBy:transactionSort.column:transactionSort.descending ">
<td class="pointer"
data-ng-click="routeTo(transaction.accountId,transaction.id,transaction.transfer,transaction.transfer.id)">
{{transaction.id}}

View File

@ -479,12 +479,12 @@
<colgroup span="4"></colgroup>
<thead>
<tr class="graybg">
<th ng-click="changeTransactionSort('id')">{{'label.heading.id' | translate}}</th>
<th ng-click="changeTransactionSort('officeName')">{{'label.heading.office' | translate}}</th>
<th ng-click="changeTransactionSort('date')">{{'label.heading.transactiondate' | translate}}</th>
<th ng-click="changeTransactionSort('type.value')">{{'label.heading.transactiontype' | translate}}</th>
<th ng-click="changeTransactionSort('amount')">{{'label.heading.amount' | translate}}</th>
<th colspan="5" scope="colgroup">{{'label.heading.breakdown' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('id')">{{'label.heading.id' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('officeName')">{{'label.heading.office' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('date')">{{'label.heading.transactiondate' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('type.value')">{{'label.heading.transactiontype' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.amount' | translate}}</th>
<th class="pointer" colspan="5" scope="colgroup">{{'label.heading.breakdown' | translate}}</th>
</tr>
<tr>
<th scope="col">&nbsp;</th>
@ -492,10 +492,10 @@
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col" ng-click="changeTransactionSort('principalPortion')">{{'label.heading.principal' | translate}}</th>
<th scope="col" ng-click="changeTransactionSort('interestPortion')">{{'label.heading.interest' | translate}}</th>
<th scope="col" ng-click="changeTransactionSort('feeChargesPortion')">{{'label.heading.fees' | translate}}</th>
<th scope="col" ng-click="changeTransactionSort('penaltyChargesPortion')">{{'label.heading.penalities' | translate}}</th>
<th class="pointer" scope="col" ng-click="changeTransactionSort('principalPortion')">{{'label.heading.principal' | translate}}</th>
<th class="pointer" scope="col" ng-click="changeTransactionSort('interestPortion')">{{'label.heading.interest' | translate}}</th>
<th class="pointer" scope="col" ng-click="changeTransactionSort('feeChargesPortion')">{{'label.heading.fees' | translate}}</th>
<th class="pointer" scope="col" ng-click="changeTransactionSort('penaltyChargesPortion')">{{'label.heading.penalities' | translate}}</th>
</tr>
</thead>
<tbody>

View File

@ -211,12 +211,12 @@
<colgroup span="4"></colgroup>
<thead>
<tr>
<th ng-click="changeTransactionSort('id')">{{'label.heading.id' | translate}}</th>
<th ng-click="changeTransactionSort('date')">{{'label.heading.transactiondate' | translate}}</th>
<th ng-click="changeTransactionSort('transactionType.value')">{{'label.heading.transactiontype' | translate}}</th>
<th ng-click="changeTransactionSort('amount')">{{'label.heading.debit' | translate}}</th>
<th ng-click="changeTransactionSort('amount')">{{'label.heading.credit' | translate}}</th>
<th ng-click="changeTransactionSort('runningBalance')">{{'label.heading.balance' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('id')">{{'label.heading.id' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('date')">{{'label.heading.transactiondate' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('transactionType.value')">{{'label.heading.transactiontype' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.debit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.credit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('runningBalance')">{{'label.heading.balance' | translate}}</th>
</tr>
</thead>
<tbody>