AI Changes
This commit is contained in:
parent
db8a8fa758
commit
1268899a91
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
#Sat Mar 23 18:56:32 IST 2019
|
#Thu Mar 28 10:13:57 IST 2019
|
||||||
base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0
|
base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0
|
||||||
path.0=classes.dex
|
path.0=classes.dex
|
||||||
renamed.0=classes.dex
|
renamed.0=classes.dex
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#Internal package file, do not edit.
|
#Internal package file, do not edit.
|
||||||
#Sat Mar 23 18:56:33 IST 2019
|
#Thu Mar 28 10:13:57 IST 2019
|
||||||
60.set=ASSET
|
60.set=ASSET
|
||||||
52.set=ASSET
|
52.set=ASSET
|
||||||
53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug
|
53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -46,7 +46,7 @@
|
|||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
|
|
||||||
<ion-col col-1>
|
<ion-col col-1>
|
||||||
<a (click)="deleteBuisnessDetails(i)">
|
<a (click)="deleteBuisnessDetails(i,item.value)">
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
@ -74,12 +74,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-row>
|
<!-- <ion-row> -->
|
||||||
<!-- <ion-buttons >
|
<!-- <ion-buttons >
|
||||||
<ion-button color="optblue"
|
<ion-button color="optblue"
|
||||||
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
||||||
<button ion-button full (click)="saveBusinessData(BuissnessForm.value)"color="optblue"> Save</button>
|
<!-- <button ion-button full (click)="saveBusinessData(BuissnessForm.value)"color="optblue"> Save</button> -->
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
</ion-row>
|
<!-- </ion-row> -->
|
||||||
</form>
|
</form>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button full (click)="saveBusinessData(BuissnessForm.value)"color="optblue"> Save</button>
|
||||||
|
</ion-footer>
|
||||||
|
|||||||
@ -107,13 +107,40 @@ export class PdQuestionAssessedBusinessPage {
|
|||||||
control.push(this.createBusinessDetails());
|
control.push(this.createBusinessDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteBuisnessDetails(i)
|
deleteBuisnessDetails(i,item)
|
||||||
{
|
{
|
||||||
|
console.log("item",item);
|
||||||
this.expenseannual.splice(i,1);
|
this.expenseannual.splice(i,1);
|
||||||
this.grandExpenseTotal = this.expenseannual.reduce((a,b)=> +a + +b,0);
|
this.grandExpenseTotal = this.expenseannual.reduce((a,b)=> +a + +b,0);
|
||||||
|
|
||||||
|
let deleteRecords:any;
|
||||||
|
if(item.fk_pd_id !=null){
|
||||||
|
deleteRecords=[{
|
||||||
|
pd_expense_id:item.pd_expense_id,
|
||||||
|
fk_pd_id:item.fk_pd_id,
|
||||||
|
company_id:this.pdDetails.company_id,
|
||||||
|
isactive:false
|
||||||
|
|
||||||
|
}]
|
||||||
|
|
||||||
|
let records:any={'records':deleteRecords}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomeBusinessExpenses',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Deleted Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Something Went Wrong");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const control = <FormArray>this.BuissnessForm.controls['busExpense'] as FormArray;
|
const control = <FormArray>this.BuissnessForm.controls['busExpense'] as FormArray;
|
||||||
|
if(control.length==1){
|
||||||
|
control.reset();
|
||||||
|
}
|
||||||
|
else{
|
||||||
control.removeAt(i);
|
control.removeAt(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
busExpensecalculat(index,details)
|
busExpensecalculat(index,details)
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="text" placeholder="Product / Service" formControlName="sales_item" name="sales_item">
|
<input matInput type="text" placeholder="Product / Service" formControlName="sales_item" name="sales_item">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-radio-group class="example-radio-group" formControlName="sales_type" (change)="changeOptions(sale_i,$event)">
|
<mat-radio-group class="example-radio-group" formControlName="sales_type" (change)="changeOptions(sale_i,$event.value)">
|
||||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
|
|
||||||
@ -87,7 +87,7 @@
|
|||||||
<!-- <a (click)="deleterentalHome(rent_i)">
|
<!-- <a (click)="deleterentalHome(rent_i)">
|
||||||
<ion-icon name="md-close" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-close" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a> -->
|
</a> -->
|
||||||
<button ion-button (click)="deletedailySalesProduct(sale_i)" color="primary">Remove</button>
|
<button ion-button (click)="deletedailySalesProduct(sale_i,item.value)" color="primary">Remove</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|
||||||
@ -96,10 +96,10 @@
|
|||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div *ngIf="margin_calculation_status">
|
<div *ngIf="margin_calculation_status">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="text" placeholder="Magin Percetage %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(sale_i,item.value)">
|
<input matInput type="number" placeholder="Magin Percetage %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(sale_i,item.value)">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="text" placeholder="Margin Value" formControlName="margin_value" name="margin_value" readonly>
|
<input matInput type="number" placeholder="Margin Value" formControlName="margin_value" name="margin_value" readonly>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('margin_value').value != ''">{{"₹"}} {{marginAmtInwords[sale_i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('margin_value').value != ''">{{"₹"}} {{marginAmtInwords[sale_i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@ -112,15 +112,18 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-row>
|
<!-- <ion-row> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <ion-buttons >
|
<!-- <ion-buttons >
|
||||||
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
||||||
<button ion-button full color="optblue" (click)="saveData(salesDailyForm.value)"> Save</button>
|
<!-- <button ion-button full color="optblue" (click)="saveData(salesDailyForm.value)"> Save</button> -->
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
|
|
||||||
</ion-row>
|
<!-- </ion-row> -->
|
||||||
</form>
|
</form>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button full color="optblue" (click)="saveData(salesDailyForm.value)"> Save</button>
|
||||||
|
</ion-footer>
|
||||||
|
|||||||
@ -68,10 +68,11 @@ export class PdQuestionAssessedDailySalesPage {
|
|||||||
}
|
}
|
||||||
// change options for either Date/Frequency Information
|
// change options for either Date/Frequency Information
|
||||||
changeOptions(indexVal: any,event: any): void{
|
changeOptions(indexVal: any,event: any): void{
|
||||||
|
console.log("event",event)
|
||||||
let control: any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
let control: any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||||
console.log("control",control)
|
console.log("control",control)
|
||||||
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
|
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
|
||||||
if(event.value=="1"){
|
if(event=="1"){
|
||||||
for (let i = 0; i < innercontrol.value.length-1; i++) {
|
for (let i = 0; i < innercontrol.value.length-1; i++) {
|
||||||
innercontrol.removeAt(i);
|
innercontrol.removeAt(i);
|
||||||
}
|
}
|
||||||
@ -88,11 +89,11 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
|
|
||||||
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
|
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
|
||||||
|
|
||||||
control.controls[indexVal].controls['comments'].setValue("");
|
// control.controls[indexVal].controls['comments'].setValue("");
|
||||||
// control.controls[indexVal].controls['comments'].clearValidators();
|
// control.controls[indexVal].controls['comments'].clearValidators();
|
||||||
//control.controls[indexVal].controls['comments'].updateValueAndValidity();
|
//control.controls[indexVal].controls['comments'].updateValueAndValidity();
|
||||||
}
|
}
|
||||||
else if(event.value=="2"){
|
else if(event=="2"){
|
||||||
for (let i = 0; i < innercontrol.value.length-1; i++) {
|
for (let i = 0; i < innercontrol.value.length-1; i++) {
|
||||||
innercontrol.removeAt(i);
|
innercontrol.removeAt(i);
|
||||||
}
|
}
|
||||||
@ -127,6 +128,7 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
sales_type:[null,Validators.compose([Validators.required])],
|
sales_type:[null,Validators.compose([Validators.required])],
|
||||||
child: this.fb.array([]),
|
child: this.fb.array([]),
|
||||||
fk_pd_id: [this.pdDetails.pd_id],
|
fk_pd_id: [this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
margin_per: [null],
|
margin_per: [null],
|
||||||
margin_value: [null],
|
margin_value: [null],
|
||||||
comments:[null],
|
comments:[null],
|
||||||
@ -198,13 +200,18 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
|
|
||||||
}
|
}
|
||||||
salesCalculation(indexVal: number,values: any): void {
|
salesCalculation(indexVal: number,values: any): void {
|
||||||
|
console.log(indexVal,values)
|
||||||
|
console.log("Margin",this.margin_calculation_status);
|
||||||
if(this.margin_calculation_status===true && values.sales_type=="1"){
|
if(this.margin_calculation_status===true && values.sales_type=="1"){
|
||||||
|
console.log("value == 1")
|
||||||
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||||
if(values.child.length>0 && values.margin_per!='' && values.margin_per!=null){
|
if(values.child.length>0 && values.margin_per!='' && values.margin_per!=null){
|
||||||
let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{
|
// let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{
|
||||||
|
let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive==1).map(mval=>{
|
||||||
mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM');
|
mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM');
|
||||||
return mval;
|
return mval;
|
||||||
});
|
});
|
||||||
|
console.log("transform",transformData)
|
||||||
if(transformData.length>0) {
|
if(transformData.length>0) {
|
||||||
let getUniqueMonthCounts = transformData.map(val=>val.custum_date)
|
let getUniqueMonthCounts = transformData.map(val=>val.custum_date)
|
||||||
.filter((fVal,fIndex,fArray)=>{
|
.filter((fVal,fIndex,fArray)=>{
|
||||||
@ -212,15 +219,20 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
});
|
});
|
||||||
let getTotalValueCounts = transformData.map(val=>val.sales_value)
|
let getTotalValueCounts = transformData.map(val=>val.sales_value)
|
||||||
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
||||||
|
console.log("value",parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)))
|
||||||
|
console.log(control.controls[indexVal])
|
||||||
control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)));
|
control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)));
|
||||||
this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2)
|
this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
console.log("else 1")
|
||||||
control.controls[indexVal].controls['margin_value'].setValue("");
|
control.controls[indexVal].controls['margin_value'].setValue("");
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log("else 1")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
console.log("else 2")
|
||||||
control.controls[indexVal].controls['margin_value'].setValue('');
|
control.controls[indexVal].controls['margin_value'].setValue('');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -289,9 +301,31 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
deletedailySalesProduct(index) {
|
deletedailySalesProduct(index,item) {
|
||||||
|
console.log("fk_pd_id",item);
|
||||||
this.tempdate.slice(index,1);
|
this.tempdate.slice(index,1);
|
||||||
|
let deleteRecords:any;
|
||||||
|
|
||||||
|
if(item.fk_pd_id !=null){
|
||||||
|
deleteRecords=[{
|
||||||
|
sim_id:item.sim_id,
|
||||||
|
fk_pd_id:item.fk_pd_id,
|
||||||
|
company_id:this.pdDetails.company_id,
|
||||||
|
isactive:false
|
||||||
|
|
||||||
|
}]
|
||||||
|
|
||||||
|
let records:any={'records':deleteRecords}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomeMonthwiseItems',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Deleted Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Something Went Wrong");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const control = (<FormArray>this.salesDailyForm.controls['sales_product']) as FormArray;
|
const control = (<FormArray>this.salesDailyForm.controls['sales_product']) as FormArray;
|
||||||
if (control.length == 1) {
|
if (control.length == 1) {
|
||||||
this.salesDailyForm.controls['sales_product'].reset();
|
this.salesDailyForm.controls['sales_product'].reset();
|
||||||
@ -323,9 +357,9 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
});
|
});
|
||||||
if (this.salesDailyForm.valid) {
|
if (this.salesDailyForm.valid) {
|
||||||
let records = { 'records': answerData.sales_product };
|
let records = { 'records': answerData.sales_product };
|
||||||
console.log("answer Data",answerData.sales_product)
|
console.log("answer Data",records)
|
||||||
|
|
||||||
this.qustCat.saveassessedForms('saveAssessedIncomeMonthwiseItems', answerData.sales_product).subscribe(res => {
|
this.qustCat.saveassessedForms('saveAssessedIncomeMonthwiseItems', records).subscribe(res => {
|
||||||
if (res['dataStatus'] == true) {
|
if (res['dataStatus'] == true) {
|
||||||
|
|
||||||
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
|
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
|
||||||
@ -344,10 +378,12 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
getDailySalesData(dailySalesData) {
|
getDailySalesData(dailySalesData) {
|
||||||
|
|
||||||
const control = <FormArray>this.salesDailyForm.get('sales_product') as FormArray;
|
const control = <FormArray>this.salesDailyForm.get('sales_product') as FormArray;
|
||||||
|
let control1: any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||||
let salesChildControl;
|
let salesChildControl;
|
||||||
let salesChildControlarr = [];
|
let salesChildControlarr = [];
|
||||||
dailySalesData.forEach((val, index) => {
|
dailySalesData.forEach((val, index) => {
|
||||||
|
|
||||||
|
|
||||||
control.push(this.dailySalesWithData(val));
|
control.push(this.dailySalesWithData(val));
|
||||||
if(val.margin_value != null){
|
if(val.margin_value != null){
|
||||||
this.marginAmtInwords[index]=this.constant.convertNumberToWords(val.margin_value)
|
this.marginAmtInwords[index]=this.constant.convertNumberToWords(val.margin_value)
|
||||||
@ -358,12 +394,16 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
|
|
||||||
salesChildControlarr[index].forEach((vals, i) => {
|
salesChildControlarr[index].forEach((vals, i) => {
|
||||||
vals.forEach((item, key) => {
|
vals.forEach((item, key) => {
|
||||||
|
if(val.sales_type != 2){
|
||||||
let saleDate = new Date(item.sales_date);
|
let saleDate = new Date(item.sales_date);
|
||||||
|
|
||||||
item.sales_date = saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() + 1)).slice(-2);
|
item.sales_date = saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() + 1)).slice(-2);
|
||||||
|
}
|
||||||
|
|
||||||
//console.log("sale data",new Date(this.pipe.transform(item.sales_date, 'dd-MM-yyyy')))
|
//console.log("sale data",new Date(this.pipe.transform(item.sales_date, 'dd-MM-yyyy')))
|
||||||
|
console.log("itme",val)
|
||||||
console.log("sale",item.sales_date)
|
console.log("sale",item.sales_date)
|
||||||
salesChildControl.push(this.dailySalesChildWithData(item, val.sim_id));
|
salesChildControl.push(this.dailySalesChildWithData(item, val.sim_id,val.sales_type));
|
||||||
if(item.sales_value !=null){
|
if(item.sales_value !=null){
|
||||||
this.Value[key]=this.constant.convertNumberToWords(item.sales_value)
|
this.Value[key]=this.constant.convertNumberToWords(item.sales_value)
|
||||||
}
|
}
|
||||||
@ -372,8 +412,25 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// this.changeOptions(index,val.sales_type)
|
||||||
|
if(val.sales_type=="2"){
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['sales_date'].setValue("");
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['sales_date'].clearValidators();
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['sales_date'].updateValueAndValidity();
|
||||||
|
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['fk_frequency_id'].setValidators([Validators.required]);
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['fk_frequency_id'].updateValueAndValidity();
|
||||||
|
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['frequency_value'].setValidators([Validators.required]);
|
||||||
|
salesChildControl.controls[salesChildControl.value.length-1].controls['frequency_value'].updateValueAndValidity();
|
||||||
|
|
||||||
|
// control1.controls[control.value.length-1].controls['comments'].setValidators([Validators.required]);
|
||||||
|
// control1.controls[control.value.length-1].controls['comments'].updateValueAndValidity();
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("aall",this.salesDailyForm.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
dailySalesWithData(data) {
|
dailySalesWithData(data) {
|
||||||
@ -385,6 +442,7 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
||||||
child: this.fb.array([]),
|
child: this.fb.array([]),
|
||||||
fk_pd_id: [this.pdDetails.pd_id],
|
fk_pd_id: [this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
fk_createdby: [this.users],
|
fk_createdby: [this.users],
|
||||||
isactive: ['1'],
|
isactive: ['1'],
|
||||||
margin_per: [data.margin_per],
|
margin_per: [data.margin_per],
|
||||||
@ -392,14 +450,15 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
comments:[data.comments]
|
comments:[data.comments]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
dailySalesChildWithData(data, fk_id) {
|
dailySalesChildWithData(data, fk_id,salesType) {
|
||||||
|
|
||||||
|
|
||||||
|
console.log("Sales type",salesType)
|
||||||
return this.fb.group(
|
return this.fb.group(
|
||||||
{
|
{
|
||||||
simc_id: [data.simc_id],
|
simc_id: [data.simc_id],
|
||||||
fk_sim_id: [fk_id],
|
fk_sim_id: [fk_id],
|
||||||
sales_date: [data.sales_date, Validators.compose([Validators.required])],
|
// sales_date: [data.sales_date, Validators.compose([Validators.required])],
|
||||||
|
sales_date:[salesType=='2' ? '' :new Date(this.pipe.transform(data.sales_date, 'yyyy-MM-dd')), Validators.compose([Validators.required])],
|
||||||
// sales_date: [new Date(this.pipe.transform(data.sales_date, 'dd-MM-yyyy')), Validators.compose([Validators.required])],
|
// sales_date: [new Date(this.pipe.transform(data.sales_date, 'dd-MM-yyyy')), Validators.compose([Validators.required])],
|
||||||
sales_value: [data.sales_value, Validators.compose([Validators.required])],
|
sales_value: [data.sales_value, Validators.compose([Validators.required])],
|
||||||
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
||||||
@ -407,5 +466,6 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
isactive: ['1'],
|
isactive: ['1'],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,3 +193,8 @@
|
|||||||
</mat-card> -->
|
</mat-card> -->
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
|
||||||
|
<button block ion-button color="optblue" (click)="presentConfirm()">Complete</button>
|
||||||
|
|
||||||
|
</ion-footer>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams ,AlertController} from 'ionic-angular';
|
||||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
||||||
@ -37,7 +37,8 @@ export class PdQuestionAssessedDashPage {
|
|||||||
FormId: any;
|
FormId: any;
|
||||||
pdDetails: any;
|
pdDetails: any;
|
||||||
assessedForm:FormGroup;
|
assessedForm:FormGroup;
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider) {
|
alertShown: boolean;
|
||||||
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public alertCtrl:AlertController) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.FormId = this.navParams.get('formDetails');
|
this.FormId = this.navParams.get('formDetails');
|
||||||
this.users = this.aws.getlocale();
|
this.users = this.aws.getlocale();
|
||||||
@ -111,7 +112,7 @@ else{
|
|||||||
|
|
||||||
getassessedIncome()
|
getassessedIncome()
|
||||||
{
|
{
|
||||||
let records = {'pd_id':this.pdDetails.pd_id};
|
let records = {'pd_id':this.pdDetails.pd_id,'company_id':this.pdDetails.company_id};
|
||||||
this.qustCat.retiverassessedForm('getAssessedIncome',records).subscribe(res=>
|
this.qustCat.retiverassessedForm('getAssessedIncome',records).subscribe(res=>
|
||||||
{
|
{
|
||||||
if(res['dataStatus']==true)
|
if(res['dataStatus']==true)
|
||||||
@ -161,7 +162,53 @@ else{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
completeAI(){
|
||||||
|
let updateStatus={
|
||||||
|
"fk_pd_id":this.pdDetails.pd_id,
|
||||||
|
"company_id":this.pdDetails.company_id,
|
||||||
|
"calc_type_id":this.grossprofit.calc_type_id,
|
||||||
|
"is_completed":1
|
||||||
|
}
|
||||||
|
let records:any={'records':updateStatus}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomeCalculateMode',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Assessed Income Completed Successfully")
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.navCtrl.pop();
|
||||||
|
},1000)
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Error")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
presentConfirm(){
|
||||||
|
let alert=this.alertCtrl.create({
|
||||||
|
title:'Complete Assessed Income',
|
||||||
|
message:'Please confirm you are completing the Assessed Income details?',
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
text:'No',
|
||||||
|
role:'no',
|
||||||
|
handler:()=>{
|
||||||
|
console.log("Cancel clicked");
|
||||||
|
//this.alertShown=false
|
||||||
|
alert.dismiss
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text:'Yes',
|
||||||
|
handler:()=>{
|
||||||
|
console.log("Exit");
|
||||||
|
this.completeAI()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
|
// this.alertShown=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<ion-col col-1>
|
<ion-col col-1>
|
||||||
<a (click)="deleteHouseExpense(i)">
|
<a (click)="deleteHouseExpense(i,item.value)">
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
@ -68,12 +68,15 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-row>
|
<!-- <ion-row> -->
|
||||||
<!-- <ion-buttons >
|
<!-- <ion-buttons >
|
||||||
<ion-button color="optblue"
|
<ion-button color="optblue"
|
||||||
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
||||||
<button ion-button full (click)="saveHouseExpenseData(houseHoldForm.value)"color="optblue"> Save</button>
|
<!-- <button ion-button full (click)="saveHouseExpenseData(houseHoldForm.value)"color="optblue"> Save</button> -->
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
</ion-row>
|
<!-- </ion-row> -->
|
||||||
</form>
|
</form>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button full (click)="saveHouseExpenseData(houseHoldForm.value)"color="optblue"> Save</button>
|
||||||
|
</ion-footer>
|
||||||
|
|||||||
@ -30,6 +30,7 @@ export class PdQuestionAssessedHouseholdPage {
|
|||||||
houseHoldForm:FormGroup;
|
houseHoldForm:FormGroup;
|
||||||
Value: any=[];
|
Value: any=[];
|
||||||
AnnualExpenses: any=[];
|
AnnualExpenses: any=[];
|
||||||
|
// nn:Object[][]=[]
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public cons:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public cons:ConstantsProvider) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.houseExpenseDetails = this.navParams.get('FormId');
|
this.houseExpenseDetails = this.navParams.get('FormId');
|
||||||
@ -67,7 +68,8 @@ export class PdQuestionAssessedHouseholdPage {
|
|||||||
return this.fb.group(
|
return this.fb.group(
|
||||||
{
|
{
|
||||||
household_expense_id:[null],
|
household_expense_id:[null],
|
||||||
fk_pd_id:[this.pdDetails.pd_id] ,
|
fk_pd_id:[this.pdDetails.pd_id] ,
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
expense_item: [null,Validators.compose([Validators.required])],
|
expense_item: [null,Validators.compose([Validators.required])],
|
||||||
expense_value: [null,Validators.compose([Validators.required])],
|
expense_value: [null,Validators.compose([Validators.required])],
|
||||||
fk_frequency_id: [null,Validators.compose([Validators.required])],
|
fk_frequency_id: [null,Validators.compose([Validators.required])],
|
||||||
@ -86,12 +88,37 @@ export class PdQuestionAssessedHouseholdPage {
|
|||||||
control.push(this.createHouseExpense());
|
control.push(this.createHouseExpense());
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteHouseExpense(i)
|
deleteHouseExpense(i,item)
|
||||||
{
|
{
|
||||||
this.houseannual.splice(i,1);
|
this.houseannual.splice(i,1);
|
||||||
this.grandHouseExpenseTotal = this.houseannual.reduce((a,b)=> +a + +b,0);
|
this.grandHouseExpenseTotal = this.houseannual.reduce((a,b)=> +a + +b,0);
|
||||||
|
let deleteRecords:any
|
||||||
|
if(item.household_expense_id !=null){
|
||||||
|
deleteRecords=[{
|
||||||
|
household_expense_id:item.household_expense_id,
|
||||||
|
fk_pd_id:item.fk_pd_id,
|
||||||
|
company_id:this.pdDetails.company_id,
|
||||||
|
isactive:false
|
||||||
|
|
||||||
|
}]
|
||||||
|
|
||||||
|
let records:any={'records':deleteRecords}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomeHouseholdExpenses',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Deleted Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Something Went Wrong");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const control = <FormArray>this.houseHoldForm.controls['houseExpense'] as FormArray;
|
const control = <FormArray>this.houseHoldForm.controls['houseExpense'] as FormArray;
|
||||||
control.removeAt(i)
|
if(control.length==1){
|
||||||
|
control.reset();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
control.removeAt(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
houseExpensecalculat(indexVal,values)
|
houseExpensecalculat(indexVal,values)
|
||||||
{
|
{
|
||||||
@ -205,7 +232,8 @@ export class PdQuestionAssessedHouseholdPage {
|
|||||||
return this.fb.group(
|
return this.fb.group(
|
||||||
{
|
{
|
||||||
household_expense_id:[data.household_expense_id],
|
household_expense_id:[data.household_expense_id],
|
||||||
fk_pd_id:[this.pdDetails.pd_id] ,
|
fk_pd_id:[this.pdDetails.pd_id] ,
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
expense_item: [data.expense_item,Validators.compose([Validators.required])],
|
expense_item: [data.expense_item,Validators.compose([Validators.required])],
|
||||||
expense_value: [data.expense_value,Validators.compose([Validators.required])],
|
expense_value: [data.expense_value,Validators.compose([Validators.required])],
|
||||||
fk_frequency_id: [data.fk_frequency_id,Validators.compose([Validators.required])],
|
fk_frequency_id: [data.fk_frequency_id,Validators.compose([Validators.required])],
|
||||||
|
|||||||
@ -207,7 +207,9 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
this.sales_item_month_value = [];
|
this.sales_item_month_value = [];
|
||||||
this.sales_month_wise_data = [];
|
this.sales_month_wise_data = [];
|
||||||
this.sales_item_value= [];
|
this.sales_item_value= [];
|
||||||
let records = {'pd_id':this.pdDetails.pd_id};
|
let records = {'pd_id':this.pdDetails.pd_id,'company_id':this.pdDetails.company_id};
|
||||||
|
console.log("company",this.pdDetails.company_id)
|
||||||
|
console.log("getAssesed",records)
|
||||||
this.qustCat.retiverassessedForm('getAssessedIncome',records).subscribe(res=>
|
this.qustCat.retiverassessedForm('getAssessedIncome',records).subscribe(res=>
|
||||||
{
|
{
|
||||||
if(res['dataStatus']==true)
|
if(res['dataStatus']==true)
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput placeholder="Rate / Unit of Purchase" type="text" name="rate_per_unit" formControlName="rate_per_unit" (keyup)="inWords($event.target.value,i,1)" required>
|
<input matInput placeholder="Rate / Unit of Purchase" type="number" name="rate_per_unit" formControlName="rate_per_unit" (keyup)="inWords($event.target.value,i,1)" required>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('rate_per_unit').value != null"> {{"₹"}} {{RateOfPurchase[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('rate_per_unit').value != null"> {{"₹"}} {{RateOfPurchase[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<ion-col col-1>
|
<ion-col col-1>
|
||||||
<a (click)="deletePurchaseDetails(i)">
|
<a (click)="deletePurchaseDetails(i,item.value)">
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
@ -96,12 +96,15 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-row>
|
<!-- <ion-row> -->
|
||||||
<!-- <ion-buttons >
|
<!-- <ion-buttons >
|
||||||
<ion-button color="optblue"
|
<ion-button color="optblue"
|
||||||
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
||||||
<button ion-button full (click)="savepurchaseData(rawMaterialForm.value)"color="optblue"> Save</button>
|
<!-- <button ion-button full (click)="savepurchaseData(rawMaterialForm.value)"color="optblue"> Save</button> -->
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
</ion-row>
|
<!-- </ion-row> -->
|
||||||
</form>
|
</form>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button full (click)="savepurchaseData(rawMaterialForm.value)"color="optblue"> Save</button>
|
||||||
|
</ion-footer>
|
||||||
|
|||||||
@ -62,6 +62,7 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
{
|
{
|
||||||
purchase_id:[null],
|
purchase_id:[null],
|
||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
purchase_item:[null,Validators.compose([Validators.required])],
|
purchase_item:[null,Validators.compose([Validators.required])],
|
||||||
purchase_qty:[null,Validators.compose([Validators.required])],
|
purchase_qty:[null,Validators.compose([Validators.required])],
|
||||||
fk_uom_id:[null,Validators.compose([Validators.required])],
|
fk_uom_id:[null,Validators.compose([Validators.required])],
|
||||||
@ -104,14 +105,40 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
control.push(this.createPurchaseDetails());
|
control.push(this.createPurchaseDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePurchaseDetails(i)
|
deletePurchaseDetails(i,item)
|
||||||
{
|
{
|
||||||
this.annual.splice(i,1);
|
this.annual.splice(i,1);
|
||||||
|
|
||||||
// this.annual[i].spl
|
// this.annual[i].spl
|
||||||
this.grandpurchaseTotal = this.annual.reduce((a,b)=> +a + +b,0);
|
this.grandpurchaseTotal = this.annual.reduce((a,b)=> +a + +b,0);
|
||||||
|
let deleteRecords:any;
|
||||||
|
if(item.fk_pd_id !=null){
|
||||||
|
deleteRecords=[{
|
||||||
|
purchase_id:item.purchase_id,
|
||||||
|
fk_pd_id:item.fk_pd_id,
|
||||||
|
company_id:this.pdDetails.company_id,
|
||||||
|
isactive:false
|
||||||
|
|
||||||
|
}]
|
||||||
|
|
||||||
|
let records:any={'records':deleteRecords}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomePurchaseDetails',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Deleted Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Something Went Wrong");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const control = <FormArray>this.rawMaterialForm.controls['purchase'] as FormArray
|
const control = <FormArray>this.rawMaterialForm.controls['purchase'] as FormArray
|
||||||
|
if(control.length==1){
|
||||||
|
control.reset();
|
||||||
|
}
|
||||||
|
else{
|
||||||
control.removeAt(i);
|
control.removeAt(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -237,6 +264,7 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
{
|
{
|
||||||
purchase_id:[data.purchase_id],
|
purchase_id:[data.purchase_id],
|
||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
purchase_item:[data.purchase_item,Validators.compose([Validators.required])],
|
purchase_item:[data.purchase_item,Validators.compose([Validators.required])],
|
||||||
purchase_qty:[data.purchase_qty,Validators.compose([Validators.required])],
|
purchase_qty:[data.purchase_qty,Validators.compose([Validators.required])],
|
||||||
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
|
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
|
||||||
|
|||||||
@ -70,7 +70,7 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input OnlyNumber type="number" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (keyup)="salesCalculation(i,item.value)" required>
|
<input OnlyNumber type="number" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (keyup)="salesCalculation(i,item.value);inWords($event.target.value,i,4)" required>
|
||||||
<mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"₹"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
|
<mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"₹"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -84,8 +84,8 @@
|
|||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="number" placeholder="Margin percentage %" (keyup)="salesMarginPerCalculation(i,item.value)" formControlName="margin_per" name="margin_per" >
|
<input matInput type="number" placeholder="Margin percentage %" (keyup)="salesMarginPerCalculation(i,item.value)" formControlName="margin_per" name="margin_per" >
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%" *ngIf="item.value.sales_type=='1'">
|
||||||
<input matInput type="number" placeholder="Margin Amount" (keyup)="salesMarginAmtCalculation(i,item.value)" formControlName="margin_per_uom" name="margin_per_uom">
|
<input matInput type="number" placeholder="Margin Per Unit" (keyup)="salesMarginAmtCalculation(i,item.value)" formControlName="margin_per_uom" name="margin_per_uom">
|
||||||
<mat-hint align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"₹"}} {{marginAmtInwords[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"₹"}} {{marginAmtInwords[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -100,7 +100,7 @@
|
|||||||
<ion-buttons>
|
<ion-buttons>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-1>
|
<ion-col col-1>
|
||||||
<a (click)="removeSalesCal(i)" >
|
<a (click)="removeSalesCal(i,item.value)" >
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon></a>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon></a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col offset-8 col-3 text-right>
|
<ion-col offset-8 col-3 text-right>
|
||||||
@ -114,15 +114,18 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-row>
|
<!-- <ion-row> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <ion-buttons >
|
<!-- <ion-buttons >
|
||||||
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
|
||||||
<button ion-button full color="optblue" (click)="saveData(assessedForm.value)"> Save</button>
|
<!-- <button ion-button full color="optblue" (click)="saveData(assessedForm.value)"> Save</button> -->
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
|
|
||||||
</ion-row>
|
<!-- </ion-row> -->
|
||||||
</form>
|
</form>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button full color="optblue" (click)="saveData(assessedForm.value)"> Save</button>
|
||||||
|
</ion-footer>
|
||||||
|
|||||||
@ -85,13 +85,14 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
return this.fb.group(
|
return this.fb.group(
|
||||||
{
|
{
|
||||||
sci_id:[null],
|
sci_id:[null],
|
||||||
fk_pd_id:[this.pdDetails.pd_id],
|
|
||||||
|
|
||||||
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
sales_item:[null,Validators.compose([Validators.required])],
|
sales_item:[null,Validators.compose([Validators.required])],
|
||||||
sales_qty:[null,Validators.compose([Validators.required])],
|
sales_qty:[null,Validators.compose([Validators.required])],
|
||||||
sales_type:[null,Validators.compose([Validators.required])],
|
sales_type:[null,Validators.compose([Validators.required])],
|
||||||
fk_uom_id:[null,Validators.compose([Validators.required])],
|
fk_uom_id:[null,Validators.compose([Validators.required])],
|
||||||
uom_other:[null,Validators.compose([Validators.required])],
|
uom_other:[null],
|
||||||
rate_per_unit:[null,Validators.compose([Validators.required])],
|
rate_per_unit:[null,Validators.compose([Validators.required])],
|
||||||
fk_frequency_id:[null,Validators.compose([Validators.required])],
|
fk_frequency_id:[null,Validators.compose([Validators.required])],
|
||||||
annual_sale_value:[null],
|
annual_sale_value:[null],
|
||||||
@ -113,13 +114,35 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeSalesCal(i)
|
removeSalesCal(i,item)
|
||||||
{
|
{
|
||||||
|
console.log("value",item)
|
||||||
this.annual.splice(i,1);
|
this.annual.splice(i,1);
|
||||||
|
|
||||||
// this.annual[i].spl
|
// this.annual[i].spl
|
||||||
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
||||||
console.log(this.grandTotal);
|
console.log(this.grandTotal);
|
||||||
|
console.log("pd",this.pdDetails);
|
||||||
|
let deleteRecords:any;
|
||||||
|
if(item.sci_id !=null && item.fk_pd_id !=null){
|
||||||
|
deleteRecords=[{
|
||||||
|
sci_id:item.sci_id,
|
||||||
|
fk_pd_id:item.fk_pd_id,
|
||||||
|
company_id:this.pdDetails.company_id,
|
||||||
|
isactive:false
|
||||||
|
|
||||||
|
}]
|
||||||
|
|
||||||
|
let records:any={'records':deleteRecords}
|
||||||
|
this.qustCat.saveassessedForms('saveAssessedIncomeSalesCalculatedByItemwise',records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']==true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Deleted Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Something Went Wrong");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const control = <FormArray>this.assessedForm.get('salesCalItemwise') as FormArray;
|
const control = <FormArray>this.assessedForm.get('salesCalItemwise') as FormArray;
|
||||||
if(control.length==1)
|
if(control.length==1)
|
||||||
{
|
{
|
||||||
@ -331,6 +354,8 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
console.log(answerData);
|
||||||
|
|
||||||
this.toast.pdTriggerappmessage("Please Fill all the Fields")
|
this.toast.pdTriggerappmessage("Please Fill all the Fields")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,14 +380,28 @@ else{
|
|||||||
if(sale.margin_final_value != null){
|
if(sale.margin_final_value != null){
|
||||||
this.marginFinalAmtInwords[index]=this.cons.convertNumberToWords(sale.margin_final_value)
|
this.marginFinalAmtInwords[index]=this.cons.convertNumberToWords(sale.margin_final_value)
|
||||||
}
|
}
|
||||||
|
this.changeOptions(index,sale.sales_type)
|
||||||
})
|
})
|
||||||
// this.assessedForm.controls['salesCalItemwise'].setValue(salesData);
|
// this.assessedForm.controls['salesCalItemwise'].setValue(salesData);
|
||||||
// console.log(control);
|
// console.log(control);
|
||||||
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
||||||
}
|
}
|
||||||
changeOptions(indexVal: any,event: any): void{
|
changeOptions(indexVal: any,event: any): void{
|
||||||
|
console.log("ai")
|
||||||
let control: any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
|
let control: any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
|
||||||
if(event.value=="1"){
|
if(event.value=="1"){
|
||||||
|
control.controls[indexVal].controls['fk_frequency_id'].setValue("");
|
||||||
|
control.controls[indexVal].controls['fk_frequency_id'].clearValidators();
|
||||||
|
control.controls[indexVal].controls['fk_frequency_id'].updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[indexVal].controls['annual_sale_value'].setValue("");
|
||||||
|
control.controls[indexVal].controls['annual_sale_value'].clearValidators();
|
||||||
|
control.controls[indexVal].controls['annual_sale_value'].updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[indexVal].controls['rate_per_unit'].setValue("");
|
||||||
|
control.controls[indexVal].controls['rate_per_unit'].clearValidators();
|
||||||
|
control.controls[indexVal].controls['rate_per_unit'].updateValueAndValidity();
|
||||||
|
|
||||||
control.controls[indexVal].controls['sales_qty'].setValidators([Validators.required]);
|
control.controls[indexVal].controls['sales_qty'].setValidators([Validators.required]);
|
||||||
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();
|
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();
|
||||||
|
|
||||||
@ -391,12 +430,13 @@ else{
|
|||||||
return this.fb.group(
|
return this.fb.group(
|
||||||
{
|
{
|
||||||
sci_id:[data.sci_id],
|
sci_id:[data.sci_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
sales_item:[data.sales_item,Validators.compose([Validators.required])],
|
sales_item:[data.sales_item,Validators.compose([Validators.required])],
|
||||||
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
||||||
sales_qty:[data.sales_qty,Validators.compose([Validators.required])],
|
sales_qty:[data.sales_qty,Validators.compose([Validators.required])],
|
||||||
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
|
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
|
||||||
uom_other:[data.uom_other,Validators.compose([Validators.required])],
|
uom_other:[data.uom_other],
|
||||||
rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])],
|
rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])],
|
||||||
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
||||||
annual_sale_value:[data.annual_sale_value],
|
annual_sale_value:[data.annual_sale_value],
|
||||||
|
|||||||
@ -19,7 +19,7 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
|
|||||||
let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/';
|
let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/';
|
||||||
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
|
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
|
||||||
let localapiurl = 'http://192.168.0.9/sparqapi/api/';
|
let localapiurl = 'http://192.168.0.9/sparqapi/api/';
|
||||||
return testapiurl;
|
return devapiurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
getcurrentDate()
|
getcurrentDate()
|
||||||
|
|||||||
@ -61,6 +61,7 @@ apiurl:any;
|
|||||||
|
|
||||||
retiverassessedForm(api,records)
|
retiverassessedForm(api,records)
|
||||||
{
|
{
|
||||||
|
console.log("rec",records)
|
||||||
return this.http.post(this.apiurl+api,records);
|
return this.http.post(this.apiurl+api,records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -29047,6 +29047,10 @@ page-pd-question-address .mat-card-content {
|
|||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page-pd-question-address textarea {
|
||||||
|
resize: none;
|
||||||
|
}
|
||||||
|
|
||||||
page-pd-question-assessed-daily-sales .input-cover {
|
page-pd-question-assessed-daily-sales .input-cover {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
@ -29872,6 +29876,21 @@ page-pd-question-other-income .scroll-content {
|
|||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
page-pd-question-rental-info .button-md {
|
page-pd-question-rental-info mat-hint {
|
||||||
padding: 0 2.9em !important;
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-rental-info mat-card {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-radius: 10px !important;
|
||||||
|
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||||
|
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-rental-info .mat-card-content {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-rental-info .scroll-content {
|
||||||
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user