Skip to content

Commit

Permalink
address_module
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpawar committed Oct 25, 2016
1 parent dc7e2bf commit 7930e3c
Show file tree
Hide file tree
Showing 13 changed files with 1,147 additions and 7 deletions.
50 changes: 50 additions & 0 deletions app/global-translations/locale-en.json 100755 → 100644
Expand Up @@ -12,6 +12,18 @@
"label.heading.equityaccount": "Equity Account",
"label.heading.allowdividendsforinactiveclients": "Allow dividends for inactive clients",
"label.heading.name": "Name",
"label.heading.alias":"Alias",
"label.heading.cbid":"Credit Bureau ID",
"label.heading.country":"Country",
"label.heading.cbName":"Credit Bureau Name",
"label.heading.cbproduct":"Credit Product",
"label.heading.cbsummary":"Credit Bureau (Name-Product-Country)",
"label.heading.is_creditcheck_mandatory":"is creditcheck mandatory?",
"label.heading.skip_credit_check_in_failure":"skip credit check in failure?",
"label.heading.stale_period":"stale_period",
"label.heading.startdate":"Start Date",
"label.heading.enddate":"End Date",
"label.heading.is_active":"is_active",
"label.heading.accnum": "Account #",
"label.heading.staff": "Staff",
"label.heading.office": "Office",
Expand Down Expand Up @@ -179,6 +191,7 @@
"label.input.notes": "Notes",
"label.input.externalid": "External id",
"label.input.active": "Active",
"label.input.is_active":"is Active ?",
"label.input.assignstaff": "Assign staff",
"label.input.closuredate": "Closure date",
"label.input.closurereason": "Closure reason",
Expand Down Expand Up @@ -225,6 +238,8 @@
"label.button.searchdata": "Search Data",
"label.button.cancel": "Cancel",
"label.button.edit": "Edit",
"label.button.addcb": "Add credit Bureau",
"label.button.mapcblp": "Map credit Bureau to Loan Product",
"label.button.delete": "Delete",
"label.button.confirm": "Confirm",
"label.button.unassignstaff": "Unassign Staff",
Expand Down Expand Up @@ -557,6 +572,7 @@
"#Clients": "....",

"#Headings": "..",
"label.heading.address":"Address",
"label.heading.identities": "Identities",
"label.heading.uniqueidentification": "Unique ID #",
"label.heading.identitydocs": "Identity Documents",
Expand Down Expand Up @@ -1438,6 +1454,7 @@
"label.input.applicationdate" : "Application Date",

"#Buttons": "..",
"label.button.addAddress":"Add Address",
"label.button.addloancharge": "Add Loan Charge",
"label.button.addcollateral": "Add Collateral",
"label.button.guarantor": "Guarantor",
Expand Down Expand Up @@ -2584,10 +2601,26 @@
"label.anchor.editAccountNumberPreferences":"Edit Account Number Preferences",
"label.anchor.viewEntityMapping":"Entity Mapping",
"label.anchor.externalServices":"External Services",
"label.anchor.addressConfiguration":"Address configuration",
"label.anchor.fieldconfiguration":"Entity Field Configuration",


"#Inputs": "..",
"label.input.addressType":"Address Type",
"label.input.clientIdNameOffice":"Client Id-Name-Office",
"label.input.street":"Street",
"label.input.addressline1":"Address Line 1",
"label.input.addressline2":"Address Line 2",
"label.input.addressline3":"Address Line 3",
"label.input.city":"City",
"label.input.town_village":"Town / Village",
"label.input.county_district":"County / District",
"label.input.state_province":"State / Province",
"label.input.postal_code":"Postal Code",
"label.input.latitude":"Latitude",
"label.input.longitude":"Longitude",
"label.input.entity": "Entity",
"label.input.alias":"Alias",
"label.input.type": "Type",
"label.input.templatename": "Template name",
"label.input.mapperkey": "Mapper key",
Expand Down Expand Up @@ -3907,17 +3940,34 @@


"label.externalServices":"External Services Configuration",
"label.input.alias":"Alias",
"label.input.country":"Country",
"label.input.creditbureau":"Credit Bureau name",
"label.input.isCreditCheckMandatory":"Is credit check mandatory?",
"label.input.skipcreditcheckinfailure":"skip credit check in the event of failure",
"label.input.stale":" No of days for Credit Check to be considered as stale",
"label.input.cbproduct":"Product",
"label.input.start_date":"Start Date",
"label.input.end_date":"End Date",
"label.S3.description":"S3 Amazon Service Configuration",
"label.SMTP.description":"Email Service Configuration",
"label.CreditBureau.description":"Credit Bureau Integration",
"label.anchor.editExternalServicesConfiguration":"Edit External Service Configuration",
"label.anchor.addnewcb":"Add New Credit Bureau",
"label.anchor.mapcblp":"Map Credit Bureau to Loan Product",
"label.anchor.cbconfigured":"Credit Bureaus available for mapping",
"label.anchor.cblpmapping":"Credit Bureau - Loan Product Mapping",
"label.anchor.viewexternalservices":"View External Service Configuration",
"label.anchor.viewCreditBureauSummary":"View Credit Bureau configuration Summary",
"label.anchor.":"View External Service Configuration",
"label.anchor.S3":"S3 Amazon Service",
"label.anchor.SMTP":"Email Service",
"error.msg.externalservice.servicename.invalid": "Service Name `{{params[0].value}}` does not exist.",
"error.msg.externalservice.property.invalid": "Parameter `{{params[0].value}}` does not exist for the ServiceName `{{params[1].value}}`.",
"error.msg.configuration.id.not.modifiable": "Unable to modify this configuration as it is a trap door configuration.",

"label.heading.Survey":"Survey",
"label.heading.addnewcb":"Configure new Credit Bureau",
"label.anchor.survey":"Survey",
"label.surveyName":"Survey Name",
"label.selectsurvey":"Select Survey",
Expand Down
129 changes: 129 additions & 0 deletions app/scripts/controllers/client/CreateClientController.js
Expand Up @@ -15,6 +15,17 @@
scope.forceOffice = null;
scope.showNonPersonOptions = false;
scope.clientPersonId = 1;
//address
scope.addressTypes=[];
scope.countryOptions=[];
scope.stateOptions=[];
scope.addressTypeId={};
entityname="ADDRESS";
scope.addressArray=[];
scope.formData.address=[];




var requestParams = {staffInSelectedOfficeOnly:true};
if (routeParams.groupId) {
Expand Down Expand Up @@ -51,8 +62,58 @@
scope.formData.staffId = data.staffId;
}
}


scope.enableAddress=data.isAddressEnabled;

if(scope.enableAddress===true)
{
scope.addressTypes=data.address.addressTypeIdOptions;
scope.countryOptions=data.address.countryIdOptions;
scope.stateOptions=data.address.stateProvinceIdOptions;

resourceFactory.addressFieldConfiguration.get({entity:entityname},function(data){



for(var i=0;i<data.length;i++)
{
data[i].field='scope.'+data[i].field;
eval(data[i].field+"="+data[i].is_enabled);

}





})


}

});

// address

scope.addAddress=function()
{
scope.addressArray.push({});
}

scope.removeAddress=function(index)
{
scope.addressArray.splice(index,1);
}




// end of address




scope.displayPersonOrNonPersonOptions = function (legalFormId) {
if(legalFormId == scope.clientPersonId || legalFormId == null) {
scope.showNonPersonOptions = false;
Expand Down Expand Up @@ -127,6 +188,74 @@
this.formData.savingsProductId = null;
}

if(scope.enableAddress===true)
{
for(var i=0;i<scope.addressArray.length;i++)
{
var temp=new Object();
if(scope.addressArray[i].addressTypeId)
{
temp.addressTypeId=scope.addressArray[i].addressTypeId;
}
if(scope.addressArray[i].street)
{
temp.street=scope.addressArray[i].street;
}
if(scope.addressArray[i].addressLine1)
{
temp.addressLine1=scope.addressArray[i].addressLine1;
}
if(scope.addressArray[i].addressLine2)
{
temp.addressLine2=scope.addressArray[i].addressLine2;
}
if(scope.addressArray[i].addressLine3)
{
temp.addressLine3=scope.addressArray[i].addressLine3;
}
if(scope.addressArray[i].townVillage)
{
temp.townVlage=scope.addressArray[i].townVillage;
}
if(scope.addressArray[i].city)
{
temp.city=scope.addressArray[i].city;
}
if(scope.addressArray[i].countyDistrict)
{
temp.countyDistrict=scope.addressArray[i].countyDistrict;
}
if(scope.addressArray[i].countryId)
{
temp.countryId=scope.addressArray[i].countryId;
}
if(scope.addressArray[i].stateProvinceId)
{
temp.stateProvinceId=scope.addressArray[i].stateProvinceId;
}
if(scope.addressArray[i].postalCode)
{
temp.postalCode=scope.addressArray[i].postalCode;
}
if(scope.addressArray[i].latitude)
{
temp.latitude=scope.addressArray[i].latitude;
}
if(scope.addressArray[i].longitude)
{
temp.longitude=scope.addressArray[i].longitude;
}
if(scope.addressArray[i].isActive)
{
temp.isActive=scope.addressArray[i].isActive;

}
scope.formData.address.push(temp);
}
}



resourceFactory.clientResource.save(this.formData, function (data) {
location.path('/viewclient/' + data.clientId);
});
Expand Down
82 changes: 78 additions & 4 deletions app/scripts/controllers/client/ViewClientController.js
Expand Up @@ -12,6 +12,80 @@
scope.openShares = true ;
scope.updateDefaultSavings = false;
scope.charges = [];


// address
scope.addresses=[];
scope.view={};
scope.view.data=[];
var entityname="ADDRESS";
formdata={};


resourceFactory.clientTemplateResource.get(function(data)
{
scope.enableAddress=data.isAddressEnabled;
if(scope.enableAddress===true)
{

resourceFactory.addressFieldConfiguration.get({entity:entityname},function(data){


for(var i=0;i<data.length;i++)
{
data[i].field='scope.view.'+data[i].field;
eval(data[i].field+"="+data[i].is_enabled);

}


})


resourceFactory.clientAddress.get({clientId:routeParams.id},function(data)
{

scope.addresses=data;


})


}

});




scope.routeTo=function()
{
location.path('/address/'+ routeParams.id);
}

scope.ChangeAddressStatus=function(id,status,addressId)
{

formdata.isActive=!status
formdata.addressId=addressId
resourceFactory.clientAddress.put({clientId:id},formdata,function(data)
{
route.reload();
})
}

scope.routeToEdit=function(clientId,addressId)
{
location.path('/editAddress/'+clientId+'/'+addressId+'/'+ routeParams.id);


}


// end of address



scope.routeToLoan = function (id) {
location.path('/viewloanaccount/' + id);
};
Expand Down Expand Up @@ -85,7 +159,7 @@
}
}


var clientStatus = new mifosX.models.ClientStatus();

if (clientStatus.statusKnown(data.status.value)) {
Expand Down Expand Up @@ -329,7 +403,7 @@
}
}
});

resourceFactory.clientChargesResource.getCharges({clientId: routeParams.id, pendingPayment:true}, function (data) {
scope.charges = data.pageItems;
});
Expand Down Expand Up @@ -625,12 +699,12 @@
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
}
};

}
});

mifosX.ng.application.controller('ViewClientController', ['$scope', '$routeParams', '$route', '$location', 'ResourceFactory', '$http', '$modal', 'API_VERSION', '$rootScope', '$upload', mifosX.controllers.ViewClientController]).run(function ($log) {
$log.info("ViewClientController initialized");
});
}(mifosX.controllers || {}));
}(mifosX.controllers || {}));

0 comments on commit 7930e3c

Please sign in to comment.