diff --git a/global-translations/locale-en.json b/global-translations/locale-en.json index bcb9ebab..c598576e 100644 --- a/global-translations/locale-en.json +++ b/global-translations/locale-en.json @@ -218,6 +218,7 @@ "label.journalentry.comments":"Comments", "label.save":"Save", "label.cancel":"Cancel", + "label.journalentry.transaction.number":"Transaction Number #", "app erros end" :"------------------------------------------------------" diff --git a/html/accounting/view_transactions.html b/html/accounting/view_transactions.html new file mode 100644 index 00000000..e6c3fd67 --- /dev/null +++ b/html/accounting/view_transactions.html @@ -0,0 +1,43 @@ +
+
+

{{ 'label.journalentry.transaction.number' | translate }} {{transactionNumber}}

+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Transaction DateTypeAccountTransactionIdDebitCredit
{{transaction.transactionDate}}{{transaction.glAccountType.value}}{{transaction.glAccountName}}({{transaction.glAccountCode}}){{transaction.transactionId}} +
+ {{transaction.amount}} +
+
+
+ {{transaction.amount}} +
+
+
+
\ No newline at end of file diff --git a/js/controllers/AccFreqPostingController.js b/js/controllers/AccFreqPostingController.js index a827acbd..8492f950 100644 --- a/js/controllers/AccFreqPostingController.js +++ b/js/controllers/AccFreqPostingController.js @@ -73,7 +73,7 @@ } resourceFactory.journalEntriesResource.save(jeTransaction,function(data){ - location.path('/accounting'); + location.path('/viewtransactions/'+data.transactionId); }); } } diff --git a/js/controllers/ViewTransactionController.js b/js/controllers/ViewTransactionController.js new file mode 100644 index 00000000..f9d89edb --- /dev/null +++ b/js/controllers/ViewTransactionController.js @@ -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 || {})); diff --git a/js/mifosXComponents.js b/js/mifosXComponents.js index a5be3488..9849705e 100644 --- a/js/mifosXComponents.js +++ b/js/mifosXComponents.js @@ -40,7 +40,8 @@ define(['underscore', 'mifosX'], function() { 'AccCoaController', 'AccCreateGLAccountContoller', 'AccViewGLAccountContoller', - 'AccEditGLAccountController' + 'AccEditGLAccountController', + 'ViewTransactionController' ], filters: [ 'StatusLookup' diff --git a/js/routes.js b/js/routes.js index 9cd7c6e4..cbf370ad 100644 --- a/js/routes.js +++ b/js/routes.js @@ -120,6 +120,9 @@ }) .when('/freqposting', { templateUrl: 'html/accounting/freqposting.html' + }) + .when('/viewtransactions/:transactionId', { + templateUrl: 'html/accounting/view_transactions.html' }); $locationProvider.html5Mode(false); diff --git a/js/services/ResourceFactoryProvider.js b/js/services/ResourceFactoryProvider.js index c793a638..801fa5d4 100644 --- a/js/services/ResourceFactoryProvider.js +++ b/js/services/ResourceFactoryProvider.js @@ -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'}} }) }; }];