AI changes

This commit is contained in:
gandhimathi 2019-03-21 11:43:52 +05:30
parent a95a0597df
commit 38217e4451
14 changed files with 54 additions and 29 deletions

View File

@ -34,14 +34,14 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Expenses" formControlName="annual_expenses_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_expenses_value != ''">{{"&#8377;"}} {{item.value.annual_expenses_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 88%">
<div class="item-product-margin" fxFlex="100">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</div>

View File

@ -19,4 +19,8 @@
.item-margin {
margin-left:4%;
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}

View File

@ -34,7 +34,7 @@
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
<mat-form-field style="width: 50%">
<mat-form-field style="width: 44%">
<input OnlyNumber type="text" matInput placeholder="Bill Value" (keyup)="salesCalculation(s,sales.value)" formControlName="sales_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="childItem.value.sales_value != ''">{{"&#8377;"}} {{childItem.value.sales_value | numberToWords}} Only</mat-hint>
</mat-form-field>
@ -63,11 +63,11 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 44%">
<mat-form-field style="width: 41%">
<input OnlyNumber type="text" matInput placeholder="Value" (keyup)="salesCalculation(s,sales.value)" formControlName="frequency_value" required>
<mat-hint align="start" style="font-size:90%" *ngIf="childItem.value.frequency_value != ''">{{"&#8377;"}} {{childItem.value.frequency_value | numberToWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 88%">
<mat-form-field style="width: 85%">
<input OnlyNumber type="text" matInput placeholder="Annual Value" (keyup)="salesCalculation(s,sales.value)" formControlName="sales_value" readonly required>
<mat-hint align="start" style="font-size:90%" *ngIf="childItem.value.sales_value != ''">{{"&#8377;"}} {{childItem.value.sales_value | numberToWords}} Only</mat-hint>
</mat-form-field>
@ -84,13 +84,13 @@
<mat-form-field style="width: 40%" *ngIf="data.margin_calculation_status===true">
<input matInput OnlyNumber type="text" placeholder="Magin Percetage %" formControlName="margin_per" (keyup)="salesCalculation(s,sales.value)">
</mat-form-field>
<mat-form-field style="width: 44%" *ngIf="data.margin_calculation_status===true">
<mat-form-field style="width: 47%" *ngIf="data.margin_calculation_status===true">
<input matInput OnlyNumber type="text" placeholder="Margin Value" formControlName="margin_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.margin_value != ''">{{"&#8377;"}} {{sales.value.margin_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<mat-form-field style="width: 88%">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments" [required]="sales.value.sales_type=='2' ? true : false"></textarea>
</mat-form-field>

View File

@ -20,6 +20,9 @@
margin-left:4%;
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}
.example-radio-group {
display: flex;
flex-direction: row;

View File

@ -235,7 +235,7 @@ salesCalculation(indexVal: number,values: any): void {
changeOptions(indexVal: any,event: any): void{
let control: any = <FormArray>this.salesItemForm.controls['sales_product'];
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
if(event.value==1){
if(event.value=="1"){
for (let i = 0; i < innercontrol.value.length-1; i++) {
innercontrol.removeAt(i);
}
@ -256,7 +256,7 @@ changeOptions(indexVal: any,event: any): void{
control.controls[indexVal].controls['comments'].clearValidators();
control.controls[indexVal].controls['comments'].updateValueAndValidity();
}
else if(event.value==2){
else if(event.value=="2"){
for (let i = 0; i < innercontrol.value.length-1; i++) {
innercontrol.removeAt(i);
}
@ -264,9 +264,11 @@ changeOptions(indexVal: any,event: any): void{
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].clearValidators();
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].setValidators([Validators.required]);
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].setValidators([Validators.required]);
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].updateValueAndValidity();

View File

@ -31,14 +31,14 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Expenses" formControlName="annual_expense_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_expense_value != ''">{{"&#8377;"}} {{item.value.annual_expense_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 88%">
<div class="item-product-margin" fxFlex="100">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</div>

View File

@ -19,4 +19,8 @@
.item-margin {
margin-left:4%;
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}

View File

@ -33,15 +33,15 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 25%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Income" formControlName="annual_income_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_income_value != ''">{{"&#8377;"}} {{item.value.annual_income_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 88%">
<div class="item-product-margin" fxFlex="100">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</div>

View File

@ -19,4 +19,8 @@
.item-margin {
margin-left:4%;
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}

View File

@ -30,7 +30,7 @@
<mat-option *ngFor="let uom of UOMData" [value]="uom.uom_id">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="item.controls['uom_other']">
<mat-form-field style="width: 27%" *ngIf="item.controls['uom_other']">
<input type="text" matInput placeholder="Other UOM" formControlName="uom_other" required>
</mat-form-field>
@ -47,14 +47,14 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"&#8377;"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 88%">
<div class="item-product-margin" fxFlex="100">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</div>

View File

@ -19,4 +19,8 @@
.item-margin {
margin-left:4%;
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}

View File

@ -36,7 +36,7 @@
<mat-option *ngFor="let uom of UOMData" [value]="uom.uom_id">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="sales.controls['uom_other']">
<mat-form-field style="width: 27%" *ngIf="sales.controls['uom_other']">
<input type="text" matInput placeholder="Other UOM" formControlName="uom_other" required>
</mat-form-field>
@ -54,7 +54,7 @@
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Sales" formControlName="annual_sale_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.annual_sale_value != ''">{{"&#8377;"}} {{sales.value.annual_sale_value | numberToWords}} Only</mat-hint>
</mat-form-field>
@ -71,7 +71,7 @@
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.rate_per_unit != ''">{{"&#8377;"}} {{sales.value.rate_per_unit | numberToWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 27%">
<input matInput OnlyNumber type="text" placeholder="Annual Sales" formControlName="annual_sale_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.annual_sale_value != ''">{{"&#8377;"}} {{sales.value.annual_sale_value | numberToWords}} Only</mat-hint>
</mat-form-field>
@ -81,7 +81,7 @@
<div class="item-margin" fxFlex="100" *ngIf="data.margin_calculation_status===true">
<div class="item-product-margin" fxFlex="100" *ngIf="data.margin_calculation_status===true">
<mat-form-field style="width: 25%">
<input matInput OnlyNumber type="text" placeholder="Margin Percentage %" formControlName="margin_per" (keyup)="salesMarginPerCalculation(s,sales.value)">
</mat-form-field>
@ -89,13 +89,13 @@
<input matInput OnlyNumber type="text" placeholder="Margin Per Unit" formControlName="margin_per_uom" (keyup)="salesMarginAmtCalculation(s,sales.value)">
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.margin_per_uom != ''">{{"&#8377;"}} {{sales.value.margin_per_uom | numberToWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 34%">
<input matInput OnlyNumber type="text" placeholder="Considered Margin Amount" formControlName="margin_final_value" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="sales.value.margin_final_value != ''">{{"&#8377;"}} {{sales.value.margin_final_value | numberToWords}} Only</mat-hint>
</mat-form-field>
</div>
<div class="item-margin" fxFlex="100">
<mat-form-field style="width: 88%">
<div class="item-product-margin" fxFlex="100">
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</div>

View File

@ -21,6 +21,10 @@
margin-top:2%;
}
.item-product-margin{
margin-top:2%;
}
.example-radio-group {
display: flex;
flex-direction: row;

View File

@ -162,7 +162,7 @@ generateOtherUOM(index: number, values: any): void {
// change options for either Quantity and Rate Information / Value Information
changeOptions(indexVal: any,event: any): void{
let control: any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
if(event.value==1){
if(event.value=="1"){
control.controls[indexVal].controls['sales_qty'].setValidators([Validators.required]);
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();
@ -170,7 +170,7 @@ let control: any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
this.salesCalculation(indexVal,control.controls[indexVal].value);
}
else if(event.value==2){
else if(event.value=="2"){
control.controls[indexVal].controls['sales_qty'].setValue("");
control.controls[indexVal].controls['sales_qty'].clearValidators();
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();