sheet changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-02-14 16:59:54 +05:30
parent e2c34445e5
commit 5d61a8e04e
5 changed files with 224 additions and 250 deletions

View File

@ -61,6 +61,7 @@
<div *ngIf="addressForm.controls.locality.value == 1" fxFlex="33"> <div *ngIf="addressForm.controls.locality.value == 1" fxFlex="33">
<mat-form-field style="width: 85%;"> <mat-form-field style="width: 85%;">
<input matInput placeholder="Specify Locality *" formControlName="locality_others" autocomplete="off"> <input matInput placeholder="Specify Locality *" formControlName="locality_others" autocomplete="off">
<!-- autofocus -->
<mat-error *ngIf="!addressForm.controls['locality_others'].valid">Locality Required</mat-error> <mat-error *ngIf="!addressForm.controls['locality_others'].valid">Locality Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>

View File

@ -26,7 +26,7 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.values.id,itemrow,1)"> <mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,1)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val"> <mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}} {{val.name}}

View File

@ -53,20 +53,20 @@
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="other_uom" > <input matInput autocomplete="off" placeholder="Specify UOM" formControlName="other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1,a)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event.target.value,1,a)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords[a]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords[a]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width:76%"> <!-- <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" (keyup)="inWords($event,8,a)"> <input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('rawmaterial_value').value != ''">{{"&#8377;"}} {{M_financialRawValueInWords[a]}} Only</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" > <mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" (selectionChange)="checkComments($event.value,1,a)">
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mrmCommentFlag[a]" appearance="outline" style="width: 90%">
<!-- *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" -->
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field> </mat-form-field>
@ -120,20 +120,20 @@
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" > <input matInput autocomplete="off" placeholder="Specify UOM" formControlName="goods_other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <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,2,b)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event.target.value,2,b)" >
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords[b]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords[b]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width:76%"> <!-- <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,9,b)"> <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{M_financialGoodsValueInWords[b]}} Only</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:90%"> <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-select placeholder="Is the stock of Finished Goods Observed sufficient considering the size of operations?" formControlName="is_sufficiant_goods" (selectionChange)="checkComments($event.value,2,b)">
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mfgCommentFlag[b]" appearance="outline" style="width: 90%">
<!-- *ngIf="mfg.get('is_sufficiant_goods').value == 'no'" -->
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label> <mat-label class="highlight"> <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> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
@ -214,31 +214,31 @@
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" > <input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <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,5,e)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event.target.value,3,e)" >
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords[e]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width:76%"> <!-- <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,12,e)"> <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('traded_goods_value').value != ''">{{"&#8377;"}} {{R_financialTradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" > <mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" (selectionChange)="checkComments($event.value,3,e)">
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="rtrdCommentFlag[e]" appearance="outline" style="width: 90%">
<!-- *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" -->
<mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label> <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> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(2)" <!-- <button type="button" mat-raised-button mat-icon-button (click)=""
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="e==0"> matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="e==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,2)" <button type="button" mat-raised-button mat-icon-button (click)=""
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> --> </button> -->
@ -246,13 +246,13 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="right"> <div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,2)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(e,1)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="rd.controls.retail_traded_goods.controls.length>1"> matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="rd.controls.retail_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
<div align="center"> <div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(2)" <button type="button" mat-flat-button (click)="addTradedGoods(1)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong> <strong>Add More Traded Goods </strong>
</button> </button>
@ -304,31 +304,31 @@
<input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" > <input matInput autocomplete="off" placeholder="Specify UOM" formControlName="traded_goods_other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <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,7,g)"> <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event.target.value,4,g)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords[g]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width:76%"> <!-- <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,14,g)"> <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{T_financialTradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > --> <!-- <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-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" (selectionChange)="checkComments($event.value,4,g)">
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="wtrdCommentFlag[g]" appearance="outline" style="width: 90%">
<!-- //*ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" -->
<mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label> <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> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(3)" <!-- <button type="button" mat-raised-button mat-icon-button (click)=""
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="g==0"> matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="g==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)" <button type="button" mat-raised-button mat-icon-button (click)=""
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="g>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="g>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> --> </button> -->
@ -336,13 +336,13 @@
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div align="center"> <div align="center">
<button type="button" mat-flat-button (click)="addTradedGoods(3)" <button type="button" mat-flat-button (click)="addTradedGoods(2)"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last"> matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Traded Goods </strong> <strong>Add More Traded Goods </strong>
</button> </button>
</div> </div>
<div align="right"> <div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,2)"
matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="td.controls.trading_traded_goods.controls.length>1"> matTooltip="Delete Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="td.controls.trading_traded_goods.controls.length>1">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
@ -483,8 +483,11 @@
</form> </form>
</div> </div>
<div *ngIf="!noRecordsFound"> <i> Loading... </i> </div> {{ errorMessage }}
<!-- <div *ngIf="!noRecordsFound"> <i> {{ errorMessage }} </i> </div> -->
<div *ngIf="!noRecordsFound" align="center"> <i> Fill Business Form First! / No Company Found at this ID {{company_id}}! .... </i> </div>
<notifier-container></notifier-container> <notifier-container></notifier-container>
<!-- <mat-card style="padding: 12px;"> <!-- <mat-card style="padding: 12px;">
<p>Stock Details</p> <p>Stock Details</p>
<form [formGroup]="stockForms" class="address"> --> <form [formGroup]="stockForms" class="address"> -->

View File

@ -18,57 +18,62 @@ import { analyzeAndValidateNgModules } from '@angular/compiler';
}) })
export class StockComponent implements OnInit { export class StockComponent implements OnInit {
pageTitle: string ="Stock Details";
private notifier: NotifierService;
public stockForms: FormGroup;
public uomData : any = [];
public submitted = false;
noRecordsFound: Boolean;
errorMessage: any = '';
customer_segment_abbr: any; customer_segment_abbr: any;
subproduct_abbr: any; subproduct_abbr: any;
lender_applicant_id: any; lender_applicant_id: any;
main_applicant: any; main_applicant: any;
pageTitle: string ="Stock Details";
pdid: number; pdid: number;
form_id: number; form_id: number;
company_id: string; company_id: string;
public stockForms: FormGroup;
private notifier: NotifierService;
public uomData : any = [];
rawmaterial : any; // rawmaterial : any;
M_rawValueInWords : any = []; M_rawValueInWords : any = [];
// M_financialRawValueInWords : any = [];
M_goodsValueInWords : 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 = []; R_tradedGoodsValueInWords : any = [];
T_tradedGoodsValueInWords : any = []; T_tradedGoodsValueInWords : any = [];
// M_financialTradedGoodsValueInWords : any = [];
// R_financialTradedGoodsValueInWords : any = [];
// T_financialTradedGoodsValueInWords : any = [];
rawMaterialAccess: Boolean = false; // rawMaterialAccess: Boolean = false;
finishedGoodsAccess: Boolean = false; // finishedGoodsAccess: Boolean = false;
tradeConcernAccess: Boolean = false; // tradeConcernAccess: Boolean = false;
serviceAccess: Boolean = false; // serviceAccess: Boolean = false;
public submitted = false;
noRecordsFound: Boolean = false; mrmCommentFlag:any=[];
mfgCommentFlag:any=[];
rtrdCommentFlag:any=[];
wtrdCommentFlag:any=[];
serviceProviderForm: Boolean = false; serviceProviderForm: Boolean = false;
suppliers_raw_materials : any = []; suppliers_raw_materials : any = [];
suppliers_retail_trade_details : any = []; suppliers_retail_trade_details : any = [];
suppliers_wholesale_trade_details : any = []; suppliers_wholesale_trade_details : any = [];
suppliers_finished_goods : any =[]; suppliers_finished_goods : any =[];
suppliers_service_product : any = []; // suppliers_service_product : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, /** Constructor */
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
private router: Router, private router: Router,
private dialogRef: MatDialogRef<StockComponent>, private dialogRef: MatDialogRef<StockComponent>,
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA)
public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 11; this.form_id = 11;
this.company_id = this.pd_all_details.company_id; this.company_id = this.pd_all_details.company_id;
@ -80,6 +85,7 @@ export class StockComponent implements OnInit {
this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr;
} }
/** CSS For Docs Testing */
public viewerOptions: any = { public viewerOptions: any = {
navbar: false, navbar: false,
toolbar: { toolbar: {
@ -103,36 +109,39 @@ export class StockComponent implements OnInit {
ngOnInit() { ngOnInit() {
this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => { this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => {
console.log(data);
if(data.dataStatus == true){ if(data.dataStatus == true){
console.log(data.record);
this.initstockForms(data.record); this.initstockForms(data.record);
} }
else if(data.dataStatus == false) else if(data.dataStatus == false)
{ {
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false; this.noRecordsFound = false;
this.errorMessage = 'Fill Business Form First! / No Company Found at this ID' + this.company_id +'! ....';
return; return;
} }
else{ else{
this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id );
this.noRecordsFound = false; this.noRecordsFound = false;
this.errorMessage = 'Fill Business Form First! / No Company Found at this ID' + this.company_id +'! ....';
return; return;
} }
}, err => { }, err => {
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!'); this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
this.noRecordsFound = false; this.noRecordsFound = false;
this.errorMessage = 'No Records Found , Something went Wrong!';
}) })
this.getUOM(); this.getUOM();
} }
public initstockForms(record){ public initstockForms(record){
console.log(record);
let api = Object.keys(record.from_business).map(function (key) { let api = Object.keys(record.from_business).map(function (key) {
return record.from_business[key]; return record.from_business[key];
}); });
let rm_api = record.from_supplier; let rm_api = record.from_supplier;
console.log('rm_api',rm_api.length);
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -151,12 +160,9 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(api)]), retail_details : this.fb.array([this.retailFormCreation(api)]),
trade_details: this.fb.array([this.tradingFormCreation(api)]), trade_details: this.fb.array([this.tradingFormCreation(api)]),
}); });
if(api.length > 0){ if(api.length > 0){
api.forEach(val => { api.forEach(val => {
if (val.type_of_activity_id == 2) { if (val.type_of_activity_id == 2) {
// if(){}
if(val.products){ if(val.products){
let manufacturing_temparr = []; let manufacturing_temparr = [];
manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
@ -182,9 +188,7 @@ export class StockComponent implements OnInit {
if(val.products){ if(val.products){
this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
} }
}); });
this.noRecordsFound = true; this.noRecordsFound = true;
} }
@ -223,7 +227,7 @@ export class StockComponent implements OnInit {
} }
if (val.type_of_activity_id == 5) { if (val.type_of_activity_id == 5) {
if(val.products){ if(val.products){
this.suppliers_service_product = val.products; // this.suppliers_service_product = val.products;
this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
@ -267,28 +271,22 @@ export class StockComponent implements OnInit {
} }
if (val.type_of_activity_id == 5) { if (val.type_of_activity_id == 5) {
if(val.products){ if(val.products){
this.suppliers_service_product = val.products; // this.suppliers_service_product = val.products;
this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
} }
}); });
this.noRecordsFound = true; this.noRecordsFound = true;
} }
this.noRecordsFound = true;
} }
}) })
} }
manufacturingForm: Boolean = false; manufacturingForm: Boolean = false;
manufacturingFormCreation(record) { manufacturingFormCreation(record) {
console.log('record',record);
let arr = record.from_business.filter(data => data.type_of_activity_id == 2); let arr = record.from_business.filter(data => data.type_of_activity_id == 2);
let rm_arr = record.from_supplier; let rm_arr = record.from_supplier;
console.log(rm_arr);
console.log(rm_arr.length);
if (arr.length > 0) { if (arr.length > 0) {
this.manufacturingForm = true; this.manufacturingForm = true;
@ -303,7 +301,7 @@ export class StockComponent implements OnInit {
retailForm: Boolean = false; retailForm: Boolean = false;
retailFormCreation(val) { retailFormCreation(val) {
console.log(val,'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) { if (arr.length > 0) {
this.retailForm = true; this.retailForm = true;
@ -329,11 +327,6 @@ tradingFormCreation(val) {
} }
} }
//setSku(sku: string, index: number) {
// const faControl =
// (<FormArray>this.stockForms.controls['raw_materials']).at(index);
// faControl['controls'].raw_name.setValue(sku);
// }
initManufacturingDetails(datas) { initManufacturingDetails(datas) {
@ -384,11 +377,10 @@ tradingFormCreation(val) {
if(datas.manufacturing_raw_materials != undefined){ if(datas.manufacturing_raw_materials != undefined){
// for (let val of datas.manufacturing_raw_materials) { // for (let val of datas.manufacturing_raw_materials) {
datas.manufacturing_raw_materials.forEach((val,index) => { datas.manufacturing_raw_materials.forEach((val,index) => {
if(val.raw_value){ if(val.raw_value){
this.M_rawValueInWords[index] = this._pd.convertNumberToWords(val.raw_value); this.inWords(val.raw_value,1,index);
// this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
} }
this.checkComments(val.is_sufficiant_raw,1,index);
rawMaterial.push(this.createRawmaterial(val)); rawMaterial.push(this.createRawmaterial(val));
}); });
} }
@ -400,9 +392,9 @@ tradingFormCreation(val) {
datas.manufacturing_finished_goods.forEach((val,index) => { datas.manufacturing_finished_goods.forEach((val,index) => {
if(val.goods_value){ if(val.goods_value){
this.M_goodsValueInWords[index] = this._pd.convertNumberToWords(val.goods_value); this.inWords(val.goods_value,2,index);
// this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
} }
this.checkComments(val.is_sufficiant_goods,2,index);
finishedGoods.push(this.createGoods(val)); finishedGoods.push(this.createGoods(val));
}); });
@ -452,7 +444,7 @@ tradingFormCreation(val) {
if(datas === null){ if(datas === null){
if(this.suppliers_retail_trade_details.length > 0){ if(this.suppliers_retail_trade_details.length > 0){
this.rawMaterialAccess = true; // this.rawMaterialAccess = true;
this.suppliers_retail_trade_details.forEach(val => { this.suppliers_retail_trade_details.forEach(val => {
let Ref_Trade_Goods : any = { let Ref_Trade_Goods : any = {
@ -477,9 +469,9 @@ tradingFormCreation(val) {
datas.retail_traded_goods.forEach((val,index) => { datas.retail_traded_goods.forEach((val,index) => {
if(val.estimated_traded_goods_value){ if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords[index] = this._pd.convertNumberToWords(val.estimated_traded_goods_value); this.inWords(val.estimated_traded_goods_value,3,index);
// this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
} }
this.checkComments(val.is_sufficiant_traded_goods,3,index);
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
}); });
@ -490,17 +482,17 @@ tradingFormCreation(val) {
} }
} }
createGoods2() { // createGoods2() {
return this.fb.group({ // return this.fb.group({
goods_name: [''], // goods_name: [''],
goods_observed: [''], // goods_observed: [''],
goods_quantity: [''], // goods_quantity: [''],
goods_value: [''], // goods_value: [''],
finished_goods_value: [''], // finished_goods_value: [''],
is_sufficiant_goods: [''], // is_sufficiant_goods: [''],
finishedgoods_remarks:[''] // finishedgoods_remarks:['']
}); // });
} // }
createGoods(records) { createGoods(records) {
if(records === null) { if(records === null) {
@ -532,19 +524,19 @@ tradingFormCreation(val) {
} }
createTradedGoods2() { // createTradedGoods2() {
return this.fb.group({ // return this.fb.group({
traded_goods_name: [''], // traded_goods_name: [''],
traded_goods_observed: [''], // traded_goods_observed: [''],
traded_goods_quantity: [''], // traded_goods_quantity: [''],
traded_goods_uom: [''], // traded_goods_uom: [''],
traded_goods_other_uom: [''], // traded_goods_other_uom: [''],
estimated_traded_goods_value: [''], // estimated_traded_goods_value: [''],
// traded_goods_value: [''], // // traded_goods_value: [''],
is_sufficiant_traded_goods: [''], // is_sufficiant_traded_goods: [''],
traded_goods_remarks:[''] // traded_goods_remarks:['']
}); // });
} // }
initTradingDetails(datas) { initTradingDetails(datas) {
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'];
@ -577,9 +569,9 @@ tradingFormCreation(val) {
datas.trading_traded_goods.forEach((val,index) => { datas.trading_traded_goods.forEach((val,index) => {
if(val.estimated_traded_goods_value){ if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords[index] = this._pd.convertNumberToWords(val.estimated_traded_goods_value); this.inWords(val.estimated_traded_goods_value,4,index);
// this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
} }
this.checkComments(val.is_sufficiant_traded_goods,4,index);
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
}); });
} }
@ -620,77 +612,51 @@ tradingFormCreation(val) {
} }
} }
/** Manufacturing -> To Add More Raw Material Details */
addRawMaterials(flag) { addRawMaterials(flag) {
if(flag==1){ if(flag==1){
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
control.push(this.createRawmaterial(null)); control.push(this.createRawmaterial(null));
} }
} }
/** Manufacturing -> To Remove Raw Material Details */
deleteRawMaterials(index,flag) { deleteRawMaterials(index,flag) {
if(flag==1){ if(flag==1){
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
// const control = <FormArray>this.stockForms.controls['raw_materials'];
control.removeAt(index); control.removeAt(index);
} }
} }
/** Manufacturing -> To Add More Finished Goods */
addGoods(flag) { addGoods(flag) {
//const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; if(flag == 1){
//const control = <FormArray>this.stockForms.controls['finished_goods'];
//control.push(this.createGoods(null));
switch(flag){
case 1: {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
control.push(this.createGoods(null)); control.push(this.createGoods(null));
break;
}
case 2: {
break;
}
case 3: {
break;
}
default: {
break;
}
} }
} }
/** Manufacturing -> To Remove Finished Goods */
deleteGoods(index,flag) { deleteGoods(index,flag) {
switch(flag){ if(flag == 1){
case 1: {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
control.removeAt(index); control.removeAt(index);
break;
} }
case 2: {
break;
}
case 3: {
break;
}
default: {
break;
}
}
//const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
//const control = <FormArray>this.stockForms.controls['finished_goods'];
} }
/**
* Case 1 Retail Traded -> To Add More trade Goods
* Case 2 wholesale Traded -> To Add More trade Goods
*/
addTradedGoods(flag) { addTradedGoods(flag) {
switch(flag){ switch(flag){
case 1: { case 1: {
break;
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.push(this.createTradedGoods(null)); control.push(this.createTradedGoods(null));
break; break;
} }
case 3: { case 2: {
const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods'];
control.push(this.createTradedGoods(null)); control.push(this.createTradedGoods(null));
break; break;
@ -700,17 +666,19 @@ tradingFormCreation(val) {
} }
} }
} }
/**
* Case 1 Retail Traded -> To remove trade Goods
* Case 2 wholesale Traded -> To remove trade Goods
*/
deleteTradedGoods(index,flag) { deleteTradedGoods(index,flag) {
switch(flag){ switch(flag){
case 1:{ case 1: {
break;
}
case 2: {
const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; const control = <FormArray>this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods'];
control.removeAt(index); control.removeAt(index);
break; break;
} }
case 3: { case 2: {
const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; const control = <FormArray>this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods'];
control.removeAt(index); control.removeAt(index);
break; break;
@ -729,10 +697,10 @@ tradingFormCreation(val) {
submitDetails(e) { submitDetails(e) {
this.submitted = true; this.submitted = true;
// stop here if form is invalid // stop here if form is invalid
// if (this.stockForms.invalid) { if (this.stockForms.invalid) {
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
// return; return;
// } else { } else {
var answerFormValues = this.stockForms.value; var answerFormValues = this.stockForms.value;
//To Remove The "Null" With Key also //To Remove The "Null" With Key also
@ -755,7 +723,7 @@ tradingFormCreation(val) {
}); });
//} }
} }
// validateAllFormFields(formGroup: FormGroup) { // validateAllFormFields(formGroup: FormGroup) {
@ -795,49 +763,50 @@ tradingFormCreation(val) {
switch(flag){ switch(flag){
case 1 : case 1 :
this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value); this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e);
break; break;
case 2 : case 2 :
this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e);
break; break;
case 3 : case 3 :
this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e);
break; break;
case 4 : case 4 :
this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e);
break; break;
case 5 :
this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 6 :
this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
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: default:
break; break;
} }
} }
checkComments(e,flag,index){
// console.log(e);
// console.log(flag);
// console.log(index);
if(flag == 1 && e=='no'){
this.mrmCommentFlag[index] = true;
}
else if(flag == 1 && e!='no'){
this.mrmCommentFlag[index] = false;
}
if(flag == 2 && e=='no'){
this.mfgCommentFlag[index] = true;
}
else if(flag == 2 && e!='no'){
this.mfgCommentFlag[index] = false;
}
if(flag == 3 && e=='no'){
this.rtrdCommentFlag[index] = true;
}
else if(flag == 3 && e!='no'){
this.rtrdCommentFlag[index] = false;
}
if(flag == 4 && e=='no'){
this.wtrdCommentFlag[index] = true;
}
else if(flag == 4 && e!='no'){
this.wtrdCommentFlag[index] = false;
}
}
} }

View File

@ -89,6 +89,7 @@ export class SupplierInfoComponent implements OnInit {
errorMessage: any = ''; errorMessage: any = '';
ngOnInit() { ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => { this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
console.log(data);
if(data.dataStatus){ if(data.dataStatus){
// let datas = { // let datas = {
// "profession_name": "Others", // "profession_name": "Others",