merge : ps
This commit is contained in:
commit
535304d35d
File diff suppressed because one or more lines are too long
46
package-lock.json
generated
46
package-lock.json
generated
@ -215,6 +215,24 @@
|
||||
"@types/localforage": "0.0.30",
|
||||
"localforage": "~1.4.2",
|
||||
"localforage-cordovasqlitedriver": "~1.5.0"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
}
|
||||
},
|
||||
"@netbasal/content-loader": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@netbasal/content-loader/-/content-loader-1.1.0.tgz",
|
||||
"integrity": "sha512-xzDuM4DWNu+xaTu8FiTUOoOAOHn/ryDyeagzW+3E1bG11pxmXqj9tjyWqx6SE9fH38J90RC5ozZF7LCf0fZDkQ==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
}
|
||||
>>>>>>> 7d6b9204d0b22d85f2a9af7c6ff15479f39e0fe6
|
||||
}
|
||||
},
|
||||
"@types/chart.js": {
|
||||
@ -2725,7 +2743,7 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
@ -2826,7 +2844,7 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safer-buffer": "2.1.2"
|
||||
"safer-buffer": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"ignore-walk": {
|
||||
@ -2834,7 +2852,7 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimatch": "3.0.4"
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
@ -2859,7 +2877,7 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"number-is-nan": "1.0.1"
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
@ -2872,7 +2890,7 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.11"
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
@ -2918,9 +2936,9 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"debug": "2.6.9",
|
||||
"iconv-lite": "0.4.21",
|
||||
"sax": "1.2.4"
|
||||
"debug": "^2.1.2",
|
||||
"iconv-lite": "^0.4.4",
|
||||
"sax": "^1.2.4"
|
||||
}
|
||||
},
|
||||
"node-pre-gyp": {
|
||||
@ -2945,8 +2963,8 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"abbrev": "1.1.1",
|
||||
"osenv": "0.1.5"
|
||||
"abbrev": "1",
|
||||
"osenv": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"npm-bundled": {
|
||||
@ -2959,8 +2977,8 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ignore-walk": "3.0.1",
|
||||
"npm-bundled": "1.0.3"
|
||||
"ignore-walk": "^3.0.1",
|
||||
"npm-bundled": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"npmlog": {
|
||||
@ -3005,8 +3023,8 @@
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"os-homedir": "1.0.2",
|
||||
"os-tmpdir": "1.0.2"
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
"@ionic-native/sqlite": "^4.19.0",
|
||||
"@ionic-native/status-bar": "^4.16.0",
|
||||
"@ionic/storage": "2.1.3",
|
||||
"@netbasal/content-loader": "^1.1.0",
|
||||
"@types/chart.js": "^2.7.40",
|
||||
"amazon-cognito-identity-js": "^3.0.3",
|
||||
"chart.js": "^2.7.3",
|
||||
|
||||
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
|
||||
path.0=classes.dex
|
||||
renamed.0=classes.dex
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#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
|
||||
52.set=ASSET
|
||||
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
@ -118,6 +118,7 @@ import { PdQuestionSalaryInfoPage } from '../pages/pd-question/pd-question-salar
|
||||
import { LocationAccuracy } from '@ionic-native/location-accuracy';
|
||||
import {PdQuestionAssessedSummaryPage} from '../pages/pd-question/pd-question-assessed-summary/pd-question-assessed-summary'
|
||||
import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
|
||||
import { ContentLoaderModule } from '@netbasal/content-loader';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@ -204,7 +205,8 @@ import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
|
||||
MatTabsModule,
|
||||
MatToolbarModule,
|
||||
MatTooltipModule,
|
||||
MatStepperModule,HttpClientModule,IonicImageViewerModule,NgxMatSelectSearchModule
|
||||
MatStepperModule,HttpClientModule,IonicImageViewerModule,NgxMatSelectSearchModule,
|
||||
ContentLoaderModule
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
|
||||
@ -104,9 +104,21 @@
|
||||
</ion-list> -->
|
||||
<ion-slide>
|
||||
<!-- <ion-list *ngSwitchCase="'inpro'"> -->
|
||||
<ion-grid class="fadeIn">
|
||||
<ion-grid class="fadeIn">
|
||||
<div *ngIf="pdlistaccess else allocateaccess">
|
||||
<div *ngFor="let i of [1,2,3,4,5]">
|
||||
<content-loader>
|
||||
<svg:rect x="80" y="40" rx="5" ry="5" width="300" height="70" />
|
||||
|
||||
<svg:circle cx="40" cy="70" r="30" stroke="3" stroke-width="3" fill="red" />
|
||||
|
||||
</content-loader>
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #allocateaccess>
|
||||
|
||||
<mat-card class="md-box" reorder="true" *ngFor="let progess of pdinprogress;let i = index;">
|
||||
|
||||
|
||||
<ion-list >
|
||||
|
||||
<ion-item (click)="PdAllocation(progess)" >
|
||||
@ -136,6 +148,7 @@
|
||||
</ion-list>
|
||||
<hr/>
|
||||
</mat-card>
|
||||
</ng-template>
|
||||
</ion-grid>
|
||||
<!-- </ion-list> -->
|
||||
</ion-slide>
|
||||
@ -146,9 +159,23 @@
|
||||
<!-- <div [ngSwitch]="pdlist"> -->
|
||||
<ion-slide>
|
||||
<!-- <ion-list *ngSwitchCase="'past'"> -->
|
||||
<ion-grid class="fadeIn">
|
||||
<ion-grid class="fadeIn">
|
||||
<div *ngIf="pdlistaccess else access">
|
||||
<div *ngFor="let i of [1,2,3,4,5]">
|
||||
<content-loader>
|
||||
<svg:rect x="80" y="40" rx="5" ry="5" width="300" height="70" />
|
||||
|
||||
<svg:circle cx="40" cy="70" r="30" stroke="3" stroke-width="3" fill="red" />
|
||||
|
||||
</content-loader>
|
||||
</div>
|
||||
</div>
|
||||
<!-- {{access}} -->
|
||||
<ng-template #access>
|
||||
<mat-card class="md-box" reorder="true" *ngFor="let progess of pdschduleDetails;let i = index;">
|
||||
<ion-list >
|
||||
|
||||
|
||||
<ion-list >
|
||||
<ion-item (click)="PdAllocation(progess)">
|
||||
<ion-icon item-start="" class="lettericon" [style.background]="bgColorPast[i]">{{progess.applicat_details[0].applicant_name | slice : 0 :1 | uppercase}}</ion-icon>
|
||||
<ion-row>
|
||||
@ -181,7 +208,9 @@
|
||||
|
||||
</ion-list>
|
||||
<hr/>
|
||||
|
||||
</mat-card>
|
||||
</ng-template>
|
||||
</ion-grid>
|
||||
<!-- </ion-list> -->
|
||||
</ion-slide>
|
||||
|
||||
@ -119,15 +119,15 @@ export class PdListPage {
|
||||
|
||||
let userid = this.aws.getlocale();
|
||||
//.log("User",userid)
|
||||
this.pdlistaccess = true;
|
||||
|
||||
this.pdofficer.getpddetails(userid).subscribe(res=>
|
||||
{
|
||||
this.pdlistdetails = res;
|
||||
if(this.pdlistdetails.dataStatus == true)
|
||||
{
|
||||
this.pdlistaccess = false;
|
||||
|
||||
|
||||
this.pdlistaccess = true;
|
||||
this.pdschduleDetails = this.pdlistdetails.records.filter(sch=>sch.pd_status =="ACCEPTED" || sch.pd_status =="SCHEDULED" || sch.pd_status =="INITIATED" || sch.pd_status =="STARTED" || sch.pd_status =="INPROGRESS" && sch.applicat_details);
|
||||
this.searchpast = this.pdschduleDetails;
|
||||
|
||||
@ -169,7 +169,7 @@ export class PdListPage {
|
||||
this.bgColor = [];
|
||||
this.pdschduleDetails = [];
|
||||
this.pdinprogress = [];
|
||||
|
||||
// this.pdlistaccess = true;
|
||||
this.shared.refresh();
|
||||
this.getpdTriggerdetails();
|
||||
setTimeout(() => {
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
<ion-buttons end>
|
||||
|
||||
<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>
|
||||
</a>
|
||||
</ion-col>
|
||||
@ -74,12 +74,15 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<ion-row>
|
||||
<!-- <ion-row> -->
|
||||
<!-- <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> -->
|
||||
<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-row>
|
||||
<!-- </ion-row> -->
|
||||
</form>
|
||||
</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());
|
||||
}
|
||||
|
||||
deleteBuisnessDetails(i)
|
||||
deleteBuisnessDetails(i,item)
|
||||
{
|
||||
console.log("item",item);
|
||||
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;
|
||||
control.removeAt(i);
|
||||
if(control.length==1){
|
||||
control.reset();
|
||||
}
|
||||
else{
|
||||
control.removeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
busExpensecalculat(index,details)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Product / Service" formControlName="sales_item" name="sales_item">
|
||||
</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-group>
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
<!-- <a (click)="deleterentalHome(rent_i)">
|
||||
<ion-icon name="md-close" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||
</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-row>
|
||||
|
||||
@ -96,10 +96,10 @@
|
||||
<mat-card-content>
|
||||
<div *ngIf="margin_calculation_status">
|
||||
<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 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-form-field>
|
||||
|
||||
@ -112,15 +112,18 @@
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<ion-row>
|
||||
<!-- <ion-row> -->
|
||||
|
||||
|
||||
|
||||
<!-- <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> -->
|
||||
<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-row>
|
||||
<!-- </ion-row> -->
|
||||
</form>
|
||||
</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
|
||||
changeOptions(indexVal: any,event: any): void{
|
||||
console.log("event",event)
|
||||
let control: any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||
console.log("control",control)
|
||||
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++) {
|
||||
innercontrol.removeAt(i);
|
||||
}
|
||||
@ -88,11 +89,11 @@ changeOptions(indexVal: any,event: any): void{
|
||||
|
||||
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'].updateValueAndValidity();
|
||||
}
|
||||
else if(event.value=="2"){
|
||||
else if(event=="2"){
|
||||
for (let i = 0; i < innercontrol.value.length-1; i++) {
|
||||
innercontrol.removeAt(i);
|
||||
}
|
||||
@ -127,6 +128,7 @@ changeOptions(indexVal: any,event: any): void{
|
||||
sales_type:[null,Validators.compose([Validators.required])],
|
||||
child: this.fb.array([]),
|
||||
fk_pd_id: [this.pdDetails.pd_id],
|
||||
company_id:[this.pdDetails.company_id],
|
||||
margin_per: [null],
|
||||
margin_value: [null],
|
||||
comments:[null],
|
||||
@ -198,13 +200,18 @@ changeOptions(indexVal: any,event: 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"){
|
||||
console.log("value == 1")
|
||||
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||
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');
|
||||
return mval;
|
||||
});
|
||||
console.log("transform",transformData)
|
||||
if(transformData.length>0) {
|
||||
let getUniqueMonthCounts = transformData.map(val=>val.custum_date)
|
||||
.filter((fVal,fIndex,fArray)=>{
|
||||
@ -212,15 +219,20 @@ changeOptions(indexVal: any,event: any): void{
|
||||
});
|
||||
let getTotalValueCounts = transformData.map(val=>val.sales_value)
|
||||
.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)));
|
||||
this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2)
|
||||
}
|
||||
else{
|
||||
console.log("else 1")
|
||||
control.controls[indexVal].controls['margin_value'].setValue("");
|
||||
|
||||
}
|
||||
|
||||
console.log("else 1")
|
||||
}
|
||||
else {
|
||||
console.log("else 2")
|
||||
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);
|
||||
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;
|
||||
if (control.length == 1) {
|
||||
this.salesDailyForm.controls['sales_product'].reset();
|
||||
@ -323,9 +357,9 @@ changeOptions(indexVal: any,event: any): void{
|
||||
});
|
||||
if (this.salesDailyForm.valid) {
|
||||
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) {
|
||||
|
||||
this.toast.pdTriggerappmessage('Record Saved Successfully.!');
|
||||
@ -344,9 +378,11 @@ changeOptions(indexVal: any,event: any): void{
|
||||
getDailySalesData(dailySalesData) {
|
||||
|
||||
const control = <FormArray>this.salesDailyForm.get('sales_product') as FormArray;
|
||||
let control1: any = <FormArray>this.salesDailyForm.controls['sales_product'];
|
||||
let salesChildControl;
|
||||
let salesChildControlarr = [];
|
||||
dailySalesData.forEach((val, index) => {
|
||||
|
||||
|
||||
control.push(this.dailySalesWithData(val));
|
||||
if(val.margin_value != null){
|
||||
@ -358,22 +394,43 @@ changeOptions(indexVal: any,event: any): void{
|
||||
|
||||
salesChildControlarr[index].forEach((vals, i) => {
|
||||
vals.forEach((item, key) => {
|
||||
if(val.sales_type != 2){
|
||||
let saleDate = new Date(item.sales_date);
|
||||
|
||||
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("itme",val)
|
||||
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){
|
||||
this.Value[key]=this.constant.convertNumberToWords(item.sales_value)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
// 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) {
|
||||
@ -385,6 +442,7 @@ changeOptions(indexVal: any,event: any): void{
|
||||
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
||||
child: this.fb.array([]),
|
||||
fk_pd_id: [this.pdDetails.pd_id],
|
||||
company_id:[this.pdDetails.company_id],
|
||||
fk_createdby: [this.users],
|
||||
isactive: ['1'],
|
||||
margin_per: [data.margin_per],
|
||||
@ -392,20 +450,22 @@ changeOptions(indexVal: any,event: any): void{
|
||||
comments:[data.comments]
|
||||
})
|
||||
}
|
||||
dailySalesChildWithData(data, fk_id) {
|
||||
|
||||
dailySalesChildWithData(data, fk_id,salesType) {
|
||||
|
||||
console.log("Sales type",salesType)
|
||||
return this.fb.group(
|
||||
{
|
||||
simc_id: [data.simc_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_value: [data.sales_value, Validators.compose([Validators.required])],
|
||||
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
||||
frequency_value:[data.frequency_value,Validators.compose([Validators.required])],
|
||||
isactive: ['1'],
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,4 +192,9 @@
|
||||
|
||||
</mat-card> -->
|
||||
</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 { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
import { IonicPage, NavController, NavParams ,AlertController} from 'ionic-angular';
|
||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
||||
@ -37,7 +37,8 @@ export class PdQuestionAssessedDashPage {
|
||||
FormId: any;
|
||||
pdDetails: any;
|
||||
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.FormId = this.navParams.get('formDetails');
|
||||
this.users = this.aws.getlocale();
|
||||
@ -111,7 +112,7 @@ else{
|
||||
|
||||
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=>
|
||||
{
|
||||
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-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>
|
||||
</a>
|
||||
</ion-col>
|
||||
@ -68,12 +68,15 @@
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<ion-row>
|
||||
<!-- <ion-row> -->
|
||||
<!-- <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> -->
|
||||
<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-row>
|
||||
<!-- </ion-row> -->
|
||||
</form>
|
||||
</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;
|
||||
Value: 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) {
|
||||
this.pdDetails = this.navParams.get('pdDetails');
|
||||
this.houseExpenseDetails = this.navParams.get('FormId');
|
||||
@ -67,7 +68,8 @@ export class PdQuestionAssessedHouseholdPage {
|
||||
return this.fb.group(
|
||||
{
|
||||
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_value: [null,Validators.compose([Validators.required])],
|
||||
fk_frequency_id: [null,Validators.compose([Validators.required])],
|
||||
@ -86,12 +88,37 @@ export class PdQuestionAssessedHouseholdPage {
|
||||
control.push(this.createHouseExpense());
|
||||
}
|
||||
|
||||
deleteHouseExpense(i)
|
||||
deleteHouseExpense(i,item)
|
||||
{
|
||||
this.houseannual.splice(i,1);
|
||||
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;
|
||||
control.removeAt(i)
|
||||
if(control.length==1){
|
||||
control.reset();
|
||||
}
|
||||
else{
|
||||
control.removeAt(i);
|
||||
}
|
||||
}
|
||||
houseExpensecalculat(indexVal,values)
|
||||
{
|
||||
@ -205,7 +232,8 @@ export class PdQuestionAssessedHouseholdPage {
|
||||
return this.fb.group(
|
||||
{
|
||||
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_value: [data.expense_value,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_month_wise_data = [];
|
||||
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=>
|
||||
{
|
||||
if(res['dataStatus']==true)
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
</mat-form-field>
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<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-form-field>
|
||||
</div>
|
||||
@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<ion-buttons end>
|
||||
<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>
|
||||
</a>
|
||||
</ion-col>
|
||||
@ -96,12 +96,15 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<ion-row>
|
||||
<!-- <ion-row> -->
|
||||
<!-- <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> -->
|
||||
<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-row>
|
||||
<!-- </ion-row> -->
|
||||
</form>
|
||||
</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],
|
||||
fk_pd_id:[this.pdDetails.pd_id],
|
||||
company_id:[this.pdDetails.company_id],
|
||||
purchase_item:[null,Validators.compose([Validators.required])],
|
||||
purchase_qty:[null,Validators.compose([Validators.required])],
|
||||
fk_uom_id:[null,Validators.compose([Validators.required])],
|
||||
@ -104,14 +105,40 @@ export class PdQuestionAssessedPurchasePage {
|
||||
control.push(this.createPurchaseDetails());
|
||||
}
|
||||
|
||||
deletePurchaseDetails(i)
|
||||
deletePurchaseDetails(i,item)
|
||||
{
|
||||
this.annual.splice(i,1);
|
||||
|
||||
// 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
|
||||
control.removeAt(i);
|
||||
if(control.length==1){
|
||||
control.reset();
|
||||
}
|
||||
else{
|
||||
control.removeAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -237,6 +264,7 @@ export class PdQuestionAssessedPurchasePage {
|
||||
{
|
||||
purchase_id:[data.purchase_id],
|
||||
fk_pd_id:[this.pdDetails.pd_id],
|
||||
company_id:[this.pdDetails.company_id],
|
||||
purchase_item:[data.purchase_item,Validators.compose([Validators.required])],
|
||||
purchase_qty:[data.purchase_qty,Validators.compose([Validators.required])],
|
||||
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<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-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
@ -84,8 +84,8 @@
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="number" placeholder="Margin percentage %" (keyup)="salesMarginPerCalculation(i,item.value)" formControlName="margin_per" name="margin_per" >
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="number" placeholder="Margin Amount" (keyup)="salesMarginAmtCalculation(i,item.value)" formControlName="margin_per_uom" name="margin_per_uom">
|
||||
<mat-form-field style="width: 100%" *ngIf="item.value.sales_type=='1'">
|
||||
<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-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
@ -100,7 +100,7 @@
|
||||
<ion-buttons>
|
||||
<ion-row>
|
||||
<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-col>
|
||||
<ion-col offset-8 col-3 text-right>
|
||||
@ -114,15 +114,18 @@
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<ion-row>
|
||||
<!-- <ion-row> -->
|
||||
|
||||
|
||||
|
||||
<!-- <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> -->
|
||||
<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-row>
|
||||
<!-- </ion-row> -->
|
||||
</form>
|
||||
</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(
|
||||
{
|
||||
sci_id:[null],
|
||||
|
||||
fk_pd_id:[this.pdDetails.pd_id],
|
||||
|
||||
company_id:[this.pdDetails.company_id],
|
||||
sales_item:[null,Validators.compose([Validators.required])],
|
||||
sales_qty:[null,Validators.compose([Validators.required])],
|
||||
sales_type:[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])],
|
||||
fk_frequency_id:[null,Validators.compose([Validators.required])],
|
||||
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[i].spl
|
||||
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
||||
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;
|
||||
if(control.length==1)
|
||||
{
|
||||
@ -331,6 +354,8 @@ export class PdQuestionAssessedSalesPage {
|
||||
})
|
||||
}
|
||||
else{
|
||||
console.log(answerData);
|
||||
|
||||
this.toast.pdTriggerappmessage("Please Fill all the Fields")
|
||||
}
|
||||
}
|
||||
@ -355,14 +380,28 @@ else{
|
||||
if(sale.margin_final_value != null){
|
||||
this.marginFinalAmtInwords[index]=this.cons.convertNumberToWords(sale.margin_final_value)
|
||||
}
|
||||
this.changeOptions(index,sale.sales_type)
|
||||
})
|
||||
// this.assessedForm.controls['salesCalItemwise'].setValue(salesData);
|
||||
// console.log(control);
|
||||
this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
|
||||
}
|
||||
changeOptions(indexVal: any,event: any): void{
|
||||
console.log("ai")
|
||||
let control: any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
|
||||
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'].updateValueAndValidity();
|
||||
|
||||
@ -391,12 +430,13 @@ else{
|
||||
return this.fb.group(
|
||||
{
|
||||
sci_id:[data.sci_id],
|
||||
company_id:[this.pdDetails.company_id],
|
||||
fk_pd_id:[this.pdDetails.pd_id],
|
||||
sales_item:[data.sales_item,Validators.compose([Validators.required])],
|
||||
sales_type:[data.sales_type,Validators.compose([Validators.required])],
|
||||
sales_qty:[data.sales_qty,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])],
|
||||
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
|
||||
annual_sale_value:[data.annual_sale_value],
|
||||
|
||||
@ -61,6 +61,7 @@ apiurl:any;
|
||||
|
||||
retiverassessedForm(api,records)
|
||||
{
|
||||
console.log("rec",records)
|
||||
return this.http.post(this.apiurl+api,records);
|
||||
}
|
||||
|
||||
|
||||
@ -29893,6 +29893,7 @@ page-pd-question-rental-info .mat-card-content {
|
||||
|
||||
page-pd-question-rental-info .scroll-content {
|
||||
background-color: #eee;
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
page-pd-question-rental-info .mat-form-field-label {
|
||||
@ -29905,4 +29906,6 @@ page-pd-question-rental-info mat-select {
|
||||
|
||||
page-pd-question-rental-info input {
|
||||
height: 30px;
|
||||
=======
|
||||
>>>>>>> 7d6b9204d0b22d85f2a9af7c6ff15479f39e0fe6
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user