mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 14:26:51 +00:00
Merge pull request #55 from mifoscontributer/jeacct
Display Journal Transactions by transactionId
This commit is contained in:
commit
0e8fc61e69
@ -218,6 +218,7 @@
|
||||
"label.journalentry.comments":"Comments",
|
||||
"label.save":"Save",
|
||||
"label.cancel":"Cancel",
|
||||
"label.journalentry.transaction.number":"Transaction Number #",
|
||||
|
||||
"app erros end" :"------------------------------------------------------"
|
||||
|
||||
|
||||
43
html/accounting/view_transactions.html
Normal file
43
html/accounting/view_transactions.html
Normal file
@ -0,0 +1,43 @@
|
||||
<form ng-controller="ViewTransactionController">
|
||||
<div class="row alert-block span" >
|
||||
<h3>{{ 'label.journalentry.transaction.number' | translate }} <b>{{transactionNumber}}</b></h3>
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a ng-click="reverseTransaction(transactionNumber)" class="btn btn-primary"><i class="icon-repeat icon-white"></i> Reverse</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row alert-block span" ng-controller="ViewTransactionController">
|
||||
<table class="table" ui:sortable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Transaction Date</th>
|
||||
<th>Type</th>
|
||||
<th>Account</th>
|
||||
<th>TransactionId</th>
|
||||
<th>Debit</th>
|
||||
<th>Credit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="transaction in transactions">
|
||||
<td>{{transaction.transactionDate}}</td>
|
||||
<td>{{transaction.glAccountType.value}}</td>
|
||||
<td>{{transaction.glAccountName}}({{transaction.glAccountCode}})</td>
|
||||
<td>{{transaction.transactionId}}</td>
|
||||
<td>
|
||||
<div ng-show="transaction.entryType.value == 'CREDIT'">
|
||||
{{transaction.amount}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div ng-show="transaction.entryType.value == 'DEBIT'">
|
||||
{{transaction.amount}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
resourceFactory.journalEntriesResource.save(jeTransaction,function(data){
|
||||
location.path('/accounting');
|
||||
location.path('/viewtransactions/'+data.transactionId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
23
js/controllers/ViewTransactionController.js
Normal file
23
js/controllers/ViewTransactionController.js
Normal file
@ -0,0 +1,23 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
|
||||
ViewTransactionController: function(scope, routeParams, resourceFactory, location) {
|
||||
|
||||
resourceFactory.journalEntriesResource.get({transactionId : routeParams.transactionId}, function(data){
|
||||
scope.transactionNumber = routeParams.transactionId;
|
||||
scope.transactions = data.pageItems;
|
||||
});
|
||||
|
||||
scope.reverseTransaction = function (transactionId) {
|
||||
|
||||
resourceFactory.journalEntriesResource.reverse({transactionId : transactionId},function(data){
|
||||
location.path('/viewtransactions/'+data.transactionId);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('ViewTransactionController', ['$scope', '$routeParams', 'ResourceFactory', '$location', mifosX.controllers.ViewTransactionController]).run(function($log) {
|
||||
$log.info("ViewTransactionController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
@ -40,7 +40,8 @@ define(['underscore', 'mifosX'], function() {
|
||||
'AccCoaController',
|
||||
'AccCreateGLAccountContoller',
|
||||
'AccViewGLAccountContoller',
|
||||
'AccEditGLAccountController'
|
||||
'AccEditGLAccountController',
|
||||
'ViewTransactionController'
|
||||
],
|
||||
filters: [
|
||||
'StatusLookup'
|
||||
|
||||
@ -120,6 +120,9 @@
|
||||
})
|
||||
.when('/freqposting', {
|
||||
templateUrl: 'html/accounting/freqposting.html'
|
||||
})
|
||||
.when('/viewtransactions/:transactionId', {
|
||||
templateUrl: 'html/accounting/view_transactions.html'
|
||||
});
|
||||
|
||||
$locationProvider.html5Mode(false);
|
||||
|
||||
@ -81,8 +81,9 @@
|
||||
accountCoaTemplateResource: defineResource(apiVer + "/glaccounts/template", {}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
}),
|
||||
journalEntriesResource: defineResource(apiVer + "/journalentries", {}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
journalEntriesResource: defineResource(apiVer + "/journalentries/:trxid", {trxid:'@transactionId'}, {
|
||||
get: {method: 'GET', params: {transactionId:'@transactionId'}},
|
||||
reverse: {method: 'POST', params:{command:'reverse'}}
|
||||
})
|
||||
};
|
||||
}];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user