changes:ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-28 12:26:49 +05:30
parent 780845b532
commit 432d6f1e60
3 changed files with 17 additions and 377 deletions

View File

@ -88,8 +88,8 @@ export class EditPdApplicantComponent implements OnInit {
//console.log(stdcode);
landline = listData.landline.substr(+stdcodesearch + 1,8);}
else{
stdcode = null;
landline = null;
stdcode = '';
landline = '';
}
return this._fb.group({
label: ['Co Applicant'],

View File

@ -168,82 +168,6 @@
</mat-card>
</div>
</div>
<div formArrayName="manufacturing_traded_goods">
<div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index;let last = last" [formGroupName]="c">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{c+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="traded_goods_observed" >
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="mtg.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="traded_goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mtg.get('traded_goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3,c)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,10,c)">
<mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{M_financialTradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field> -->
<mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field>
</span>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(1)"
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="c==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(c,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="c>0">
<mat-icon>delete</mat-icon>
</button> -->
</mat-card-content>
<mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong>
</button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(c,1)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</div>
</mat-card>
@ -252,86 +176,12 @@
<!-- <mat-card-header>
<mat-card-title class="highlight"><p>Retail Details</p></mat-card-title>
</mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Retail Details</h5>
<h5 class="highlight" style="margin: 12px;">Retail Trading Details</h5>
<div formArrayName="retail_details">
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j">
<div formArrayName="retail_finished_goods">
<div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index;let last =last" [formGroupName]="d">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{d+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="goods_observed" >
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No stock observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="retailfg.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="retailfg.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,4,d)" >
<mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords[d]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,11,d)">
<mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{R_financialGoodsValueInWords[d]}} Only</mat-hint>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field>
</span>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods(2)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="d==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="d>0">
<mat-icon>delete</mat-icon>
</button> -->
</mat-card-content>
<mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)"
matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index;let last =last" [formGroupName]="e">
@ -418,87 +268,10 @@
<!-- <mat-card-header>
<mat-card-title class="highlight"><p>Trading Details</p></mat-card-title>
</mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Trading Details</h5>
<h5 class="highlight" style="margin: 12px;">Wholesale Trading Details</h5>
<div formArrayName="trade_details">
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k">
<div formArrayName="trading_finished_goods">
<div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index;let last =last" [formGroupName]="f">
<mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{f+1}} </i> </mat-label>
<mat-card-content class="matcard">
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Stock" formControlName="goods_observed" >
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="tradesubdetail.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement"
formControlName="goods_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('goods_uom').value == 1" style="width:28%">
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field>
<mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,6,f)" >
<mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords[f]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,13,f)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('finished_goods_value').value != ''">{{"&#8377;"}} {{T_financialGoodsValueInWords[f]}} Only</mat-hint>
</mat-form-field> -->
<mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field>
</span>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods(3)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="f==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(f,3)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="f>0">
<mat-icon>delete</mat-icon>
</button> -->
</mat-card-content>
<mat-card-actions>
<div align="center">
<button type="button" mat-flat-button (click)="addGoods(3)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Finished Goods </strong>
</button>
</div>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(f,3)"
matTooltip="Delete Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-actions>
</mat-card>
</div>
</div>
<div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index;let last = last" [formGroupName]="g">
<mat-card style="margin: 12px;">

View File

@ -152,6 +152,7 @@ export class StockComponent implements OnInit {
this.initstockForms(datas);
}
else{
console.log('1');
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false;
}
@ -159,21 +160,25 @@ export class StockComponent implements OnInit {
}
else{
console.log('2');
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)
{
console.log('3');
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false;
return;
}
else{
console.log('4');
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false;
return;
}
}, err => {
console.log('5');
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
this.noRecordsFound = false;
})
@ -219,7 +224,6 @@ export class StockComponent implements OnInit {
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);
}
@ -227,14 +231,12 @@ export class StockComponent implements OnInit {
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) {
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);
}
@ -358,7 +360,6 @@ 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 {
@ -373,7 +374,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 +388,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,10 +405,9 @@ tradingFormCreation(val) {
const rawMaterial = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
const finishedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
const tradedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
console.log('sdzsgfasdfasddfasdf');
// console.log('sdzsgfasdfasddfasdf');
console.log(this.suppliers_raw_materials);
if(this.suppliers_raw_materials.length > 0){
this.suppliers_raw_materials.forEach(val => {
@ -446,24 +444,6 @@ 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);
@ -496,21 +476,6 @@ 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);
}
}
@ -548,30 +513,10 @@ tradingFormCreation(val) {
initRetailDetails(datas) {
const finishedGoods = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
const tradedGoods = <FormArray>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.suppliers_trade_details.forEach(val => {
@ -592,24 +537,6 @@ 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);
@ -684,31 +611,9 @@ tradingFormCreation(val) {
}
initTradingDetails(datas) {
const finishedGoods = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
const tradedGoods = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods'];
const tradedGoods = <FormArray>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 +635,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 +711,10 @@ tradingFormCreation(val) {
break;
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
control.push(this.createGoods(null));
break;
}
case 3: {
const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
control.push(this.createGoods(null));
break;
break;
}
default: {
break;
@ -849,13 +729,9 @@ tradingFormCreation(val) {
break;
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods'];
control.removeAt(index);
break;
}
case 3: {
const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods'];
control.removeAt(index);
break;
}
default: {
@ -868,16 +744,10 @@ tradingFormCreation(val) {
}
addTradedGoods(flag) {
// const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
// //const control = <FormArray>this.stockForms.controls['traded_goods'];
// control.push(this.createTradedGoods(null));
switch(flag){
case 1: {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
control.push(this.createTradedGoods(null));
break;
}
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.push(this.createTradedGoods(null));
@ -895,11 +765,9 @@ tradingFormCreation(val) {
}
deleteTradedGoods(index,flag) {
switch(flag){
case 1: {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
control.removeAt(index);
case 1:{
break;
}
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.removeAt(index);
@ -915,7 +783,6 @@ tradingFormCreation(val) {
}
}
//const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
//const control = <FormArray>this.stockForms.controls['traded_goods'];
}