When assigning staff to Centers, Groups, Client, Loan, Savings a/c: Only loan officers who belong to the branch should be displayed in dropdown

This commit is contained in:
goutham-M 2014-05-24 18:15:09 +05:30
parent ed47781f9d
commit 0b1f4c86f3
11 changed files with 19 additions and 13 deletions

View File

@ -8,7 +8,7 @@
scope.formData = {};
scope.restrictDate = new Date();
scope.first.date = new Date();
resourceFactory.centerTemplateResource.get(function (data) {
resourceFactory.centerTemplateResource.get({staffInSelectedOfficeOnly:true},function (data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
scope.groups = data.groupMembersOptions;
@ -16,7 +16,7 @@
});
scope.changeOffice = function () {
resourceFactory.centerTemplateResource.get({staffInSelectedOfficeOnly: false, officeId: scope.formData.officeId
resourceFactory.centerTemplateResource.get({staffInSelectedOfficeOnly:true, officeId: scope.formData.officeId
}, function (data) {
scope.staffs = data.staffOptions;
});

View File

@ -6,7 +6,7 @@
scope.first.date = new Date();
scope.centerId = routeParams.id;
scope.restrictDate = new Date();
resourceFactory.centerResource.get({centerId: routeParams.id, template: 'true'}, function (data) {
resourceFactory.centerResource.get({centerId: routeParams.id, template: 'true',staffInSelectedOfficeOnly:true}, function (data) {
scope.edit = data;
scope.staffs = data.staffOptions;
scope.formData = {
@ -49,5 +49,4 @@
mifosX.ng.application.controller('EditCenterController', ['$scope', 'ResourceFactory', '$location', '$routeParams', 'dateFilter', mifosX.controllers.EditCenterController]).run(function ($log) {
$log.info("EditCenterController initialized");
});
}(mifosX.controllers || {}));
}(mifosX.controllers || {}));

View File

@ -10,7 +10,7 @@
scope.restrictDate = new Date();
scope.showSavingOptions = false;
scope.opensavingsproduct = false;
resourceFactory.clientTemplateResource.get(function (data) {
resourceFactory.clientTemplateResource.get({staffInSelectedOfficeOnly:true}, function (data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
scope.formData.officeId = scope.offices[0].id;
@ -22,7 +22,7 @@
});
scope.changeOffice = function (officeId) {
resourceFactory.clientTemplateResource.get({staffInSelectedOfficeOnly: false, officeId: officeId
resourceFactory.clientTemplateResource.get({staffInSelectedOfficeOnly:true, officeId: officeId
}, function (data) {
scope.staffs = data.staffOptions;
scope.savingproducts = data.savingProductOptions;

View File

@ -8,7 +8,7 @@
scope.clientId = routeParams.id;
scope.showSavingOptions = 'false';
scope.opensavingsproduct = 'false';
resourceFactory.clientResource.get({clientId: routeParams.id, template: 'true'}, function (data) {
resourceFactory.clientResource.get({clientId: routeParams.id, template:'true', staffInSelectedOfficeOnly:true}, function (data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
scope.savingproducts = data.savingProductOptions;

View File

@ -13,7 +13,7 @@
scope.added = [];
scope.formData = {};
scope.formData.clientMembers = [];
resourceFactory.groupTemplateResource.get({orderBy: 'name', sortOrder: 'ASC'}, function (data) {
resourceFactory.groupTemplateResource.get({orderBy: 'name', sortOrder: 'ASC',staffInSelectedOfficeOnly:true}, function (data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
scope.clients = data.clientOptions;
@ -47,7 +47,7 @@
};
scope.changeOffice = function (officeId) {
scope.addedClients = [];
resourceFactory.groupTemplateResource.get({staffInSelectedOfficeOnly: false, officeId: officeId
resourceFactory.groupTemplateResource.get({staffInSelectedOfficeOnly: false, officeId: officeId,staffInSelectedOfficeOnly:true
}, function (data) {
scope.staffs = data.staffOptions;
});

View File

@ -4,7 +4,7 @@
scope.first = {};
scope.managecode = routeParams.managecode;
scope.restrictDate = new Date();
resourceFactory.groupResource.get({groupId: routeParams.id, associations: 'clientMembers', template: 'true'}, function (data) {
resourceFactory.groupResource.get({groupId: routeParams.id, associations: 'clientMembers', template: 'true',staffInSelectedOfficeOnly:true}, function (data) {
scope.editGroup = data;
scope.formData = {
name: data.name,

View File

@ -9,7 +9,7 @@
scope.collaterals = [];
scope.restrictDate = new Date();
resourceFactory.loanResource.get({loanId: routeParams.id, template: true, associations: 'charges,collateral,meeting,multiDisburseDetails'}, function (data) {
resourceFactory.loanResource.get({loanId: routeParams.id, template: true, associations: 'charges,collateral,meeting,multiDisburseDetails',staffInSelectedOfficeOnly:true}, function (data) {
scope.loanaccountinfo = data;
resourceFactory.loanResource.get({resourceType: 'template', templateType: 'collateral', productId: data.loanProductId, fields: 'id,loanCollateralOptions'}, function (data) {
@ -62,6 +62,8 @@
inparams.groupId = scope.groupId;
}
inparams.staffInSelectedOfficeOnly = true;
resourceFactory.loanResource.get(inparams, function (data) {
scope.loanaccountinfo = data;
scope.collaterals = [];

View File

@ -8,6 +8,7 @@
scope.restrictDate = new Date();
scope.chargeFormData = {}; //For charges
scope.collateralFormData = {}; //For collaterals
scope.staffInSelectedOfficeOnly = true;
scope.inparams = { resourceType: 'template', templateType: 'jlgbulk', lendingStrategy: 300 };
if (scope.groupId) {

View File

@ -31,6 +31,8 @@
scope.inparams.templateType = 'individual';
}
scope.inparams.staffInSelectedOfficeOnly = true;
resourceFactory.loanResource.get(scope.inparams, function (data) {
scope.products = data.productOptions;
if (data.clientName) {

View File

@ -25,6 +25,8 @@
}
;
scope.inparams.staffInSelectedOfficeOnly = true;
resourceFactory.savingsTemplateResource.get(scope.inparams, function (data) {
scope.products = data.productOptions;
scope.chargeOptions = data.chargeOptions;

View File

@ -7,7 +7,7 @@
scope.accountId = routeParams.id;
scope.charges = [];
scope.restrictDate = new Date();
resourceFactory.savingsResource.get({accountId: scope.accountId, template: 'true', associations: 'charges'}, function (data) {
resourceFactory.savingsResource.get({accountId: scope.accountId, template: 'true', associations: 'charges',staffInSelectedOfficeOnly:'true'}, function (data) {
scope.data = data;
scope.charges = data.charges || [];
if (scope.charges) {