address_module

This commit is contained in:
nikpawar89 2016-07-19 11:47:34 +05:30
parent dc7e2bf490
commit 7930e3c0cc
13 changed files with 1147 additions and 7 deletions

50
app/global-translations/locale-en.json Executable file → Normal file
View File

@ -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",
@ -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",
@ -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",
@ -557,6 +572,7 @@
"#Clients": "....",
"#Headings": "..",
"label.heading.address":"Address",
"label.heading.identities": "Identities",
"label.heading.uniqueidentification": "Unique ID #",
"label.heading.identitydocs": "Identity Documents",
@ -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",
@ -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",
@ -3907,10 +3940,26 @@
"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.",
@ -3918,6 +3967,7 @@
"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",

View File

@ -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) {
@ -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;
@ -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);
});

View File

@ -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);
};
@ -85,7 +159,7 @@
}
}
var clientStatus = new mifosX.models.ClientStatus();
if (clientStatus.statusKnown(data.status.value)) {
@ -329,7 +403,7 @@
}
}
});
resourceFactory.clientChargesResource.getCharges({clientId: routeParams.id, pendingPayment:true}, function (data) {
scope.charges = data.pageItems;
});
@ -625,7 +699,7 @@
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
}
};
}
});
@ -633,4 +707,4 @@
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 || {}));

View File

@ -0,0 +1,85 @@
(function (module) {
mifosX.controllers = _.extend(module, {
AddressFormController: function ($scope, resourceFactory, routeParams, location) {
$scope.formData={};
$scope.addressTypes=[];
$scope.countryOptions=[];
$scope.stateOptions=[];
$scope.addressTypeId={};
entityname="ADDRESS";
$scope.editable=false;
clientId=routeParams.id;
resourceFactory.clientaddressFields.get(function(data){
$scope.addressTypes=data.addressTypeIdOptions;
$scope.countryOptions=data.countryIdOptions;
$scope.stateOptions=data.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);
}
})
$scope.routeTo=function()
{
location.path('/viewclient/'+clientId);
}
$scope.isEditRequired=function(addType)
{
resourceFactory.clientAddress.get({type:addType,clientId:routeParams.id,status:true},function(data)
{
if(data[0]) // index is added just to sense whether it is empty or contains data
{
$scope.editable=true;
}
else
{
$scope.editable=false;
}
})
}
$scope.updateaddress=function()
{
$scope.formData.locale="en";
resourceFactory.clientAddress.put({'clientId': routeParams.id,'type':$scope.addressTypeId},$scope.formData,function (data) {
location.path('/viewclient/'+routeParams.id);
});
}
$scope.submit = function () {
resourceFactory.clientAddress.save({'clientId': routeParams.id,'type':$scope.addressTypeId},$scope.formData,function (data) {
location.path('/viewclient/'+clientId);
});
};
}
});
mifosX.ng.application.controller('AddressFormController', ['$scope','ResourceFactory', '$routeParams', '$location', mifosX.controllers.AddressFormController]).run(function ($log) {
$log.info("AddressFormController initialized");
});
}
(mifosX.controllers || {}));

View File

@ -0,0 +1,146 @@
(function (module) {
mifosX.controllers = _.extend(module, {
EditAddressController: function ($scope, resourceFactory, routeParams, location) {
$scope.formData={};
$scope.addressTypes=[];
$scope.countryOptions=[];
$scope.stateOptions=[];
$scope.addressTypeId={};
$scope.clients={};
$scope.addressType={};
entityname="ADDRESS";
$scope.addStatus="";
$scope.editable=false;
clientId=routeParams.clientId;
addresstypid=routeParams.addrType;
isActive={};
var addressId=routeParams.addrId;
resourceFactory.clientaddressFields.get(function(data){
$scope.addressTypes=data.addressTypeIdOptions;
$scope.countryOptions=data.countryIdOptions;
$scope.stateOptions=data.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);
}
})
$scope.routeTo=function()
{
location.path('/viewclient/'+clientId);
}
resourceFactory.clientAddress.get({type:addresstypid,clientId:clientId},function(data)
{
$scope.editable=true;
for(var i=0;i<data.length;i++)
{
if(data[i].addressId==addressId)
{
if(data[i].street&&$scope.street)
{
$scope.formData.street=data[i].street;
}
if(data[i].addressLine1&&$scope.addressLine1)
{
$scope.formData.addressLine1=data[i].addressLine1;
}
if(data[i].addressLine2&&$scope.addressLine2)
{
$scope.formData.addressLine2=data[i].addressLine2;
}
if(data[i].addressLine3&&$scope.addressLine3)
{
$scope.formData.addressLine3=data[i].addressLine3;
}
if(data[i].townVillage&&$scope.townVillage)
{
$scope.formData.townVillage=data[i].townVillage;
}
if(data[i].city&&$scope.city)
{
$scope.formData.city=data[i].city;
}
if(data[i].countyDistrict&&$scope.countyDistrict)
{
$scope.formData.countyDistrict=data[i].countyDistrict;
}
if(data[i].stateProvinceId&&$scope.stateProvinceId)
{
$scope.formData.stateProvinceId=data[i].stateProvinceId;
}
if(data[i].countryId&&$scope.countryId)
{
$scope.formData.countryId=data[i].countryId;
}
if(data[i].postalCode&&$scope.postalCode)
{
$scope.formData.postalCode=data[i].postalCode;
}
if(data[i].latitude&&$scope.latitue)
{
$scope.formData.latitude=data[i].latitude;
}
if(data[i].longitude&&$scope.longitude)
{
$scope.formData.longitude=data[i].longitude;
}
if(data[i].isActive&&$scope.isActive)
{
isActive=data[i].isActive;
}
}
}
});
$scope.updateaddress=function()
{
$scope.formData.locale="en";
$scope.formData.addressId=addressId;
resourceFactory.clientAddress.put({'clientId': clientId},$scope.formData,function (data) {
location.path('/viewclient/'+clientId);
});
}
}
});
mifosX.ng.application.controller('EditAddressController', ['$scope','ResourceFactory', '$routeParams', '$location', mifosX.controllers.EditAddressController]).run(function ($log) {
$log.info("EditAddressController initialized");
});
}
(mifosX.controllers || {}));

View File

@ -280,7 +280,9 @@ define(['Q', 'underscore', 'mifosX'], function (Q) {
'product/tax/CreateTaxGroupController',
'product/tax/ViewTaxGroupController',
'product/tax/EditTaxGroupController',
'product/tax/TaxGroupController'
'product/tax/TaxGroupController',
'configurations/EditAddressController',
'configurations/AddressFormController'
],
filters: [
'StatusLookup',

View File

@ -887,6 +887,12 @@
.when('/loanforeclosure/:id', {
templateUrl: 'views/loans/loanforeclosure.html'
})
.when('/address/:id', {
templateUrl: 'views/administration/AddressForm.html'
})
.when('/editAddress/:addrType/:addrId/:clientId',{
templateUrl: 'views/administration/EditAddress.html'
})
;
$locationProvider.html5Mode(false);
};

View File

@ -409,6 +409,9 @@
get: {method: 'GET', params: {}},
update: {method: 'PUT', params: {}}
}),
configurationResourceByName: defineResource(apiVer + "/configurations/", {configName: '@configName'}, {
get: {method: 'GET', params: {configName:'configName'}}
}),
cacheResource: defineResource(apiVer + "/caches", {}, {
get: {method: 'GET', params: {}, isArray: true},
update: {method: 'PUT', params: {}}
@ -524,6 +527,19 @@
get: {method: 'GET', params: {}, isArray : true},
put: {method: 'PUT', params:{}}
}),
clientaddressFields:defineResource(apiVer+"/client/addresses/template",{},{
get:{method:'GET',params:{}}
}
),
addressFieldConfiguration:defineResource(apiVer+"/fieldconfiguration/:entity",{},{
get:{method:'GET',params:{},isArray:true }
}),
clientAddress:defineResource(apiVer+"/client/:clientId/addresses",{},{
post:{method:'POST',params:{type:'@type'}},
get:{method:'GET',params:{type:'@type',status:'@status'},isArray:true},
put:{method:'PUT',params:{}}
}),
provisioningcriteria: defineResource(apiVer + "/provisioningcriteria/:criteriaId",{criteriaId:'@criteriaId'},{
get: {method: 'GET',params:{}},
getAll: {method: 'GET',params:{}, isArray : true},

View File

@ -0,0 +1,161 @@
<div ng-controller="AddressFormController">
<form name="FieldConfiguration" novalidate="" class="form-horizontal well" >
<api-validate></api-validate>
<fieldset>
<div class="form-group" ng-show="addressType">
<div class="control-label col-sm-2">
<label>{{ 'label.input.addressType' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="addressTypes" id="addressType" ng-change="isEditRequired(addressTypeId)" ng-model="addressTypeId" class="form-control"
ng-options="addressType.id as addressType.name for addressType in addressTypes track by addressType.id"
value="addressTypeId" ></select>
</div>
</div>
<div class="form-group" ng-show="street">
<label class="control-label col-sm-2" for="street">{{ 'label.input.street' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="street" name="street" ng-model="formData.street" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine1">
<label class="control-label col-sm-2" for="addressline1">{{ 'label.input.addressline1' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline1" name="addressline1" ng-model="formData.addressLine1" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine2">
<label class="control-label col-sm-2" for="addressline2">{{ 'label.input.addressline2' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline2" name="addressline2" ng-model="formData.addressLine2" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine3">
<label class="control-label col-sm-2" for="addressline3">{{ 'label.input.addressline3' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline3" name="addressline3" ng-model="formData.addressLine3" class="form-control">
</div>
</div>
<div class="form-group" ng-show="city">
<label class="control-label col-sm-2" for="city">{{ 'label.input.city' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="city" name="city" ng-model="formData.city" class="form-control">
</div>
</div>
<div class="form-group" ng-show="townVillage">
<label class="control-label col-sm-2" for="town_village">{{ 'label.input.town_village' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="town_village" name="town_village" ng-model="formData.townVillage" class="form-control">
</div>
</div>
<div class="form-group" ng-show="countyDistrict">
<label class="control-label col-sm-2" for="county_district">{{ 'label.input.county_district' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="county_district" name="county_district" ng-model="formData.countyDistrict" class="form-control">
</div>
</div>
<div class="form-group" ng-show="stateProvinceId">
<div class="control-label col-sm-2">
<label>{{ 'label.input.state_province' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="stateOptions" id="stateOption" ng-model="formData.stateProvinceId" class="form-control"
ng-options="stateOption.id as stateOption.name for stateOption in stateOptions track by stateOption.id"
value="formData.state_province_id"></select>
</div>
</div>
<div>
</div>
<div class="form-group" ng-show="country">
<div class="control-label col-sm-2">
<label>{{ 'label.input.country' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="countryOptions" id="countryOption" ng-model="formData.countryId" class="form-control"
ng-options="countryOption.id as countryOption.name for countryOption in countryOptions track by countryOption.id"
value="formData.countryId"></select>
</div>
</div>
<div class="form-group" ng-show="postalCode">
<label class="control-label col-sm-2" for="postal_code">{{ 'label.input.postal_code' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="postal_code" name="postal_code" ng-model="formData.postalCode" class="form-control">
</div>
</div>
<div class="form-group" ng-show="latitude">
<label class="control-label col-sm-2" for="latitude">{{ 'label.input.latitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="latitude" name="latitude" ng-model="formData.latitude" class="form-control">
</div>
</div>
<div class="form-group" ng-show="longitude">
<label class="control-label col-sm-2" for="longitude">{{ 'label.input.longitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="longitude" name="longitude" ng-model="formData.longitude" class="form-control">
</div>
</div>
<div class="col-md-offset-3" ng-model="editable">
<button id="cancel" ng-click="routeTo()" class="btn btn-primary">{{
'label.button.cancel' | translate }}
</button>
<button id="save" type="submit" ng-disabled="editable" ng-click="submit()" class="btn btn-primary">{{
'label.button.save' | translate }}
</button>
</div>
</fieldset>
</form>
</div>

View File

@ -0,0 +1,158 @@
<div ng-controller="EditAddressController">
<form name="FieldConfiguration" novalidate="" class="form-horizontal well" >
<api-validate></api-validate>
<fieldset>
<div class="form-group" ng-show="street">
<label class="control-label col-sm-2" for="street">{{ 'label.input.street' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="street" name="street" ng-model="formData.street" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine1">
<label class="control-label col-sm-2" for="addressline1">{{ 'label.input.addressline1' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline1" name="addressline1" ng-model="formData.addressLine1" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine2">
<label class="control-label col-sm-2" for="addressline2">{{ 'label.input.addressline2' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline2" name="addressline2" ng-model="formData.addressLine2" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine3">
<label class="control-label col-sm-2" for="addressline3">{{ 'label.input.addressline3' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="addressline3" name="addressline3" ng-model="formData.addressLine3" class="form-control">
</div>
</div>
<div class="form-group" ng-show="city">
<label class="control-label col-sm-2" for="city">{{ 'label.input.city' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="city" name="city" ng-model="formData.city" class="form-control">
</div>
</div>
<div class="form-group" ng-show="townVillage">
<label class="control-label col-sm-2" for="town_village">{{ 'label.input.town_village' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="town_village" name="town_village" ng-model="formData.townVillage" class="form-control">
</div>
</div>
<div class="form-group" ng-show="countyDistrict">
<label class="control-label col-sm-2" for="county_district">{{ 'label.input.county_district' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="county_district" name="county_district" ng-model="formData.countyDistrict" class="form-control">
</div>
</div>
<div class="form-group" ng-show="stateProvinceId">
<div class="control-label col-sm-2">
<label>{{ 'label.input.state_province' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="stateOptions" id="stateOption" ng-model="formData.stateProvinceId" class="form-control"
ng-options="stateOption.id as stateOption.name for stateOption in stateOptions track by stateOption.id"
value="formData.stateProvinceId"></select>
</div>
</div>
<div>
</div>
<div class="form-group" ng-show="countryId">
<div class="control-label col-sm-2">
<label>{{ 'label.input.country' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="countryOptions" id="countryOption" ng-model="formData.countryId" class="form-control"
ng-options="countryOption.id as countryOption.name for countryOption in countryOptions track by countryOption.id"
value="formData.countryId"></select>
</div>
</div>
<div class="form-group" ng-show="postalCode">
<label class="control-label col-sm-2" for="postal_code">{{ 'label.input.postal_code' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="postal_code" name="postal_code" ng-model="formData.postalCode" class="form-control">
</div>
</div>
<div class="form-group" ng-show="latitude">
<label class="control-label col-sm-2" for="latitude">{{ 'label.input.latitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="latitude" name="latitude" ng-model="formData.latitude" class="form-control">
</div>
</div>
<div class="form-group" ng-show="longitude">
<label class="control-label col-sm-2" for="longitude">{{ 'label.input.longitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" id="longitude" name="longitude" ng-model="formData.longitude" class="form-control">
</div>
</div>
<!-- <div class="form-group" ng-show="isActive">
<label class="control-label col-sm-2" for="isActive">{{'label.input.is_active' | translate}} </label>
<div class="col-sm-3">
<input id="isActive" class="input-mini-small" type="checkbox"
ng-model="formData.is_active">
</div>
</div>-->
<div class="col-md-offset-3" ng-model="editable">
<button id="cancel" ng-click="routeTo()" class="btn btn-primary">{{
'label.button.cancel' | translate }}
</button>
<!-- <button id="save" type="submit" ng-hide="editable" ng-click="submit()" class="btn btn-primary">{{
'label.button.save' | translate }}
</button>-->
<button id="edit" ng-click="updateaddress()" class="btn btn-primary">{{
'label.button.edit' | translate }}
</button>
</div>
</fieldset>
</form>
</div>

View File

@ -279,6 +279,164 @@
</div>
</div>
</div>
<div ng-show="enableAddress" class="form-group">
<div class="form-group">
<div class="control-label col-sm-2">
<h3><strong>{{ 'label.input.address' | translate }}</strong>&nbsp;<a ng-click="addAddress()">&nbsp;<i class="icon-plus icon-white"></i></a></h3>
</div>
</div>
<div ng-repeat="addr in addressArray">
<div class="form-group" >
<div class="control-label col-sm-2">
<label>{{ 'label.input.addressType' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="addressTypes" ng-model="addressArray[$index].addressTypeId" class="form-control"
ng-options="addressType.id as addressType.name for addressType in addressTypes track by addressType.id"
value="addressTypeId" ></select>
</div>
&nbsp;&nbsp; <a ng-click="removeAddress($index)">&nbsp;<i class="icon-remove icon-white"></i></a>
</div>
<div class="form-group" ng-show="street">
<div class="control-label col-sm-2">
<label>{{ 'label.input.street' | translate }}</label>
</div>
<div class="col-sm-3">
<input type="text" name="street" ng-model="addressArray[$index].street" class="form-control"/>
</div>
</div>
<div class="form-group" ng-show="addressLine1">
<label class="control-label col-sm-2" >{{ 'label.input.addressline1' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="addressline1" ng-model="addressArray[$index].addressLine1" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine2">
<label class="control-label col-sm-2" >{{ 'label.input.addressline2' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="addressline2" ng-model="addressArray[$index].addressLine2" class="form-control">
</div>
</div>
<div class="form-group" ng-show="addressLine3">
<label class="control-label col-sm-2" >{{ 'label.input.addressline3' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="addressline3" ng-model="addressArray[$index].addressLine3" class="form-control">
</div>
</div>
<div class="form-group" ng-show="city">
<label class="control-label col-sm-2" >{{ 'label.input.city' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="city" ng-model="addressArray[$index].city" class="form-control">
</div>
</div>
<div class="form-group" ng-show="townVillage">
<label class="control-label col-sm-2" >{{ 'label.input.town_village' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="town_village" ng-model="addressArray[$index].townVillage" class="form-control">
</div>
</div>
<div class="form-group" ng-show="countyDistrict">
<label class="control-label col-sm-2" >{{ 'label.input.county_district' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="county_district" ng-model="addressArray[$index].countyDistrict" class="form-control">
</div>
</div>
<div class="form-group" ng-show="stateProvinceId">
<div class="control-label col-sm-2">
<label>{{ 'label.input.state_province' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="stateOptions" ng-model="addressArray[$index].stateProvinceId" class="form-control"
ng-options="stateOption.id as stateOption.name for stateOption in stateOptions track by stateOption.id"
value="stateProvinceId"></select>
</div>
</div>
<div>
</div>
<div class="form-group" ng-show="countryId">
<div class="control-label col-sm-2">
<label>{{ 'label.input.country' | translate }}</label>
</div>
<div class="col-sm-3" >
<select chosen="countryOptions" ng-model="addressArray[$index].countryId" class="form-control"
ng-options="countryOption.id as countryOption.name for countryOption in countryOptions track by countryOption.id"
value="countryId"></select>
</div>
</div>
<div class="form-group" ng-show="postalCode">
<label class="control-label col-sm-2" >{{ 'label.input.postal_code' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="postal_code" ng-model="addressArray[$index].postalCode" class="form-control">
</div>
</div>
<div class="form-group" ng-show="latitude">
<label class="control-label col-sm-2" >{{ 'label.input.latitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="latitude" ng-model="addressArray[$index].latitude" class="form-control">
</div>
</div>
<div class="form-group" ng-show="longitude">
<label class="control-label col-sm-2" >{{ 'label.input.longitude' | translate }}</label>
<div class="col-sm-3">
<input type="text" name="longitude" ng-model="addressArray[$index].longitude" class="form-control">
</div>
</div>
<div class="form-group" ng-show="isActive">
<label class="control-label col-sm-2" >{{'label.input.is_active' | translate}} </label>
<div class="col-sm-3">
<input class="input-mini-small" type="checkbox"
ng-model="addressArray[$index].isActive">
</div>
</div>
</div>
</div>
<div class="col-md-offset-5">
<a id="cancel" ng-href="{{cancel}}" class="btn btn-default">{{'label.button.cancel' | translate}}</a>
<button id="save" type="submit" class="btn btn-primary" ng-hide="blockUI" has-permission='CREATE_CLIENT'>{{'label.button.save' | translate}}</button>

View File

@ -19,7 +19,7 @@
{{ 'label.input.staff' | translate }}: {{client.staffName}}
</small>
</h3>
</div>
</div>
</div>
<script type="text/ng-template" id="deleteClient.html">
<div class="modal-header silver">
@ -610,6 +610,142 @@
</div>
</div>
</tab>
<tab ng-show="enableAddress" heading="{{'label.heading.address' | translate}}" >
<!--<fieldset>-->
<!-- <div ng-controller="AddressController">-->
<div ng-show="enableAddress">
<button class="btn btn-primary pull-right" ng-click="routeTo()"><i class="icon-plus icon-white"></i>{{'label.button.addAddress' | translate}}</button>
<br>
<table class="table" ng-repeat="address in addresses" class="table table-condensed">
<thead>
<tr class="graybg">
<th class="graybg"> {{address.addressType}}</th>
<td>
<button ng-click="ChangeAddressStatus(address.client_id,address.isActive,address.addressId)" data-ng-hide="address.isActive" class="btn btn-primary">
{{"label.button.enable" | translate}}
</button>
<button ng-click="ChangeAddressStatus(address.client_id,address.isActive,address.addressId)" data-ng-show="address.isActive" class="btn btn-primary">
{{"label.button.disable" | translate}}
</button>
<button class="btn btn-primary pull-right" ng-click="routeToEdit(address.addressTypeId,address.addressId)"><i class="icon-plus icon-white"></i>{{'label.button.edit' | translate}}</button>
</td>
</tr>
</thead>
<tbody>
<tr ng-show="view.street">
<th >
{{'label.input.street' | translate }}
</th>
<td>
{{address.street}}
</td>
</tr>
<tr ng-show="view.addressLine1">
<th>
{{'label.input.addressline1' | translate }}
</th>
<td>
{{address.addressLine1}}
</td>
</tr>
<tr ng-show="view.addressLine2">
<th >
{{'label.input.addressline2' | translate }}
</th>
<td>
{{address.addressLine2}}
</td>
</tr>
<tr ng-show="view.addressLine3">
<th >
{{'label.input.addressline3' | translate }}
</th>
<td>
{{address.addressLine3}}
</td>
</tr>
<tr ng-show="view.city">
<th >
{{ 'label.input.city' | translate }}
</th>
<td>
{{address.city}}
</td>
</tr>
<tr ng-show="view.townVillage">
<th >
{{'label.input.town_village' | translate }}
</th>
<td>
{{address.townVillage}}
</td>
</tr>
<tr ng-show="view.countyDistrict">
<th >
{{ 'label.input.county_district' | translate }}
</th>
<td>
{{address.countyDistrict}}
</td>
</tr>
<tr ng-show="view.stateProvinceId">
<th>
{{ 'label.input.state_province' | translate }}
</th>
<td>
{{address.stateName}}
</td>
</tr>
<tr ng-show="view.countryId">
<th >
{{ 'label.input.country' | translate }}
</th>
<td>
{{address.countryName}}
</td>
</tr>
<tr ng-show="view.postalCode">
<th >
{{ 'label.input.postal_code' | translate }}
</th>
<td>
{{address.postalCode}}
</td>
</tr>
<tr ng-show="view.latitude">
<th >
{{ 'label.input.latitude' | translate }}
</th>
<td>
{{address.latitude}}
</td>
</tr>
<tr ng-show="view.longitude">
<th >
{{ 'label.input.longitude' | translate }}
</th>
<td>
{{address.longitude}}
</td>
</tr>
<tr ng-show="view.isActive">
<th>
{{'label.input.is_active' | translate}}
</th>
<td>
{{address.isActive}}
</td>
</tr>
</tbody>
</table>
</div>
<!--</fieldset>-->
</tab>
<tab heading="{{'label.heading.identities' | translate}}" select="getClientIdentityDocuments()"
has-permission='READ_CLIENTIDENTIFIER'>
<div class="pull-right btn-group">

View File

@ -8,7 +8,26 @@ describe("ViewClientController", function () {
this.scope = {};
this.resourceFactory = {
addressFieldConfiguration:{
get:jasmine.createSpy('addressFieldConfiguration.get()').andCallFake(function(query, callback){
addressFieldConfigurationCallback=callback;
})
},
clientAddress:{
get:jasmine.createSpy('clientAddress.get()').andCallFake(function(query,callback){
clientAddressCallback=callback;
})
},
clientTemplateResource:{
get:jasmine.createSpy('clientTemplateResource.get()').andCallFake(function(query,callback){
clientTemplateResource=callback;
})
},
configurationResource:{
get:jasmine.createSpy('configurationResource.get()').andCallFake(function(query,callback){
configurationResourceCallback:callback;
})
},
clientResource: {
get: jasmine.createSpy('clientResource.get()').andCallFake(function (query, callback) {
clientResourceCallback = callback;