small issues : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-12-21 16:46:26 +05:30
parent 5923055a6b
commit b499970aa9
8 changed files with 131 additions and 84 deletions

View File

@ -146,11 +146,11 @@
</mat-select>
</mat-form-field>
</div>
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
<div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 ">
<mat-form-field>
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<!-- </div> -->
</div>
<div fxFlex="33" >
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off">

View File

@ -31,6 +31,7 @@ export class AssetsInfoComponent implements OnInit {
pageTitle: string ="Assets Details";
//@Input() pdid: number;
pdid:string;
businessProfessionName :string;
public _assetsQuesFrom: FormGroup;
public submitted = false;
@ -198,7 +199,8 @@ public m_investmentType = [];
ngOnInit() {
this.getPdSupplierFormDetails();
this.getOwnerName();
this.getM_Assets_Type();
this.getM_PropertyType();
this.getM_InvestmentType();
@ -208,6 +210,11 @@ public m_investmentType = [];
}
// ======================
getOwnerName(){
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
});
}
getM_Assets_Type() {
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
@ -361,7 +368,7 @@ public m_investmentType = [];
business_assets_mode: ['', Validators.compose([Validators.required])],
business_details: this._formBuilder.array([]),
business_approximate_market_value: ['', Validators.compose([])],
business_name_of_the_owner: ['', Validators.compose([])],
business_name_of_the_owner: [this.businessProfessionName, Validators.compose([])],
// other_owner:[''],
// relation:[''],
// purchase_year: ['', Validators.compose([])],
@ -556,7 +563,7 @@ public m_investmentType = [];
loadInvestDescriptionWithData(data) {
return this._formBuilder.group({
investments_type: [data.investments_type, Validators.compose([Validators.required])],
other_investment_type : [data.other_investment_type],
other_investments_type : [data.other_investments_type],
amount_of_invest: [data.amount_of_invest, Validators.compose([Validators.required])],
bank_name: [data.bank_name, Validators.compose([Validators.required])]
});

View File

@ -46,7 +46,7 @@
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" >
<input matInput [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" required>
</mat-form-field>
<mat-form-field>

View File

@ -103,7 +103,8 @@ export class CurrentLoanComponent implements OnInit {
}
}
} else {
control.push(this.createLoanDetail());
// console.log('overall else');
// control.push(this.createLoanDetail());
}
})
}
@ -116,10 +117,13 @@ export class CurrentLoanComponent implements OnInit {
}
selectedLoanChanges(e): void {
console.log(e);
if (e.value == 'Yes') {
// console.log('if()');
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
control.push(this.createLoanDetail());
} else if (e.value == 'No') {
// console.log('else()');
const arr = <FormArray>this.currentLoanForm.controls.loan_details;
arr.removeAt(0);
}

View File

@ -135,7 +135,7 @@
<input matInput placeholder="Net Loss" formControlName="estimate_net_loss" (change)="calMarginVal( i, details); calVariation( i, details)" required>
</mat-form-field>
<mat-form-field>
<input matInput disabled placeholder="Margin" formControlName="estimate_margin_of_loss" (keypress)="keyPress($event)" (change)="calAmount( i, details); calVariation( i, details)" required>
<input matInput disabled placeholder="Margin" formControlName="estimate_margin_of_loss" (keypress)="keyPress($event)" (change)="calAmount(i, details); calVariation( i, details)" required>
</mat-form-field>
</span>
<mat-form-field *ngIf="i != 0" style="width:65%">

View File

@ -50,7 +50,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{rawValueInWords}} Only</mat-hint> (keyup)="inWords($event,1)" -->
<mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords}} Only</mat-hint> (keyup)="inWords($event,1)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" required>
@ -97,7 +97,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{goodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,2)" -->
<mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,2)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
@ -145,7 +145,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)" -->
<mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
@ -205,7 +205,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,2)" -->
<mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,4)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
@ -254,7 +254,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)" -->
<mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,5)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
@ -315,7 +315,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,2)" -->
<mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,6)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
@ -365,7 +365,7 @@
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
<!-- <mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{tradedGoodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,3)" -->
<mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,7)"
</mat-form-field>
<mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
@ -399,6 +399,13 @@
</div>
</mat-card>
<mat-card *ngIf="serviceProviderForm">
<mat-card-header>
<p>Service Provider</p>
</mat-card-header>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>
</mat-card>
</div>
</div>

View File

@ -40,14 +40,23 @@ export class StockComponent implements OnInit {
public uomData : any = [];
rawmaterial : any;
goodsValueInWords : any;
rawValueInWords : any;
tradedGoodsValueInWords : any;
M_rawValueInWords : any;
M_goodsValueInWords : any;
R_goodsValueInWords : any;
T_goodsValueInWords : any;
M_tradedGoodsValueInWords : any;
R_tradedGoodsValueInWords : any;
T_tradedGoodsValueInWords : any;
rawMaterialAccess: boolean;
finishedGoodsAccess: boolean;
tradeConcernAccess: boolean;
public submitted = false;
noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -85,37 +94,27 @@ export class StockComponent implements OnInit {
// this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!');
// })
this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
// if(data.dataStatus === undefined){
let datas = {
"profession_name": "Others",
"type_of_activity": [
{
"type_of_activity_id": 1,
"name": "Manufacturing Details"
},
{
"type_of_activity_id": 2,
"name": "Retail trading"
},
{
"type_of_activity_id": 3,
"name": "Trading Concern"
},
{
"type_of_activity_id": 4,
"name": "Service Provider"
}
]
};
this.initstockForms(datas.type_of_activity);
// }else {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.noRecordsFound = false;
// }
//this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => {
if(data.dataStatus == true){
let datas = data.records;
if(datas.type_of_activity != undefined){
this.initstockForms(datas.type_of_activity)
}
else{
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
}
}else if(data.dataStatus == false)
{
this.notifier.notify('warning', data.msg);
return;
}
else{
return;
}
}, err => {
this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!');
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
this.noRecordsFound = false;
})
@ -133,7 +132,7 @@ export class StockComponent implements OnInit {
let dataForm = value.records;
if(dataForm !== undefined) {
console.log('dtaForm',dataForm);
this.stockForms = this.fb.group({
pdid: [this.pdid],
formid: [this.form_id],
@ -142,7 +141,12 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr0 = Object.keys(record).map(function (key) {
return record[key];
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
let retail_finished_goods;
let manufacturing_raw_materials;
@ -175,7 +179,7 @@ export class StockComponent implements OnInit {
manufacturing_temparr['manufacturing_traded_goods'] = manufacturing_traded_goods;manufacturing_temparr['manufacturing_finished_goods'] = manufacturing_finished_goods;manufacturing_temparr['manufacturing_raw_materials'] = manufacturing_raw_materials;
this.initManufacturingDetails(manufacturing_temparr);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2);
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
let retail_finished_goods;
let retail_traded_goods;
@ -199,7 +203,7 @@ export class StockComponent implements OnInit {
retail_temparr['retail_finished_goods'] = retail_finished_goods;
this.initRetailDetails(retail_temparr);
}
let arr2 = record.filter(data => data.type_of_activity_id === 3);
let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) {
let trading_finished_goods;
let trading_traded_goods;
@ -223,10 +227,14 @@ export class StockComponent implements OnInit {
trading_temparr['trading_traded_goods'] = trading_traded_goods;
this.initTradingDetails(trading_temparr);
}
let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) {
this.serviceProviderForm = true;
}
this.noRecordsFound = true;
}
else{
console.log('dataForm',dataForm);
// console.log('dataForm',dataForm);
this.stockForms = this.fb.group({
pdid: [this.pdid],
formid: [this.form_id],
@ -235,21 +243,21 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingDetails(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2);
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
this.initRetailDetails(null);
}
let arr2 = record.filter(data => data.type_of_activity_id === 3);
let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) {
this.initTradingDetails(null);
}
let arr3 = record.filter(data => data.type_of_activity_id === 4);
let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) {
//this.serviceProviderForm = true;
this.serviceProviderForm = true;
}
this.noRecordsFound = true;
}
@ -263,21 +271,21 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]),
});
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingDetails(null);
}
let arr1 = record.filter(data => data.type_of_activity_id === 2);
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
this.initRetailDetails(null);
}
let arr2 = record.filter(data => data.type_of_activity_id === 3);
let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) {
this.initTradingDetails(null);
}
let arr3 = record.filter(data => data.type_of_activity_id === 4);
let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) {
//this.serviceProviderForm = true;
this.serviceProviderForm = true;
}
this.noRecordsFound = true;
}
@ -292,8 +300,8 @@ export class StockComponent implements OnInit {
}
manufacturingForm: Boolean = false;
manufacturingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 1);
manufacturingFormCreation(record) {
let arr = record.filter(data => data.type_of_activity_id == 1);
if (arr.length > 0) {
this.manufacturingForm = true;
return this.fb.group({
@ -309,7 +317,8 @@ export class StockComponent implements OnInit {
retailForm: Boolean = false;
retailFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 2);
let arr = val.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) {
this.retailForm = true;
return this.fb.group({
@ -324,7 +333,7 @@ export class StockComponent implements OnInit {
tradingForm: Boolean = false;
tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 3);
let arr = val.filter(data => data.type_of_activity_id == 3);
if (arr.length > 0) {
this.tradingForm = true;
return this.fb.group({
@ -350,32 +359,32 @@ export class StockComponent implements OnInit {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
console.log(299,'if');
// console.log(299,'if');
// rawMaterial.push(this.createRawmaterial(null));
// finishedGoods.push(this.createGoods(null));
// tradedGoods.push(this.createTradedGoods(null));
} else {
console.log(305,'else')
// console.log(305,'else')
for (let val of datas.manufacturing_raw_materials) {
console.log(val);
// console.log(val);
rawMaterial.push(this.createRawmaterial(val));
}
for (let val of datas.manufacturing_finished_goods) {
console.log(val);
// console.log(val);
finishedGoods.push(this.createGoods(val));
}
for (let val of datas.manufacturing_traded_goods) {
console.log(val);
// console.log(val);
tradedGoods.push(this.createTradedGoods(val));
}
console.log(310,rawMaterial);
// console.log(310,rawMaterial);
}
}
@ -439,13 +448,13 @@ export class StockComponent implements OnInit {
} else {
for (let val of datas.retail_finished_goods) {
console.log(val);
// console.log(val);
finishedGoods.push(this.createGoods(val));
}
for (let val of datas.retail_traded_goods) {
console.log(val);
// console.log(val);
tradedGoods.push(this.createTradedGoods(val));
}
@ -521,13 +530,13 @@ export class StockComponent implements OnInit {
// }
for (let val of datas.trading_finished_goods) {
console.log(val);
// console.log(val);
finishedGoods.push(this.createGoods(val));
}
for (let val of datas.trading_traded_goods) {
console.log(val);
// console.log(val);
tradedGoods.push(this.createTradedGoods(val));
}
@ -751,13 +760,25 @@ export class StockComponent implements OnInit {
inWords(e,flag:number){
switch(flag){
case 1 :
this.rawValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 3 :
this.tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 4 :
this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 5 :
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 6 :
this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;

View File

@ -82,10 +82,18 @@
<mat-list *ngFor="let applicant of pdApplicantData">
<mat-list-item style="height:68px !important;">
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-user-o"></i>
&nbsp;{{applicant.applicant_name}} </span> &nbsp;&nbsp;&nbsp;<span *ngIf="applicant.mobile_no!=''" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
&nbsp;{{applicant.mobile_no}} </span> <br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span>
<i class="fa-1x fa fa-user-o"></i>
&nbsp;{{applicant.applicant_name}}
</span> &nbsp;&nbsp;&nbsp;
<span *ngIf="applicant.mobile_no != '' && applicant.mobile_no != null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
&nbsp;{{applicant.mobile_no}}
</span> &nbsp;&nbsp;&nbsp;
<span *ngIf="applicant.landline != '' && applicant.landline != 'null-null' && applicant.landline != null " class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
&nbsp;{{applicant.landline}}
</span>
<br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span>
<ng-template #codetails><span>{{applicant.relation_name}}</span></ng-template>
</p>
</mat-list-item>