diff --git a/global-translations/locale-en.json b/global-translations/locale-en.json index c035aa8e..65fce1b7 100644 --- a/global-translations/locale-en.json +++ b/global-translations/locale-en.json @@ -39,6 +39,7 @@ "label.annualfeeon":"Annual fees on:", "label.advancedaccountingrules":"Advanced accounting rules", "label.heading.configurefundsourcesforpaymentchannels":"Configure Fund sources for payment channels", + "label.name1": "Name", "# common table headings":"....", "table.heading.officename":"Office name", @@ -253,6 +254,7 @@ "label.description":"Description", "label.tag":"Tag", "label.parentaccountname":"Parent Account", + "label.position":"Position", "#Office ":"....", @@ -260,9 +262,11 @@ "label.openedon":"Opened on:", "label.externalId":"External Id:", "label.parentoffice":"Parent office:", - "app lebels end" :"-----------------------------------------------------", - "app erros start" :"----------------------------------------------------", + "app lebels end" :"-----------------------------------------------------", + "app erros start" :"----------------------------------------------------", "error.login.failed":"Please try again, your credentials are not valid", + "error.delete.failed":"System defined code values cannot be deleted", + "#Journal Entry Predefined Postings":"........", "label.journalentry.posting.title":"Add journal entry", diff --git a/global-translations/locale-hn.json b/global-translations/locale-hn.json index 19bc055b..6b2b812c 100644 --- a/global-translations/locale-hn.json +++ b/global-translations/locale-hn.json @@ -91,7 +91,7 @@ "label.description":"विवरण", "label.tag":"टैग", "label.parentaccountname":"खाते के जनक", - + "label.position":"स्थान", "#Office ":"....", "label.officename":"ऑफिस का नाम:", diff --git a/html/administration/system.html b/html/administration/system.html index f04aed54..907b2465 100644 --- a/html/administration/system.html +++ b/html/administration/system.html @@ -5,7 +5,7 @@

  Manage Data Table

Add new extra feilds to any entity in the form of data table.

- +

  Manage Codes

Codes are used defined drop down values

diff --git a/html/organization/currencyconfig.html b/html/organization/currencyconfig.html index 81984c7d..f31430ce 100644 --- a/html/organization/currencyconfig.html +++ b/html/organization/currencyconfig.html @@ -1,4 +1,4 @@ -

Currecny configuration

+

Currency configuration

diff --git a/html/system/addcode.html b/html/system/addcode.html new file mode 100644 index 00000000..11f07ca0 --- /dev/null +++ b/html/system/addcode.html @@ -0,0 +1,16 @@ +
+
+ Add Code +
+ +
+ +
+
+
+ Cancel + +
+ +
+
\ No newline at end of file diff --git a/html/system/codes.html b/html/system/codes.html new file mode 100644 index 00000000..ab2fa768 --- /dev/null +++ b/html/system/codes.html @@ -0,0 +1,25 @@ + +

Code Name

+ +
+ + + + + + + + + + + + + + +
CodeNameSystem Defined
{{code.name}}{{code.systemDefined}}
+
+ + + diff --git a/html/system/editcode.html b/html/system/editcode.html new file mode 100644 index 00000000..a425ed37 --- /dev/null +++ b/html/system/editcode.html @@ -0,0 +1,16 @@ +
+

Edit {{code.name}}

+
+      + Add +
+
+      +
+
+

{{ 'error.delete.failed' | translate }}

+
+ +
\ No newline at end of file diff --git a/html/system/viewcode.html b/html/system/viewcode.html new file mode 100644 index 00000000..7ecfcf59 --- /dev/null +++ b/html/system/viewcode.html @@ -0,0 +1,29 @@ +
+
+
+ +
+
+
+

{{code.name}}

+
+ + + + + + + + + + + + + + +
{{ 'label.name1' | translate }}{{ 'label.position' | translate }}
{{codevalue.name}}{{codevalue.position}}
+
+
+
\ No newline at end of file diff --git a/js/controllers/AddCodeController.js b/js/controllers/AddCodeController.js new file mode 100644 index 00000000..2bd4ab37 --- /dev/null +++ b/js/controllers/AddCodeController.js @@ -0,0 +1,21 @@ + +(function(module) { + mifosX.controllers = _.extend(module, { + AddCodeController: function(scope, resourceFactory, location) { + scope.codes = []; + resourceFactory.codeResources.getAllCodes(function(data) { + scope.codes = data; + }); + + scope.submit = function() { + resourceFactory.codeResources.save(this.formData,function(data){ + location.path('/codes'); + }); + }; + } + }); + mifosX.ng.application.controller('AddCodeController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.AddCodeController]).run(function($log) { + $log.info("AddCodeController initialized"); + }); +}(mifosX.controllers || {})); + diff --git a/js/controllers/CodeController.js b/js/controllers/CodeController.js new file mode 100644 index 00000000..4b61cf69 --- /dev/null +++ b/js/controllers/CodeController.js @@ -0,0 +1,13 @@ +(function(module) { + mifosX.controllers = _.extend(module, { + CodeController: function(scope, resourceFactory) { + scope.codes = []; + resourceFactory.codeResources.getAllCodes(function(data){ + scope.codes = data; + }); + } + }); + mifosX.ng.application.controller('CodeController', ['$scope', 'ResourceFactory', mifosX.controllers.CodeController]).run(function($log) { + $log.info("CodeController initialized"); + }); +}(mifosX.controllers || {})); diff --git a/js/controllers/EditCodeController.js b/js/controllers/EditCodeController.js new file mode 100644 index 00000000..f0edab2d --- /dev/null +++ b/js/controllers/EditCodeController.js @@ -0,0 +1,38 @@ +(function(module) { + mifosX.controllers = _.extend(module, { + EditCodeController: function(scope, routeParams , resourceFactory, location ) { + scope.codevalues = []; + scope.newcodevalues = []; + scope.newEle = undefined; + + resourceFactory.codeResources.get({codeId: routeParams.id} , function(data) { + scope.code = data; + + }); + resourceFactory.codeValueResource.getAllCodeValues({codeId: routeParams.id} , function(data) { + scope.codevalues = data; + + }); + + scope.addCv = function(){ + if(scope.newEle != undefined && scope.newEle.hasOwnProperty('name')) { + resourceFactory.codeValueResource.save({codeId: routeParams.id},this.newEle,function(data){ + scope.stat=false; + location.path('/viewcode/'+routeParams.id); + }); + } + + }; + + scope.deleteCv = function(id){ + resourceFactory.codeValueResource.remove({codeId: routeParams.id,codevalueId: id},{},function(data){ + scope.stat=false; + location.path('/viewcode/'+routeParams.id); + }); + }; + } + }); + mifosX.ng.application.controller('EditCodeController', ['$scope', '$routeParams','ResourceFactory','$location', mifosX.controllers.EditCodeController]).run(function($log) { + $log.info("EditCodeController initialized"); + }); +}(mifosX.controllers || {})); diff --git a/js/controllers/ViewCodeController.js b/js/controllers/ViewCodeController.js new file mode 100644 index 00000000..548bdc1a --- /dev/null +++ b/js/controllers/ViewCodeController.js @@ -0,0 +1,22 @@ +(function(module) { + mifosX.controllers = _.extend(module, { + ViewCodeController: function(scope, routeParams , resourceFactory, location ) { + scope.codevalues = []; + resourceFactory.codeResources.get({codeId: routeParams.id} , function(data) { + scope.code = data; + }); + resourceFactory.codeValueResource.getAllCodeValues({codeId: routeParams.id} , function(data) { + scope.codevalues = data; + }); + scope.delcode = function(){ + resourceFactory.codeResources.remove({codeId: routeParams.id},this.code,function(data){ + location.path('/codes'); + + }); + } + } + }); + mifosX.ng.application.controller('ViewCodeController', ['$scope', '$routeParams','ResourceFactory','$location', mifosX.controllers.ViewCodeController]).run(function($log) { + $log.info("ViewCodeController initialized"); + }); +}(mifosX.controllers || {})); diff --git a/js/mifosXComponents.js b/js/mifosXComponents.js index 9dc6c732..c0143eea 100644 --- a/js/mifosXComponents.js +++ b/js/mifosXComponents.js @@ -51,7 +51,11 @@ define(['underscore', 'mifosX'], function() { 'AccountingRuleController', 'ViewAccRuleController', 'AccCreateRuleController', - 'AccEditRuleController' + 'AccEditRuleController', + 'CodeController', + 'AddCodeController', + 'ViewCodeController', + 'EditCodeController' ], filters: [ 'StatusLookup' diff --git a/js/routes.js b/js/routes.js index 8952208f..16d295e2 100644 --- a/js/routes.js +++ b/js/routes.js @@ -142,6 +142,9 @@ .when('/accounts_closure', { templateUrl: 'html/accounting/accounts_closure.html' }) + .when('/codes', { + templateUrl: 'html/system/codes.html' + }) .when('/closedaccountingDetails/:officeId', { templateUrl: 'html/accounting/view_close_accounting.html' }) @@ -156,8 +159,21 @@ }) .when('/editaccrule/:id', { templateUrl: 'html/accounting/edit_acc_rule.html' + }) + .when('/viewcode/:id', { + templateUrl: 'html/system/viewcode.html' + }) + .when('/addcode', { + templateUrl: 'html/system/addcode.html' + }) + .when('/codes', { + templateUrl: 'html/system/codes.html' + }) + .when('/editcode/:id', { + templateUrl: 'html/system/editcode.html' }); + $locationProvider.html5Mode(false); }; mifosX.ng.application.config(defineRoutes).run(function($log) { diff --git a/js/services/ResourceFactoryProvider.js b/js/services/ResourceFactoryProvider.js index 74fc6974..9324d6d5 100644 --- a/js/services/ResourceFactoryProvider.js +++ b/js/services/ResourceFactoryProvider.js @@ -17,6 +17,7 @@ officeResource: defineResource(apiVer + "/offices/:officeId", {officeId:"@officeId"}, { getAllOffices: {method: 'GET', params: {}, isArray: true} }), + clientResource: defineResource(apiVer + "/clients/:clientId/:anotherresource", {clientId:'@clientId',anotherresource:'@anotherresource'}, { getAllClients: {method: 'GET', params: {}}, getAllClientDocuments: {method: 'GET', params: {}, isArray: true}, @@ -59,6 +60,7 @@ LoanDocumentResource: defineResource(apiVer + "/loans/:loanId/documents", {loanId:'@loanId'}, { getLoanDocuments: {method: 'GET', params: {} , isArray: true} }), + currencyConfigResource: defineResource(apiVer + "/currencies", {}, { update: { method: 'PUT'} }), @@ -71,7 +73,7 @@ }), employeeResource: defineResource(apiVer + "/staff/:staffId", {staffId:'@staffId'}, { getAllEmployees: {method: 'GET', params: {}, isArray: true}, - update: { method: 'PUT'} + update: { method: 'PUT' } }), globalSearch: defineResource(apiVer + "/search", {query:'@query'}, { search: { method: 'GET', @@ -79,7 +81,7 @@ isArray:true } }), - fundsResource: defineResource(apiVer + "/funds/:fundId", {fundId:'@fundId'}, { + fundsResource: defineResource(apiVer + "/funds/:fundId", {fundId:'@fundId'}, { getAllFunds: {method: 'GET', params: {}, isArray: true} }), accountingRulesResource: defineResource(apiVer + "/accountingrules/:accountingRuleId", {accountingRuleId:'@accountingRuleId'}, { @@ -103,9 +105,21 @@ reverse: {method: 'POST', params:{command:'reverse'}}, search:{method: 'GET', params: {}} }), + accountingClosureResource: defineResource(apiVer + "/glclosures", {}, { get: {method: 'GET', params: {}, isArray:true} + }) , + codeResources: defineResource(apiVer + "/codes/:codeId", {codeId:"@codeId"}, { + getAllCodes: {method: 'GET', params: {}, isArray: true} + + }), + + codeValueResource: defineResource(apiVer + "/codes/:codeId/codevalues/:codevalueId", {codeId:'@codeId',codevalueId:'@codevalueId'}, { + getAllCodeValues: {method: 'GET', params: {}, isArray:true}, + update: { method: 'PUT', params: {}, isArray:true } }) + + }; }]; }