@@ -418,89 +270,13 @@
-
+
-
-
+
Wholesale Trading Details
Traded Goods #{{g+1}}
@@ -566,7 +342,7 @@
+ matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="td.controls.trading_traded_goods.controls.length>1">
delete
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
index 14dc8a6c3..4295b502b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
@@ -48,10 +48,10 @@ export class StockComponent implements OnInit {
// R_financialTradedGoodsValueInWords : any = [];
// T_financialTradedGoodsValueInWords : any = [];
- rawMaterialAccess: boolean;
- finishedGoodsAccess: boolean;
- tradeConcernAccess: boolean;
-
+ rawMaterialAccess: Boolean = false;
+ finishedGoodsAccess: Boolean = false;
+ tradeConcernAccess: Boolean = false;
+ serviceAccess: Boolean = false;
public submitted = false;
noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
@@ -68,6 +68,7 @@ export class StockComponent implements OnInit {
this.form_id = 11;
this.company_id = this.pd_all_details.company_id;
this.notifier = notifier;
+ this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ;
}
public viewerOptions: any = {
@@ -91,78 +92,12 @@ export class StockComponent implements OnInit {
};
ngOnInit() {
-
- // this._pd.stockFormsAccess({pd_id:this.pdid}).subscribe(data => {
- // if(data.status == 200){
- // this.initstockForms(data.record.type_of_activity);
- // }
- // }, err => {
- // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!');
- // })
- // "Manufacturing"
- // products
- // :
- // (2) ["Rwas1", "123"]
- // type_of_activity_id
- // :
- // 2
- //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
- // console.log(this.pdid);
- // console.log(this.company_id);
-
+
this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => {
- console.log(data);
- console.log(data.record);
- // return;
if(data.dataStatus == true){
- let tempcount = 0;
-
- let datas = data.record;
- let api = Object.keys(datas).map(function (key) {
- return datas[key];
- });
- console.log(api);
- if(api.length > 0){
- api.forEach(val => {
- if (val.type_of_activity_id == 2) {
- if(val.products){
- this.suppliers_raw_materials = val.products;
- }
- }
- if (val.type_of_activity_id == 3) {
- if(val.products){
- this.suppliers_finished_goods = val.products;
- }
- }
- if (val.type_of_activity_id == 4) {
- if(val.products){
- this.suppliers_trade_details = val.products;
- }
- }
- if (val.type_of_activity_id == 5) {
- if(val.products){
- this.suppliers_service_product = val.products;
- }
- console.log(this.suppliers_service_product);
- }
- tempcount++;
- });
- // console.log('tempcount',tempcount);
- if(tempcount>0){
- this.initstockForms(datas);
- }
- else{
- this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
- this.noRecordsFound = false;
- }
-
-
- }
- else{
- this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
- this.noRecordsFound = false;
- }
- }else if(data.dataStatus == false)
+ this.initstockForms(data.record);
+ }
+ else if(data.dataStatus == false)
{
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false;
@@ -182,20 +117,12 @@ export class StockComponent implements OnInit {
}
public initstockForms(record){
- // console.log(record);
-// {: 2, name: "Manufacturing", products: Array(2)}
-// 1
-// :
-// {type_of_activity_id: 3, name: "Retail trading", products: Array(1)}
-// 2
-// :
-// {type_of_activity_id: 4, name: "Wholesale Trade", products: Array(1)}
-// 3
-// :
-// {type_of_activity_id: 5, name: "Service Provider", products: Array(1)}
-
-
-
+
+ let api = Object.keys(record).map(function (key) {
+ return record[key];
+ });
+
+
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
@@ -209,43 +136,49 @@ export class StockComponent implements OnInit {
formid: [this.form_id],
company_id: [this.company_id],
stock_remarks: [''],
- manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
- retail_details : this.fb.array([this.retailFormCreation(record)]),
- trade_details: this.fb.array([this.tradingFormCreation(record)]),
+ manufacturing_details: this.fb.array([this.manufacturingFormCreation(api)]),
+ retail_details : this.fb.array([this.retailFormCreation(api)]),
+ trade_details: this.fb.array([this.tradingFormCreation(api)]),
});
- let arr = record.filter(data => data.type_of_activity_id == 2);
- if(arr.length > 0) {
- let manufacturing_temparr = [];
- manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
- manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods;
- manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods;
- this.initManufacturingDetails(manufacturing_temparr);
- }
-
- let arr1 = record.filter(data => data.type_of_activity_id == 3);
- if(arr1.length > 0) {
- let retail_temparr = [];
- retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods;
- retail_temparr['retail_finished_goods'] = dataForm.retail_details[0].retail_finished_goods;
- this.initRetailDetails(retail_temparr);
- }
-
- let arr2 = record.filter(data => data.type_of_activity_id == 4);
- if(arr2.length > 0) {
+
+ if(api.length > 0){
+ api.forEach(val => {
+ if (val.type_of_activity_id == 2) {
+ if(val.products){
+ let manufacturing_temparr = [];
+ manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
+ manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods;
+ this.initManufacturingDetails(manufacturing_temparr);
+ }
+ }
+ if (val.type_of_activity_id == 3) {
+ if(val.products){
+ let retail_temparr = [];
+ retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods;
+ this.initRetailDetails(retail_temparr);
+ }
+ }
+ if (val.type_of_activity_id == 4) {
+ if(val.products){
let trading_temparr = [];
- trading_temparr['trading_finished_goods'] = dataForm.trade_details[0].trading_finished_goods;
trading_temparr['trading_traded_goods'] = dataForm.trade_details[0].trading_traded_goods;
this.initTradingDetails(trading_temparr);
+ }
+ }
+ if (val.type_of_activity_id == 5) {
+ if(val.products){
+ this.serviceProviderForm = true;
+ }
+
+ }
+
+ });
+ this.noRecordsFound = true;
}
- let arr3 = record.filter(data => data.type_of_activity_id == 5);
- if(arr3.length > 0) {
- this.serviceProviderForm = true;
- }
- this.noRecordsFound = true;
}
else{
- // console.log('dataForm',dataForm);
+
this.stockForms = this.fb.group({
pdid: [this.pdid],
formid: [this.form_id],
@@ -255,34 +188,38 @@ 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 == 2);
- if(arr.length > 0) {
- this.initManufacturingDetails(null);
+
+ if(api.length > 0){
+ api.forEach(val => {
+ if (val.type_of_activity_id == 2) {
+ if(val.products){
+ this.suppliers_raw_materials = val.products;
+ this.initManufacturingDetails(null);
+ }
}
- let arr1 = record.filter(data => data.type_of_activity_id == 3);
- if(arr1.length > 0) {
- this.initRetailDetails(null);
+ if (val.type_of_activity_id == 3) {
+ if(val.products){
+ this.suppliers_finished_goods = val.products;
+ this.initRetailDetails(null);
+ }
}
- let arr2 = record.filter(data => data.type_of_activity_id == 4);
- if(arr2.length > 0) {
+ if (val.type_of_activity_id == 4) {
+ if(val.products){
+ this.suppliers_trade_details = val.products;
this.initTradingDetails(null);
- // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
- // if(value.status == 200){
- // // this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
- // // this.suppliers_finished_goods
- // this.suppliers_trade_details = value.records.trade_details[0].trading_products;
- // this.initTradingDetails(null);
- // }
- // else{
- // this.initTradingDetails(null);
- // }
- // });
+ }
}
- let arr3 = record.filter(data => data.type_of_activity_id == 5);
- if(arr3.length > 0) {
- this.serviceProviderForm = true;
- }
- this.noRecordsFound = true;
+ if (val.type_of_activity_id == 5) {
+ if(val.products){
+ this.suppliers_service_product = val.products;
+ this.serviceProviderForm = true;
+ }
+
+ }
+
+ });
+ this.noRecordsFound = true;
+ }
}
}
else {
@@ -295,59 +232,40 @@ 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 == 2);
- if(arr.length > 0) {
- // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
- // if(value.status == 200){
- // this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
- // this.initManufacturingDetails(null);
- // }
- // else{
- this.initManufacturingDetails(null);
- // }
- // });
- }
- let arr1 = record.filter(data => data.type_of_activity_id == 3);
- if(arr1.length > 0) {
- // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
- // if(value.status == 200){
- // this.suppliers_finished_goods = value.records.trade_details[0].trading_products;
- // // value.records.manufacturing_details[0].main_raw_materials;
- // this.initRetailDetails(null);
- // }
- // else{
- this.initRetailDetails(null);
- // }
- // });
-
- }
- let arr2 = record.filter(data => data.type_of_activity_id == 4);
- if(arr2.length > 0) {
- // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
- // if(value.status == 200){
- // this.suppliers_trade_details = value.records.trade_details[0].trading_products;
-
- // }
- // else{
- this.initTradingDetails(null);
- // }
-
- // this.initTradingDetails(null);
- }
- let arr3 = record.filter(data => data.type_of_activity_id == 5);
- if(arr3.length > 0) {
- this.serviceProviderForm = true;
- }
- this.noRecordsFound = true;
+ if(api.length > 0){
+ api.forEach(val => {
+ if (val.type_of_activity_id == 2) {
+ if(val.products){
+ this.suppliers_raw_materials = val.products;
+ this.initManufacturingDetails(null);
+ }
+ }
+ if (val.type_of_activity_id == 3) {
+ if(val.products){
+ this.suppliers_finished_goods = val.products;
+ this.initRetailDetails(null);
+ }
+ }
+ if (val.type_of_activity_id == 4) {
+ if(val.products){
+ this.suppliers_trade_details = val.products;
+ this.initTradingDetails(null);
+ }
+ }
+ if (val.type_of_activity_id == 5) {
+ if(val.products){
+ this.suppliers_service_product = val.products;
+ this.serviceProviderForm = true;
+ }
+
+ }
+
+ });
+ this.noRecordsFound = true;
+ }
+ this.noRecordsFound = true;
}
})
-
- // this.stockForms = this.fb.group({
- // stock_remarks: [''],
- // raw_materials: this.fb.array([]),
- // finished_goods: this.fb.array([]),
- // traded_goods: this.fb.array([])
- // });
}
manufacturingForm: Boolean = false;
@@ -358,9 +276,7 @@ export class StockComponent implements OnInit {
return this.fb.group({
manufacturing_raw_materials: this.fb.array([]),
manufacturing_finished_goods: this.fb.array([]),
- manufacturing_traded_goods: this.fb.array([])
})
- // }
} else {
return;
}
@@ -373,7 +289,6 @@ retailFormCreation(val) {
if (arr.length > 0) {
this.retailForm = true;
return this.fb.group({
- retail_finished_goods: this.fb.array([]),
retail_traded_goods: this.fb.array([])
})
// }
@@ -388,7 +303,6 @@ tradingFormCreation(val) {
if (arr.length > 0) {
this.tradingForm = true;
return this.fb.group({
- trading_finished_goods: this.fb.array([]),
trading_traded_goods: this.fb.array([])
});
} else {
@@ -406,11 +320,10 @@ tradingFormCreation(val) {
const rawMaterial =
this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
- const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
- console.log('sdzsgfasdfasddfasdf');
- console.log(this.suppliers_raw_materials);
+
+
if(this.suppliers_raw_materials.length > 0){
this.suppliers_raw_materials.forEach(val => {
let Ref_RawMaterials : any = {'raw_name': val,
@@ -446,32 +359,11 @@ tradingFormCreation(val) {
finishedGoods.push(this.createGoods(null));
}
- if(this.suppliers_trade_details.length > 0){
- this.suppliers_trade_details.forEach(val => {
- let Ref_Trade_Goods : any = {
- 'traded_goods_name': val,
- 'traded_goods_observed': '',
- 'traded_goods_quantity': '',
- 'traded_goods_uom': '',
- 'traded_goods_other_uom': '',
- 'estimated_traded_goods_value': '',
- 'is_sufficiant_traded_goods': '',
- 'traded_goods_remarks':''};
- tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
- });
- }
- else{
- tradedGoods.push(this.createTradedGoods(null));
- }
-
} else {
- // console.log(305,'else')
- // console.log(377,datas);
- // console.log(datas.manufacturing_raw_materials);
+
if(datas.manufacturing_raw_materials != undefined){
for (let val of datas.manufacturing_raw_materials) {
- // console.log(val);
if(val.raw_value){
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
// this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
@@ -484,7 +376,6 @@ tradingFormCreation(val) {
}
if(datas.manufacturing_finished_goods != undefined){
for (let val of datas.manufacturing_finished_goods) {
- // console.log(val);
if(val.goods_value){
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
// this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
@@ -496,28 +387,13 @@ tradingFormCreation(val) {
else{
finishedGoods.push(this.createGoods(null));
}
- if(datas.manufacturing_traded_goods !== undefined){
- for (let val of datas.manufacturing_traded_goods) {
- // console.log(val);
- if(val.estimated_traded_goods_value){
- this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
- // this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value);
- }
- tradedGoods.push(this.createTradedGoods(val));
-
- }
- }
- else{
- tradedGoods.push(this.createTradedGoods(null));
- }
- // console.log(310,rawMaterial);
}
}
createRawmaterial(records) {
- // console.log(330,'function in');
+
if(records === null) {
- // console.log(331,'fif');
+
return this.fb.group({
raw_name: [''],
stock_observed:[''],
@@ -530,7 +406,7 @@ tradingFormCreation(val) {
rawmaterial_remarks:['']
})
} else {
- // console.log(343,'else');
+
return this.fb.group({
manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null],
raw_name: [records.raw_name],
@@ -548,32 +424,13 @@ tradingFormCreation(val) {
initRetailDetails(datas) {
- const finishedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
const tradedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
if(datas === null){
- // finishedGoods.push(this.createGoods(null));
- if(this.suppliers_finished_goods.length > 0){
- // for (let val of this.suppliers_finished_goods) {
- this.suppliers_finished_goods.forEach(val => {
- let Ref_Finished_Goods : any = {'goods_name': val,
- 'goods_observed': '',
- 'goods_quantity': '',
- 'goods_uom': '',
- 'goods_other_uom': '',
- 'goods_value': '',
- 'is_sufficiant_goods': '',
- 'finishedgoods_remarks':''};
- finishedGoods.push(this.createGoods(Ref_Finished_Goods));
- });
- }
- else{
- finishedGoods.push(this.createGoods(null));
- }
-
if(this.suppliers_trade_details.length > 0){
- console.log(this.suppliers_trade_details);
+ this.rawMaterialAccess = true;
+
this.suppliers_trade_details.forEach(val => {
let Ref_Trade_Goods : any = {
'traded_goods_name': val,
@@ -592,27 +449,9 @@ tradingFormCreation(val) {
}
} else {
- //console.log(479,datas.retail_finished_goods);
- if(datas.retail_finished_goods != undefined){
- for (let val of datas.retail_finished_goods) {
- // console.log(val);
-
- if(val.goods_value){
- this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
- // this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value);
- }
- finishedGoods.push(this.createGoods(val));
-
- }
- }
- else{
- finishedGoods.push(this.createGoods(null));
- }
-
- //console.log(495,datas.retail_traded_goods);
if(datas.retail_traded_goods !== undefined){
for (let val of datas.retail_traded_goods) {
- // console.log(val);
+
if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
// this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
@@ -684,31 +523,9 @@ tradingFormCreation(val) {
}
initTradingDetails(datas) {
-
- const finishedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
- const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods'];
-
+ const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods'];
if(datas === null){
- // finishedGoods.push(this.createGoods(null));
- // tradedGoods.push(this.createTradedGoods(null));
- if(this.suppliers_finished_goods.length > 0){
- // for (let val of this.suppliers_finished_goods) {
- this.suppliers_finished_goods.forEach(val => {
- let Ref_Finished_Goods : any = {'goods_name': val,
- 'goods_observed': '',
- 'goods_quantity': '',
- 'goods_uom': '',
- 'goods_other_uom': '',
- 'goods_value': '',
- 'is_sufficiant_goods': '',
- 'finishedgoods_remarks':''};
- finishedGoods.push(this.createGoods(Ref_Finished_Goods));
- });
- }
- else{
- finishedGoods.push(this.createGoods(null));
- }
if(this.suppliers_trade_details.length > 0){
// for (let val of this.suppliers_trade_details) {
@@ -730,31 +547,10 @@ tradingFormCreation(val) {
}
} else {
- // for (let val of datas) {
-
- // finishedGoods.push(this.createGoods(val.trading_finished_goods));
- // tradedGoods.push(this.createTradedGoods(val.trading_traded_goods));
-
- // }
- if(datas.trading_finished_goods !==undefined)
- {
- for (let val of datas.trading_finished_goods) {
- // console.log(val);
- if(val.goods_value){
- this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
- // this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
- }
- finishedGoods.push(this.createGoods(val));
-
- }
- }
- else{
- finishedGoods.push(this.createGoods(null));
- }
if(datas.trading_traded_goods !==undefined)
{
for (let val of datas.trading_traded_goods) {
- // console.log(val);
+
if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
// this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
@@ -827,14 +623,10 @@ tradingFormCreation(val) {
break;
}
case 2: {
- const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
- control.push(this.createGoods(null));
break;
}
case 3: {
- const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
- control.push(this.createGoods(null));
- break;
+ break;
}
default: {
break;
@@ -849,13 +641,9 @@ tradingFormCreation(val) {
break;
}
case 2: {
- const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
- control.removeAt(index);
break;
}
case 3: {
- const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
- control.removeAt(index);
break;
}
default: {
@@ -868,16 +656,10 @@ tradingFormCreation(val) {
}
addTradedGoods(flag) {
- // const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
- // //const control = this.stockForms.controls['traded_goods'];
-
- // control.push(this.createTradedGoods(null));
switch(flag){
case 1: {
- const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
- control.push(this.createTradedGoods(null));
break;
- }
+ }
case 2: {
const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.push(this.createTradedGoods(null));
@@ -895,11 +677,9 @@ tradingFormCreation(val) {
}
deleteTradedGoods(index,flag) {
switch(flag){
- case 1: {
- const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
- control.removeAt(index);
+ case 1:{
break;
- }
+ }
case 2: {
const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.removeAt(index);
@@ -915,7 +695,6 @@ tradingFormCreation(val) {
}
}
- //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
//const control = this.stockForms.controls['traded_goods'];
}
@@ -930,8 +709,7 @@ tradingFormCreation(val) {
// return;
// } else {
var answerFormValues = this.stockForms.value;
-console.log(answerFormValues);
-// return;
+
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
index 6fec2b84d..57b72e300 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html
@@ -42,32 +42,45 @@
{{comrelShip.name}}
- Not Applicable
+
+
+
+
-
+ Enter Valid Mobile Number.
+ Enter Valid STD Code Number.
-
+ Enter Valid LandLine Number.
-
+
+
{{ pm.name }}
-
-
+
+
+
+ No.of days of Credit Provided by Supplier
+
+
-
+
+
+
+
1" (click)="removeRawMaterials(l)">
@@ -126,20 +139,26 @@
{{comrelShip.name}}
- Not Applicable
+
+
+
+
+ Enter Valid Mobile Number.
+ Enter Valid STD Code Number.
-
+ Enter Valid LandLine Number.
@@ -148,10 +167,20 @@
{{ pm.name }}
-
+
+
+
+ No.of days of Credit Provided by Supplier
+
+
+
+
+
+
+
+
1" (click)="removeTradingProduct(l)">
delete
@@ -168,7 +197,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
index 3a056c536..1b19f75b9 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
@@ -54,6 +54,7 @@ export class SupplierInfoComponent implements OnInit {
this.form_id = 1;
this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
+ this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ;
}
public viewerOptions: any = {
@@ -266,10 +267,12 @@ export class SupplierInfoComponent implements OnInit {
manufacturing_supplier_name: [''],
person_title_name:[''],
person_designation:[''],
+ other_person_designation:[''],
manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [''],
- manufacturing_credit_days: [''],
+ manufacturing_credit_days_from: [''],
+ manufacturing_credit_days_to:[''],
manufacturing_frequency_of_purchase: [''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
@@ -281,10 +284,12 @@ export class SupplierInfoComponent implements OnInit {
manufacturing_supplier_name: [records.manufacturing_supplier_name || null],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_title_name || null],
+ other_person_designation:[records.other_person_designation || null],
manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [records.manufacturing_payment_type || null],
- manufacturing_credit_days: [records.manufacturing_credit_days || null],
+ manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null],
+ manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null],
manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
@@ -309,20 +314,23 @@ export class SupplierInfoComponent implements OnInit {
trade_product_name: [''],
trade_supplier_name: [''],
person_title_name:[''],
- person_designation:[],
+ person_designation:[''],
+ other_person_designation:[''],
trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [''],
trade_product_frequency_of_purchase: [''],
- trade_product_credit_days: [''],
+ trade_product_credit_days_from: [''],
+ trade_product_credit_days_to: [''],
})
} else {
return this._formBuilder.group({
trade_product_name: [records.trade_product_name],
person_title_name:[records.person_title_name],
person_designation:[records.person_designation],
+ other_person_designation:[records.other_person_designation],
trade_supplier_name: [records.trade_supplier_name],
trade_product_contact_person_name: [records.trade_product_contact_person_name],
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
@@ -330,7 +338,8 @@ export class SupplierInfoComponent implements OnInit {
person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [records.trade_product_payment_type],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
- trade_product_credit_days: [records.trade_product_credit_days],
+ trade_product_credit_days_from: [records.trade_product_credit_days_from],
+ trade_product_credit_days_to: [records.trade_product_credit_days_to],
})
}
}
@@ -365,7 +374,8 @@ export class SupplierInfoComponent implements OnInit {
data => {
if (data.dataStatus) {
if(type==1){
- this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
+ this.companyRelationShipList=data.records;
+ // .filter(item => item.name != 'Others');
}
if(type==2){
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
index f4d24683e..d64492d12 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
@@ -33,3 +33,4 @@
{{currentPDStatus === true ? 'COMPLETE':'COMPLETED' }}
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
index e64e6747a..0597ae47a 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
@@ -20,7 +20,7 @@
{{master.pd_status | titlecase}}
QC Completed
-
flash_on
+
flash_on
{{master.pd_allocated_to | titlecase}}
@@ -98,7 +98,7 @@