@@ -401,9 +433,10 @@
-
+
+ Service Provider
Service Provider Details Not applicable here !!
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 494ceaf1f..a21ee4ad0 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
@@ -29,15 +29,24 @@ export class StockComponent implements OnInit {
rawmaterial : any;
- M_rawValueInWords : any;
-
- M_goodsValueInWords : any;
- R_goodsValueInWords : any;
- T_goodsValueInWords : any;
+ M_rawValueInWords : any = [];
+ M_financialRawValueInWords : any = [];
- M_tradedGoodsValueInWords : any;
- R_tradedGoodsValueInWords : any;
- T_tradedGoodsValueInWords : any;
+ M_goodsValueInWords : any = [];
+ R_goodsValueInWords : any = [];
+ T_goodsValueInWords : any = [];
+
+ M_financialGoodsValueInWords : any = [];
+ R_financialGoodsValueInWords : any = [];
+ T_financialGoodsValueInWords : any = [];
+
+ M_tradedGoodsValueInWords : any = [];
+ R_tradedGoodsValueInWords : any = [];
+ T_tradedGoodsValueInWords : any = [];
+
+ M_financialTradedGoodsValueInWords : any = [];
+ R_financialTradedGoodsValueInWords : any = [];
+ T_financialTradedGoodsValueInWords : any = [];
rawMaterialAccess: boolean;
finishedGoodsAccess: boolean;
@@ -45,6 +54,7 @@ export class StockComponent implements OnInit {
public submitted = false;
noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
+ suppliers_raw_materials : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@@ -117,9 +127,7 @@ export class StockComponent implements OnInit {
params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(value => {
if (value.status == 200) {
- let dataForm = value.records;
-
-
+ let dataForm = value.records;
if(dataForm !== undefined) {
this.stockForms = this.fb.group({
pdid: [this.pdid],
@@ -133,6 +141,24 @@ export class StockComponent implements OnInit {
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
+ this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
+ console.log('136',value);
+ if(value.status == 200){
+ this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
+ 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);
+ }
+ else{
+ 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);
+ }
+ });
// console.log(1,dataForm);
// console.log(164,dataForm.manufacturing_details);
// console.log(2,dataForm.retail_details);
@@ -169,14 +195,7 @@ export class StockComponent implements OnInit {
// console.log(163,dataForm.manufacturing_details.manufacturing_raw_materials);
// console.log(164,dataForm.manufacturing_details[0]);
// console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials);
-
- 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);
//this.initManufacturingDetails(dataForm);
}
@@ -265,7 +284,16 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
- this.initManufacturingDetails(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.initManufacturingDetails(null);
+ }
+ else{
+ this.initManufacturingDetails(null);
+ }
+ });
+ // this.initManufacturingDetails(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
@@ -293,7 +321,16 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
- this.initManufacturingDetails(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.initManufacturingDetails(null);
+ }
+ else{
+ this.initManufacturingDetails(null);
+ }
+ });
+
}
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
@@ -376,14 +413,27 @@ 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'];
-
+ const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
- // console.log(299,'if');
+ if(this.suppliers_raw_materials.length > 0){
+ for (let val of this.suppliers_raw_materials) {
+ let Ref_RawMaterials : any = {'raw_name': val.manufacturing_raw_material_name,
+ 'stock_observed':'',
+ 'raw_quantity': '',
+ 'raw_uom': '',
+ 'other_uom': '',
+ 'raw_value': '',
+ 'rawmaterial_value': '',
+ 'is_sufficiant_raw': '',
+ 'rawmaterial_remarks':''};
+ rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
+ }
+ }
+ else{
rawMaterial.push(this.createRawmaterial(null));
+ }
finishedGoods.push(this.createGoods(null));
tradedGoods.push(this.createTradedGoods(null));
-
} else {
// console.log(305,'else')
// console.log(377,datas);
@@ -393,6 +443,7 @@ tradingFormCreation(val) {
// 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);
}
rawMaterial.push(this.createRawmaterial(val));
}
@@ -405,6 +456,7 @@ tradingFormCreation(val) {
// 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);
}
finishedGoods.push(this.createGoods(val));
@@ -418,6 +470,7 @@ tradingFormCreation(val) {
// 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));
@@ -430,21 +483,6 @@ tradingFormCreation(val) {
}
}
- createRawmaterial2() {
- return this.fb.group({
- raw_name: ['', Validators.compose([Validators.required])],
- stock_observed:['', Validators.compose([Validators.required])],
- raw_quantity: [''],
- raw_uom: [''],
- other_uom : [''],
- raw_value: [''],
- rawmaterial_value: [''],
- is_sufficiant_raw: [''],
- rawmaterial_remarks:['']
- });
- }
-
-
createRawmaterial(records) {
// console.log(330,'function in');
if(records === null) {
@@ -495,6 +533,7 @@ tradingFormCreation(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));
@@ -510,6 +549,7 @@ tradingFormCreation(val) {
// 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);
}
tradedGoods.push(this.createTradedGoods(val));
@@ -594,6 +634,7 @@ tradingFormCreation(val) {
// 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));
@@ -608,6 +649,7 @@ tradingFormCreation(val) {
// 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);
}
tradedGoods.push(this.createTradedGoods(val));
}
@@ -831,29 +873,50 @@ tradingFormCreation(val) {
}
/** To Convert Amount into Words */
- inWords(e,flag:number){
+ inWords(e,flag:number,i){
switch(flag){
case 1 :
- this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
- this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 3 :
- this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 4 :
- this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 5 :
- this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 6 :
- this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
- this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
+ this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 8 :
+ this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 9 :
+ this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 10 :
+ this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 11 :
+ this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 12 :
+ this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 13 :
+ this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
+ break;
+ case 14 :
+ this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;