Fairoj AI web changes
This commit is contained in:
parent
a418fb42c0
commit
1aa55e126c
File diff suppressed because one or more lines are too long
2048
package-lock.json
generated
2048
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,7 @@
|
|||||||
"ionic-angular": "3.9.2",
|
"ionic-angular": "3.9.2",
|
||||||
"ionic-img-viewer": "^2.9.0",
|
"ionic-img-viewer": "^2.9.0",
|
||||||
"ionicons": "3.0.0",
|
"ionicons": "3.0.0",
|
||||||
|
"moment": "^2.24.0",
|
||||||
"ngx-mat-select-search": "^1.6.0",
|
"ngx-mat-select-search": "^1.6.0",
|
||||||
"rxjs": "^6.3.1",
|
"rxjs": "^6.3.1",
|
||||||
"rxjs-compat": "^6.3.1",
|
"rxjs-compat": "^6.3.1",
|
||||||
|
|||||||
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 @@
|
|||||||
#Thu Mar 28 20:25:30 IST 2019
|
#Tue Apr 02 20:03:20 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.
|
||||||
#Thu Mar 28 20:25:30 IST 2019
|
#Tue Apr 02 20:03:21 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
@ -119,6 +119,7 @@ import { LocationAccuracy } from '@ionic-native/location-accuracy';
|
|||||||
import {PdQuestionAssessedSummaryPage} from '../pages/pd-question/pd-question-assessed-summary/pd-question-assessed-summary'
|
import {PdQuestionAssessedSummaryPage} from '../pages/pd-question/pd-question-assessed-summary/pd-question-assessed-summary'
|
||||||
import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
|
import { NgxMatSelectSearchModule} from 'ngx-mat-select-search'
|
||||||
import { ContentLoaderModule } from '@netbasal/content-loader';
|
import { ContentLoaderModule } from '@netbasal/content-loader';
|
||||||
|
import {PdQuestionAssessedDailyPurchasePage} from '../pages/pd-question/pd-question-assessed-daily-purchase/pd-question-assessed-daily-purchase'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -169,7 +170,8 @@ import { ContentLoaderModule } from '@netbasal/content-loader';
|
|||||||
PdQuestionAssessedBusinessIncomePage,
|
PdQuestionAssessedBusinessIncomePage,
|
||||||
PdGeneralImagesPage,
|
PdGeneralImagesPage,
|
||||||
PdQuestionSalaryInfoPage,
|
PdQuestionSalaryInfoPage,
|
||||||
PdQuestionAssessedSummaryPage
|
PdQuestionAssessedSummaryPage,
|
||||||
|
PdQuestionAssessedDailyPurchasePage
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,ReactiveFormsModule,FormsModule,
|
BrowserModule,ReactiveFormsModule,FormsModule,
|
||||||
@ -257,7 +259,8 @@ import { ContentLoaderModule } from '@netbasal/content-loader';
|
|||||||
PdQuestionAssessedBusinessIncomePage,
|
PdQuestionAssessedBusinessIncomePage,
|
||||||
PdGeneralImagesPage,
|
PdGeneralImagesPage,
|
||||||
PdQuestionSalaryInfoPage,
|
PdQuestionSalaryInfoPage,
|
||||||
PdQuestionAssessedSummaryPage
|
PdQuestionAssessedSummaryPage,
|
||||||
|
PdQuestionAssessedDailyPurchasePage
|
||||||
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
@ -184,7 +184,7 @@ ion-content {
|
|||||||
height: 12vh;
|
height: 12vh;
|
||||||
}
|
}
|
||||||
h3,
|
h3,
|
||||||
.label,
|
.label
|
||||||
{
|
{
|
||||||
color: #111;
|
color: #111;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@ -234,4 +234,54 @@ ion-content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
.buttoncss{
|
||||||
|
color:darkseagreen;
|
||||||
|
//background: green
|
||||||
|
button.alert-button:nth-child(1){
|
||||||
|
color: red;
|
||||||
|
border:1px solid red;
|
||||||
|
border-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
right:20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.alert-button:nth-child(2){
|
||||||
|
color: green;
|
||||||
|
border:1px solid green;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.prompt_alert{
|
||||||
|
color:darkgreen;
|
||||||
|
|
||||||
|
button.alert-button{
|
||||||
|
color:green;
|
||||||
|
border:1px solid green;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
input.alert-input{
|
||||||
|
border:1px solid blueviolet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// .prompt_alert .alert-input{
|
||||||
|
// border-bottom: none!important;
|
||||||
|
// caret-color: #F58282;
|
||||||
|
// }
|
||||||
|
// .prompt_alert .alert-input-group:before {
|
||||||
|
// // content: '#';
|
||||||
|
// display: inline-block;
|
||||||
|
// //float: right;
|
||||||
|
// line-height: 3.5;
|
||||||
|
// color: black;
|
||||||
|
// }
|
||||||
|
// .prompt_alert .alert-input-wrapper {
|
||||||
|
// display: flex;
|
||||||
|
// padding-right: 3px;
|
||||||
|
// }
|
||||||
|
|||||||
@ -30,17 +30,18 @@
|
|||||||
<ion-col class="cardinfo">{{applicatentDetails.customer_segment_name}}</ion-col>
|
<ion-col class="cardinfo">{{applicatentDetails.customer_segment_name}}</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<hr/>
|
<hr/>
|
||||||
<a (click)="locationnavicate(applicatentDetails.addressline1)" style="text-decoration: none;"><ion-row>
|
<!-- <a (click)="locationnavicate(applicatentDetails.addressline1)" style="text-decoration: none;"><ion-row>
|
||||||
|
|
||||||
<ion-col col-1 top><ion-icon name="pin"></ion-icon></ion-col>
|
<ion-col col-1 top><ion-icon name="pin"></ion-icon></ion-col>
|
||||||
<ion-col class="cardinfo">{{applicatentDetails.addressline1}}<br/>
|
<ion-col class="cardinfo">{{applicatentDetails.addressline1}}<br/>
|
||||||
{{applicatentDetails.city_name}}<br/>
|
{{applicatentDetails.city_name}}<br/>
|
||||||
{{applicatentDetails.state_name}}
|
{{applicatentDetails.state_name}}
|
||||||
<span class="cardinfo" *ngIf="applicatentDetails.pincode !='' && applicatentDetails.pincode != null && applicatentDetails.pincode != 'Others'">-{{applicatentDetails.pincode}}</span>
|
<span class="cardinfo" *ngIf="applicatentDetails.pincode !='' && applicatentDetails.pincode != null && applicatentDetails.pincode != 'Others'">-{{applicatentDetails.pincode}}</span>
|
||||||
<span class="cardinfo" *ngIf="applicatentDetails.pincode != '' && applicatentDetails.pincode != null && applicatentDetails.pincode == 'Others'">-{{applicatentDetails.other_pincode}}</span></ion-col>
|
<span class="cardinfo" *ngIf="applicatentDetails.pincode != '' && applicatentDetails.pincode != null && applicatentDetails.pincode == 'Others'">-{{applicatentDetails.other_pincode}}</span></ion-col>
|
||||||
|
|
||||||
</ion-row></a>
|
</ion-row></a>
|
||||||
<hr/>
|
<hr/> -->
|
||||||
|
|
||||||
|
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-1 class=""><ion-icon name="call"></ion-icon></ion-col>
|
<ion-col col-1 class=""><ion-icon name="call"></ion-icon></ion-col>
|
||||||
@ -55,13 +56,32 @@
|
|||||||
<span class="cardinfo" *ngIf="applicatentDetails.subproduct_name != 'Not Applicable' && applicatentDetails.subproduct_name !=null ">/ {{applicatentDetails.subproduct_name}}</span></ion-col>
|
<span class="cardinfo" *ngIf="applicatentDetails.subproduct_name != 'Not Applicable' && applicatentDetails.subproduct_name !=null ">/ {{applicatentDetails.subproduct_name}}</span></ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<hr>
|
<hr>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-1><ion-icon name="md-cash"></ion-icon></ion-col>
|
||||||
|
<ion-col class="cardinfo">{{"₹"}} {{applicatentDetails.loan_amount}}</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<hr/>
|
||||||
|
<div *ngFor="let addr of addresses; let i=index">
|
||||||
|
<mat-label style="font-size:12px;color:gray">Address # {{i+1}}</mat-label>
|
||||||
|
<a (click)="locationnavicate(i)" style="text-decoration: none;"><ion-row>
|
||||||
|
|
||||||
|
<ion-col col-1 top><ion-icon name="pin"></ion-icon></ion-col>
|
||||||
|
<ion-col class="cardinfo">{{addr.addressline1}}<br/>
|
||||||
|
{{addr.city_name}}<br/>
|
||||||
|
{{addr.state_name}}
|
||||||
|
<span class="cardinfo" *ngIf="addr.pincode !='' && addr.pincode != null && addr.pincode != 'Others'">-{{addr.pincode}}</span>
|
||||||
|
<span class="cardinfo" *ngIf="addr.pincode != '' && addr.pincode != null && addr.pincode == 'Others'">-{{addr.other_pincode}}</span></ion-col>
|
||||||
|
</ion-row></a>
|
||||||
|
<hr/>
|
||||||
|
</div>
|
||||||
<ion-row class="schdul" *ngIf="scheduleAccess" #scroll>
|
<ion-row class="schdul" *ngIf="scheduleAccess" #scroll>
|
||||||
|
|
||||||
<ion-item> <!--class="cusicon"-->
|
<ion-item> <!--class="cusicon"-->
|
||||||
<ion-label color="primary" floating>Schedule Date</ion-label>
|
<ion-label color="primary" floating>Schedule Date</ion-label>
|
||||||
<ion-input #focusinp type="datetime-local" [min]="maxdate" (input)="datetime-local = $event.target.value" [(ngModel)]="scheduleDate" placeholder="Text Input"></ion-input>
|
<ion-input #focusinp type="datetime-local" [min]="maxdate" (input)="datetime-local = $event.target.value" [(ngModel)]="scheduleDate" placeholder="Text Input"></ion-input>
|
||||||
<!--<input type="datetime-local" [(ngModel)]="scheduleDate" placeholder="Text Input"> -->
|
<!--<input type="datetime-local" [(ngModel)]="scheduleDate" placeholder="Text Input"> -->
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row *ngIf="initiatedAccess || startedAccess">
|
<ion-row *ngIf="initiatedAccess || startedAccess">
|
||||||
<ion-row>
|
<ion-row>
|
||||||
|
|||||||
@ -99,4 +99,7 @@ page-input{
|
|||||||
.input-cover{position: static;}
|
.input-cover{position: static;}
|
||||||
|
|
||||||
.leaveDays{color:red};
|
.leaveDays{color:red};
|
||||||
|
ion-icon{
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -64,14 +64,20 @@ currentPosPDofficer:any;
|
|||||||
other_applicant:any;
|
other_applicant:any;
|
||||||
@ViewChild('focusinp') input_focus ;
|
@ViewChild('focusinp') input_focus ;
|
||||||
@ViewChild('scroll') scrolltop : Content;
|
@ViewChild('scroll') scrolltop : Content;
|
||||||
|
addresses: any=[];
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
|
||||||
public statusBar:StatusBar,public platform: Platform,public launchNavigator:LaunchNavigator,
|
public statusBar:StatusBar,public platform: Platform,public launchNavigator:LaunchNavigator,
|
||||||
public aws:AwsServiceProvider,public pdDetails:PdtriggerProvider,public geolocation:Geolocation,
|
public aws:AwsServiceProvider,public pdDetails:PdtriggerProvider,public geolocation:Geolocation,
|
||||||
public alertCtrl:AlertController,public locationAccuracy:LocationAccuracy,public toast:ToastProvider,
|
public alertCtrl:AlertController,public locationAccuracy:LocationAccuracy,public toast:ToastProvider,
|
||||||
public constant:ConstantsProvider,public androidPermissions:AndroidPermissions, ) {
|
public constant:ConstantsProvider,public androidPermissions:AndroidPermissions, ) {
|
||||||
|
|
||||||
this.maxdate = this.pipe.transform(new Date(),'yyyy-MM-ddThh:mm').toString();
|
this.maxdate = this.pipe.transform(new Date(),'yyyy-MM-ddTHH:mm').toString();
|
||||||
|
// this.maxdate=new Date().toLocaleString();
|
||||||
|
|
||||||
|
var date=new Date('dd');
|
||||||
|
//console.log(date)
|
||||||
|
var curr=date.getDate()+date.getMonth()+date.getFullYear();
|
||||||
|
console.log("today",curr)
|
||||||
/***Header value pass */
|
/***Header value pass */
|
||||||
this.statusBar.styleDefault();
|
this.statusBar.styleDefault();
|
||||||
|
|
||||||
@ -106,6 +112,7 @@ other_applicant:any;
|
|||||||
|
|
||||||
}
|
}
|
||||||
this.users = this.aws.getlocale();
|
this.users = this.aws.getlocale();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -117,9 +124,13 @@ other_applicant:any;
|
|||||||
{
|
{
|
||||||
clearInterval(this.timeInterval);
|
clearInterval(this.timeInterval);
|
||||||
}
|
}
|
||||||
locationnavicate(address)
|
locationnavicate(index)
|
||||||
{
|
{
|
||||||
this.launchNavigator.navigate(address);
|
// var address_full:string=address+' ' +this.applicatentDetails.city_name+' ' +this.applicatentDetails.state_name+' '+ (this.applicatentDetails.pincode != 'Others' ? this.applicatentDetails.pincode : this.applicatentDetails.other_pincode)
|
||||||
|
let data=this.addresses[index]
|
||||||
|
var address_full:string= data.addressline1+' ' +data.city_name+' ' +data.state_name+'-'+(data.pincode != 'Others' ? data.pincode : data.other_pincode)
|
||||||
|
//console.log("add",address_full)
|
||||||
|
this.launchNavigator.navigate(address_full);
|
||||||
}
|
}
|
||||||
|
|
||||||
setPermission()
|
setPermission()
|
||||||
@ -146,13 +157,15 @@ other_applicant:any;
|
|||||||
{
|
{
|
||||||
if(res['dataStatus']==true){
|
if(res['dataStatus']==true){
|
||||||
this.other_applicant=res['records'].applicants_details
|
this.other_applicant=res['records'].applicants_details
|
||||||
|
this.addresses=res['records'].pd_address
|
||||||
console.log(this.other_applicant);
|
console.log(this.other_applicant);
|
||||||
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
|
||||||
let scheduledDateTime: string= res['records'].pd_master_details[0].scheduled_on_for_validation;
|
let scheduledDateTime: string= res['records'].pd_master_details[0].scheduled_on_for_validation;
|
||||||
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
|
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
|
||||||
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
|
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
|
||||||
|
console.log(diffInHours);
|
||||||
|
|
||||||
if(diffInHours <=-4){
|
if(diffInHours <-4){
|
||||||
this.enableStartPD=true;
|
this.enableStartPD=true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -140,7 +140,7 @@ export class OtpPage {
|
|||||||
let data:any;
|
let data:any;
|
||||||
let alert = this.alertCtrl.create({
|
let alert = this.alertCtrl.create({
|
||||||
title: 'OTP Expired ',
|
title: 'OTP Expired ',
|
||||||
message: 'Do you want sure resend OTP',
|
message: 'Do you want to resend the OTP ? ',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Start PD Without OTP',
|
text: 'Start PD Without OTP',
|
||||||
|
|||||||
@ -7,11 +7,59 @@
|
|||||||
<!-- <ion-title *ngIf="!viewchange"> {{pageTitle}}</ion-title> -->
|
<!-- <ion-title *ngIf="!viewchange"> {{pageTitle}}</ion-title> -->
|
||||||
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
|
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
<ion-segment [(ngModel)]="tab" color="optblue">
|
||||||
|
<ion-segment-button value="0">
|
||||||
|
Form
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="1">
|
||||||
|
Pictures
|
||||||
|
</ion-segment-button>
|
||||||
|
</ion-segment>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
<div [ngSwitch]="tab">
|
||||||
|
<mat-card *ngSwitchCase="'1'" #picContent>
|
||||||
|
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found</strong></mat-label>
|
||||||
|
|
||||||
|
<ion-grid *ngIf="imageDisplay.length >0 ">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-6 *ngFor="let image of imageDisplay; let i=index" no-padding>
|
||||||
|
<img src="{{image.image}}" imageViewer>
|
||||||
|
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
|
||||||
|
|
||||||
|
<input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)">
|
||||||
|
<button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
||||||
|
</ion-col>
|
||||||
|
<hr/>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<ion-grid *ngIf="imageBucket.length >0 ">
|
||||||
|
<label style="font-size:14px;color:gray">Newly Captured Pics</label><br/>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
|
||||||
|
<img src="{{image.image}}" imageViewer>
|
||||||
|
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
|
||||||
|
|
||||||
|
<input #focusName *ngIf="image.Name ==''" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeNameForBucket($event.target.value,i,image.image)">
|
||||||
|
<button float-right ion-button clear color="optblue" (click)="removeImgForBucket(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
||||||
|
</ion-col>
|
||||||
|
<hr/>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
</mat-card-content>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
<form [formGroup]="pdQuestionAddress">
|
<form [formGroup]="pdQuestionAddress" *ngSwitchCase="'0'">
|
||||||
<mat-card class="box">
|
<mat-card class="box">
|
||||||
<div formArrayName="addresses">
|
<div formArrayName="addresses">
|
||||||
<div *ngFor="let item of pdQuestionAddress.controls.addresses['controls']; let i=index" [formGroupName]="i">
|
<div *ngFor="let item of pdQuestionAddress.controls.addresses['controls']; let i=index" [formGroupName]="i">
|
||||||
@ -82,10 +130,11 @@
|
|||||||
|
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select placeholder="Address Type" name="address_type" formControlName="address_type" (selectionChange)="selectedAddressType($event.source.triggerValue,i)">
|
<mat-select placeholder="Address Type" name="address_type" formControlName="address_type" (selectionChange)="selectedAddressType($event.source.triggerValue,i)" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let m_addressType of addressTypes" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option>
|
<mat-option *ngFor="let m_addressType of addressTypes" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="item.controls['address_type'].errors?.required || item.controls['address_type'].touched">Address Type is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -98,13 +147,14 @@
|
|||||||
|
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select matInput placeholder="Locality" name="locality" formControlName="locality">
|
<mat-select matInput placeholder="Locality" name="locality" formControlName="locality" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="{{m_locality.locality_id}}"
|
<mat-option value="{{m_locality.locality_id}}"
|
||||||
*ngFor="let m_locality of locality">{{m_locality.locality_name}}
|
*ngFor="let m_locality of locality">{{m_locality.locality_name}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="item.controls['locality'].errors?.required || item.controls['locality'].touched">Locality is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -119,23 +169,25 @@
|
|||||||
|
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 100%;">
|
<mat-form-field style="width: 100%;">
|
||||||
<mat-select placeholder="Approach to PD Location" name="pd_location" formControlName="pd_location">
|
<mat-select placeholder="Approach to PD Location" name="pd_location" formControlName="pd_location" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="{{data.pd_location_approach_id}}"
|
<mat-option value="{{data.pd_location_approach_id}}"
|
||||||
*ngFor="let data of pdlocation">{{data.description}}
|
*ngFor="let data of pdlocation">{{data.description}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="item.controls['pd_location'].errors?.required || item.controls['pd_location'].touched">PD Location is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 100%;">
|
<mat-form-field style="width: 100%;">
|
||||||
<mat-select placeholder="Comment on Locality" name="comment_locality" formControlName="comment_locality">
|
<mat-select placeholder="Comment on Locality" name="comment_locality" formControlName="comment_locality" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="{{data.comments_on_locality_id}}"
|
<mat-option value="{{data.comments_on_locality_id}}"
|
||||||
*ngFor="let data of cmtlocality">{{data.rating}}
|
*ngFor="let data of cmtlocality">{{data.rating}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="item.controls['comment_locality'].errors?.required || item.controls['comment_locality'].touched">Comment on Locality is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -339,9 +391,11 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Bank multi -->
|
|
||||||
|
<ion-fab bottom right mini>
|
||||||
|
<button mini style="margin-bottom: 10px" ion-fab color="optblue" slot="fixed" (click)="savePhoto()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button></ion-fab>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
|
|
||||||
|
|||||||
@ -14,4 +14,20 @@ page-pd-question-address {
|
|||||||
textarea {
|
textarea {
|
||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
img{
|
||||||
|
padding:0 5px 5px 5px;
|
||||||
|
height: 180px;
|
||||||
|
//width:130px;
|
||||||
|
//border:3px solid black;
|
||||||
|
//border-radius: 20px;
|
||||||
|
//background-color: gray;
|
||||||
|
}
|
||||||
|
input{
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-color: gray;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 28px;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
|||||||
import { Observable, Subject, ReplaySubject, from } from 'rxjs';
|
import { Observable, Subject, ReplaySubject, from } from 'rxjs';
|
||||||
import { ToastProvider } from '../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
import { ConstantsProvider } from '../../../providers/constants/constants';
|
import { ConstantsProvider } from '../../../providers/constants/constants';
|
||||||
|
import {Camera} from '@ionic-native/camera'
|
||||||
|
|
||||||
import {searchValue} from '../search'
|
import {searchValue} from '../search'
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
@ -71,8 +72,12 @@ export class PdQuestionAddressPage {
|
|||||||
public filteredCity: ReplaySubject<searchValue[]> = new ReplaySubject<searchValue[]>(1);
|
public filteredCity: ReplaySubject<searchValue[]> = new ReplaySubject<searchValue[]>(1);
|
||||||
public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1)
|
public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1)
|
||||||
pincodeDataValue: any=[];
|
pincodeDataValue: any=[];
|
||||||
|
base64: string;
|
||||||
|
imageBucket: any=[];
|
||||||
|
tab:string='0';
|
||||||
|
imageDisplay: any=[];
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public alerCtrl:AlertController,public constant:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public alerCtrl:AlertController,public constant:ConstantsProvider,public camera:Camera) {
|
||||||
|
|
||||||
this.questionDetails = this.navParams.get('questionDetails');
|
this.questionDetails = this.navParams.get('questionDetails');
|
||||||
|
|
||||||
@ -214,6 +219,7 @@ countRowsForTextarea(text){
|
|||||||
|
|
||||||
// console.log('text.length%100',text.length%190);
|
// console.log('text.length%100',text.length%190);
|
||||||
// console.log('text.length/100',text.length/100);
|
// console.log('text.length/100',text.length/100);
|
||||||
|
if(text !='' && text != undefined){
|
||||||
if(text.length%100 > 5)
|
if(text.length%100 > 5)
|
||||||
return 5;
|
return 5;
|
||||||
else if(text.length%100 <= 3)
|
else if(text.length%100 <= 3)
|
||||||
@ -221,6 +227,7 @@ countRowsForTextarea(text){
|
|||||||
else return Math.floor(text.length%100);
|
else return Math.floor(text.length%100);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ionViewWillLeave()
|
ionViewWillLeave()
|
||||||
{
|
{
|
||||||
@ -250,6 +257,42 @@ countRowsForTextarea(text){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
ionViewCanLeave(){
|
||||||
|
console.log("dirty",this.pdQuestionAddress.dirty);
|
||||||
|
if(this.pdQuestionAddress.dirty){
|
||||||
|
// console.log("dirty",this.AssetsDetailsForm.dirty)
|
||||||
|
//return false;
|
||||||
|
// let val=this.toast.setAlert('Form is Modified','Are you sure want to Go Back');
|
||||||
|
// console.log("v",val)
|
||||||
|
// if(val==1){
|
||||||
|
|
||||||
|
// }
|
||||||
|
// if(val.__zone_symbol__state)
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let alert=this.alerCtrl.create({
|
||||||
|
title:'Form is Modified',
|
||||||
|
message:'Are you sure want to Go Back',
|
||||||
|
cssClass:'buttoncss',
|
||||||
|
buttons:[{
|
||||||
|
text:'Yes',
|
||||||
|
cssClass:'btnYes',
|
||||||
|
handler:()=>{
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text:'No',
|
||||||
|
cssClass:'btnNo',
|
||||||
|
handler:()=>{
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
alert.present()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** To Get City And Pincode Data For Address Form
|
/** To Get City And Pincode Data For Address Form
|
||||||
@ -442,7 +485,7 @@ countRowsForTextarea(text){
|
|||||||
console.log("pin init", this.pincodeValue[0])
|
console.log("pin init", this.pincodeValue[0])
|
||||||
if(AddressDetails != null){
|
if(AddressDetails != null){
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
address: [AddressDetails.address, Validators.compose([Validators.required])],
|
address: [AddressDetails.address],
|
||||||
address_type: [AddressDetails.address_type, Validators.compose([Validators.required])],
|
address_type: [AddressDetails.address_type, Validators.compose([Validators.required])],
|
||||||
address_type_others: [AddressDetails.address_type_others],
|
address_type_others: [AddressDetails.address_type_others],
|
||||||
state: [AddressDetails.state],
|
state: [AddressDetails.state],
|
||||||
@ -464,7 +507,7 @@ countRowsForTextarea(text){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
address: ['', Validators.compose([Validators.required])],
|
address: ['' ],
|
||||||
address_type: ['', Validators.compose([Validators.required])],
|
address_type: ['', Validators.compose([Validators.required])],
|
||||||
address_type_others: [''],
|
address_type_others: [''],
|
||||||
state: [''],
|
state: [''],
|
||||||
@ -551,6 +594,10 @@ countRowsForTextarea(text){
|
|||||||
// element.pincode=1
|
// element.pincode=1
|
||||||
// element.pincode_others=temp
|
// element.pincode_others=temp
|
||||||
// })
|
// })
|
||||||
|
if(this.pdQuestionAddress.invalid){
|
||||||
|
this.toast.pdTriggerappmessage("Please Fill all the Mandatory Fields marked with ' * '")
|
||||||
|
return
|
||||||
|
}
|
||||||
console.log("Answer DAta",answerData)
|
console.log("Answer DAta",answerData)
|
||||||
records.addresses=answerData.addresses
|
records.addresses=answerData.addresses
|
||||||
// records.addressess
|
// records.addressess
|
||||||
@ -753,6 +800,19 @@ countRowsForTextarea(text){
|
|||||||
else
|
else
|
||||||
this.loadPD();
|
this.loadPD();
|
||||||
});
|
});
|
||||||
|
/*FOR RETRIEVING PHOTOS*/
|
||||||
|
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id}
|
||||||
|
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
|
||||||
|
if(!val['msg']){
|
||||||
|
console.log(val['records'])
|
||||||
|
if(val['records'].length>0){
|
||||||
|
val['records'].forEach(result=>{
|
||||||
|
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
|
||||||
|
})
|
||||||
|
console.log("imageBuck",this.imageDisplay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
loadPD(){
|
loadPD(){
|
||||||
const control=<FormArray>this.pdQuestionAddress.controls['addresses']
|
const control=<FormArray>this.pdQuestionAddress.controls['addresses']
|
||||||
@ -794,4 +854,90 @@ countRowsForTextarea(text){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
changeName(value,index,img){
|
||||||
|
console.log(value);
|
||||||
|
this.imageDisplay[index]={'image':img,'Name':value}
|
||||||
|
|
||||||
|
}
|
||||||
|
changeNameForBucket(value,index,img){
|
||||||
|
this.imageBucket[index]={'image':img,'Name':value}
|
||||||
|
}
|
||||||
|
removeImg(index){
|
||||||
|
this.imageDisplay.splice(index,1);
|
||||||
|
}
|
||||||
|
removeImgForBucket(index){
|
||||||
|
this.imageBucket.splice(index,1)
|
||||||
|
}
|
||||||
|
savePhoto(){
|
||||||
|
this.camera.getPicture({
|
||||||
|
quality: 100,
|
||||||
|
destinationType: this.camera.DestinationType.DATA_URL,
|
||||||
|
targetWidth: 500,
|
||||||
|
targetHeight: 600,
|
||||||
|
correctOrientation: true
|
||||||
|
}).then((imageData)=>{
|
||||||
|
this.base64='data:image/png;base64,'+imageData
|
||||||
|
this.imageBucket.push({'image':this.base64,'Name':''});
|
||||||
|
// this.imageDisplay.push({'image':this.base64,'Name':''})
|
||||||
|
this. getImageName(this.imageBucket.length-1)
|
||||||
|
|
||||||
|
},(err)=>{
|
||||||
|
//alert("error");
|
||||||
|
})
|
||||||
|
this.tab='1';
|
||||||
|
// this.content.scrollToBottom();
|
||||||
|
// let dimensions = this.content.getContentDimensions();
|
||||||
|
// this.content.scrollTo(0, dimensions.contentHeight+100, 100);
|
||||||
|
// this.inputFocus.setFocus();
|
||||||
|
}
|
||||||
|
getImageName(index){
|
||||||
|
console.log("index",index);
|
||||||
|
let alert=this.alerCtrl.create({
|
||||||
|
title:'Document Name',
|
||||||
|
message: 'Please Enter the Document Name',
|
||||||
|
cssClass:'prompt_alert',
|
||||||
|
inputs:[
|
||||||
|
{
|
||||||
|
name:'Name',
|
||||||
|
//value:this.imageBucket[index].Name
|
||||||
|
placeholder:'Document Name'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
text:'Submit',
|
||||||
|
handler:data=>{
|
||||||
|
console.log(data.Name)
|
||||||
|
this.imageBucket[index].Name=data.Name
|
||||||
|
alert.dismiss
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
alert.present();
|
||||||
|
//this.inputFocus.setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
// al(){
|
||||||
|
// this.toast.pdTriggerappmessage("touched");
|
||||||
|
// }
|
||||||
|
sendImage(){
|
||||||
|
console.log("ll",JSON.stringify(this.imageBucket));
|
||||||
|
let records:any={
|
||||||
|
'pd_id':this.pdDetails.pd_id,
|
||||||
|
'formid':this.FormId.form_id,
|
||||||
|
'images':this.imageBucket,
|
||||||
|
'company_id':''
|
||||||
|
}
|
||||||
|
console.log("records",JSON.stringify(records))
|
||||||
|
|
||||||
|
this.qustCat.savePDImages(records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']== true){
|
||||||
|
this.toast.pdTriggerappmessage("Image Saved Successfully")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage('Fail');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
<!--
|
||||||
|
Generated template for the PdQuestionAssessedDailyPurchasePage page.
|
||||||
|
|
||||||
|
See http://ionicframework.com/docs/components/#navigation for more info on
|
||||||
|
Ionic pages and navigation.
|
||||||
|
-->
|
||||||
|
<ion-header>
|
||||||
|
|
||||||
|
<ion-navbar color="optblue">
|
||||||
|
<button ion-button menuToggle>
|
||||||
|
<ion-icon name="menu"></ion-icon>
|
||||||
|
</button>
|
||||||
|
<ion-title *ngIf="!viewchange">Add Daily Purchase Item</ion-title>
|
||||||
|
</ion-navbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<form [formGroup]="purchaseItemForm">
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-content formArrayName="purchase_product">
|
||||||
|
<div *ngFor="let purchase of purchaseItemForm.controls.purchase_product['controls'];let s=index; let last=last"
|
||||||
|
[formGroupName]="s">
|
||||||
|
<mat-card-header>
|
||||||
|
<mat-card-title>Daily Purchase Item # {{s+1}}</mat-card-title>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Raw Material/Trading Item" formControlName="purchase_item" required>
|
||||||
|
<mat-option>Select</mat-option>
|
||||||
|
<mat-option *ngFor="let prod of productListData" [value]="prod">{{ prod }}</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input type="text" matInput placeholder="Other Raw Material/Trading Item" formControlName="other_purchase_item">
|
||||||
|
</mat-form-field>
|
||||||
|
<div [ngSwitch]="purchase.value.purchase_type">
|
||||||
|
<div formArrayName="child">
|
||||||
|
<div *ngFor="let childItem of purchase.get('child').controls; let c=index;let last=last" [formGroupName]="c">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput type="date" max=maxDate formControlName="purchase_date" placeholder="Purchase Date" (dateChange)="purchaseCalculation(s,purchase.value)">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput type="number" autocomplete="off" placeholder="Bill Value" formControlName="purchase_value" (keyup)="purchaseCalculation(s,purchase.value);inWords(childItem.value.purchase_value,c)">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-label align="end" style="color:gray;font-size:12px" *ngIf="childItem.value.purchase_value!= ''">{{"₹"}} {{purchaseAmtInWords[c]}} Only</mat-label>
|
||||||
|
<ion-buttons end>
|
||||||
|
<ion-col col-3 offset-3 *ngIf="purchase.value.child.length>1">
|
||||||
|
<button ion-button clear color="optblue" (click)="removeChild(s,c,childItem.value)">
|
||||||
|
<ion-icon name="md-trash" style="font-size: 22px"></ion-icon>
|
||||||
|
</button>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col col-2 offset-1 *ngIf="last">
|
||||||
|
<button ion-button clear color="optblue" (click)="addChild(s,purchase.value)">
|
||||||
|
<ion-icon name="add-circle" style="font-size: 24px"></ion-icon>
|
||||||
|
</button>
|
||||||
|
</ion-col>
|
||||||
|
</ion-buttons>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<mat-form-field>
|
||||||
|
<textarea matInput type="text" formControlName="comments" placeholder="Remarks"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
<ion-buttons end>
|
||||||
|
<ion-col col-3 offset-3 *ngIf="purchaseItemForm.value.purchase_product.length>1">
|
||||||
|
<button ion-button small round color="optblue" (click)="removeDailyPurchase(s)">
|
||||||
|
<!-- <ion-icon name="md-trash" style="font-size: 22px"></ion-icon> -->
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
</ion-col><br/>
|
||||||
|
<ion-col col-1 offset-1 *ngIf="last">
|
||||||
|
<button ion-button small round color="optblue" (click)="addDailyPurchase(purchaseItemForm.controls.purchase_product.value.length)">
|
||||||
|
<!-- <ion-icon name="add-circle" style="font-size: 24px"></ion-icon> -->
|
||||||
|
Add More Purchase Product
|
||||||
|
</button>
|
||||||
|
</ion-col>
|
||||||
|
</ion-buttons>
|
||||||
|
</div>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
</form>
|
||||||
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<button ion-button color="optblue" full (click)="submitDetails(purchaseItemForm.value)">Save</button>
|
||||||
|
</ion-footer>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
page-pd-question-assessed-daily-purchase {
|
||||||
|
mat-form-field{
|
||||||
|
width:100%
|
||||||
|
}
|
||||||
|
.scroll-content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
.scroll-content{
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
.mat-card{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-radius: 10px !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;
|
||||||
|
}
|
||||||
|
.mat-card-content{
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,294 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { IonicPage, NavController, NavParams, Form } from 'ionic-angular';
|
||||||
|
import {AwsServiceProvider} from '../../../providers/aws-service/aws-service'
|
||||||
|
import { FormGroup,FormBuilder,FormArray, Validators} from '@angular/forms';
|
||||||
|
import {QuestionCategoryProvider} from '../../../providers/question-category/question-category'
|
||||||
|
import {ToastProvider} from '../../../providers/common-provider/toast'
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
import {ConstantsProvider} from '../../../providers/constants/constants'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated class for the PdQuestionAssessedDailyPurchasePage page.
|
||||||
|
*
|
||||||
|
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||||
|
* Ionic pages and navigation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'page-pd-question-assessed-daily-purchase',
|
||||||
|
templateUrl: 'pd-question-assessed-daily-purchase.html',
|
||||||
|
})
|
||||||
|
export class PdQuestionAssessedDailyPurchasePage {
|
||||||
|
pipe = new DatePipe('en-US');
|
||||||
|
pdDetails:any;
|
||||||
|
formId:any;
|
||||||
|
margin_calculation_status: any;
|
||||||
|
users: any;
|
||||||
|
purchaseItemForm:FormGroup
|
||||||
|
dailyPurchase:any;
|
||||||
|
productListData: any=[];
|
||||||
|
purchaseData:any;
|
||||||
|
purchaseAmtInWords: any=[];
|
||||||
|
|
||||||
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,
|
||||||
|
private fb:FormBuilder,private quesCat:QuestionCategoryProvider,private toast:ToastProvider,private cons:ConstantsProvider) {
|
||||||
|
this.pdDetails=this.navParams.get('pdDetails')
|
||||||
|
console.log("pd",this.pdDetails)
|
||||||
|
this.formId=this.navParams.get('FormId')
|
||||||
|
this.purchaseData=this.navParams.get('purchaseDaily')
|
||||||
|
console.log("data",this.purchaseData);
|
||||||
|
this.margin_calculation_status=this.navParams.get('margin_calculation_status');
|
||||||
|
this.users = this.aws.getlocale();
|
||||||
|
|
||||||
|
this.purchaseItemForm=this.fb.group({
|
||||||
|
// purchase_item:[''],
|
||||||
|
// other_purchase_item:[''],
|
||||||
|
purchase_product:this.fb.array([])
|
||||||
|
// child:this.fb.array([])
|
||||||
|
})
|
||||||
|
this.getDropDown()
|
||||||
|
}
|
||||||
|
|
||||||
|
ionViewDidLoad() {
|
||||||
|
console.log('ionViewDidLoad PdQuestionAssessedDailyPurchasePage');
|
||||||
|
if(this.purchaseData != null){
|
||||||
|
this.getDailyPurchase(this.purchaseData)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.addPurchase();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
getDropDown(){
|
||||||
|
this.quesCat.stockFormAccess(this.pdDetails.pd_id,this.pdDetails.company_id).subscribe(data=>{
|
||||||
|
if (data.dataStatus){
|
||||||
|
let datas = data.record;
|
||||||
|
|
||||||
|
let type2 = datas.from_business.filter(data => data.type_of_activity_id == 2);
|
||||||
|
if(type2[0].hasOwnProperty("products")){
|
||||||
|
// this.productListData.push(type2[0].products);
|
||||||
|
}
|
||||||
|
let type3 = datas.from_business.filter(data => data.type_of_activity_id == 3);
|
||||||
|
if(type3[0].hasOwnProperty("products")){
|
||||||
|
this.productListData.push(type3[0].products);
|
||||||
|
}
|
||||||
|
let type4 = datas.from_business.filter(data => data.type_of_activity_id == 4);
|
||||||
|
if(type4[0].hasOwnProperty("products")){
|
||||||
|
this.productListData.push(type4[0].products);
|
||||||
|
}
|
||||||
|
if(datas.from_supplier.hasOwnProperty("raw_material")){
|
||||||
|
this.productListData.push(datas.from_supplier.raw_material);
|
||||||
|
}
|
||||||
|
this.productListData = [].concat.apply([], this.productListData);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
addPurchase(){
|
||||||
|
const control=<FormArray>this.purchaseItemForm.get('purchase_product') as FormArray
|
||||||
|
control.push(this.createDailyPurchase())
|
||||||
|
this.addDailyPurchaseChild(control.length-1)
|
||||||
|
}
|
||||||
|
createDailyPurchase(){
|
||||||
|
return this.fb.group({
|
||||||
|
fk_pd_id: [this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
|
pbw_id: [''],
|
||||||
|
purchase_item: ['', Validators.compose([Validators.required])],
|
||||||
|
other_purchase_item:[''],
|
||||||
|
annual_purchase_value: [''],
|
||||||
|
child: this.fb.array([]),
|
||||||
|
comments: [''],
|
||||||
|
isactive:[true],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
addDailyPurchaseChild(index)
|
||||||
|
{
|
||||||
|
const control=(<FormArray>this.purchaseItemForm.get('purchase_product')).at(index).get('child') as FormArray;
|
||||||
|
control.push(this.createDailyPurchaseChild(''))
|
||||||
|
}
|
||||||
|
createDailyPurchaseChild(value){
|
||||||
|
return this.fb.group({
|
||||||
|
pbwc_id: [''],
|
||||||
|
fk_pbw_id: [value],
|
||||||
|
purchase_date: [''],
|
||||||
|
purchase_value: ['', Validators.compose([Validators.required])],
|
||||||
|
isactive:[true],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
createPurchaseItemWithData(values: any) {
|
||||||
|
return this.fb.group({
|
||||||
|
fk_pd_id: [this.pdDetails.pd_id],
|
||||||
|
company_id:[this.pdDetails.company_id],
|
||||||
|
pbw_id: [values.pbw_id],
|
||||||
|
purchase_item: [values.purchase_item, Validators.compose([Validators.required])],
|
||||||
|
other_purchase_item:[values.other_purchase_item === null ? '' : values.other_purchase_item ],
|
||||||
|
annual_purchase_value: [values.annual_purchase_value],
|
||||||
|
child: this.fb.array([]),
|
||||||
|
comments: [values.comments],
|
||||||
|
isactive:[true],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// create daily purchase product with Data
|
||||||
|
createDailyPurchaseWithData(values: any, parent: any) {
|
||||||
|
console.log("dd",new Date(this.pipe.transform(values.purchase_date, 'yyyy-MM-dd')))
|
||||||
|
return this.fb.group({
|
||||||
|
pbwc_id: [values.pbwc_id],
|
||||||
|
fk_pbw_id: [parent.pbw_id],
|
||||||
|
// purchase_date: [parent.purchase_date=='' ? '' :new Date(this.pipe.transform(values.purchase_date, 'yyyy-MM-dd')), Validators.compose([Validators.required])],
|
||||||
|
purchase_date:[values.purchase_date],
|
||||||
|
purchase_value: [values.purchase_value, Validators.compose([Validators.required])],
|
||||||
|
isactive:[true]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
inWords(values,index){
|
||||||
|
console.log("value",values)
|
||||||
|
if(values != ''){
|
||||||
|
this.purchaseAmtInWords[index]=this.cons.convertNumberToWords(values)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// this caculation for running total
|
||||||
|
purchaseCalculation(indexVal: number,values: any): void {
|
||||||
|
|
||||||
|
let control:any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||||
|
|
||||||
|
if(values.child.length>0){
|
||||||
|
let transformData = values.child.filter(val=>val.purchase_date!='' && val.purchase_date!=null && val.purchase_date!=undefined && val.purchase_value!='' && val.isactive===true).map(mval=>{
|
||||||
|
mval.custum_date = this.pipe.transform(mval.purchase_date, 'yyyy-MM');
|
||||||
|
return mval;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(transformData.length>0) {
|
||||||
|
// let getUniqueMonthCounts = transformData.map(val=>val.custum_date)
|
||||||
|
// .filter((fVal,fIndex,fArray)=>{
|
||||||
|
// return fIndex === fArray.indexOf(fVal);
|
||||||
|
// });
|
||||||
|
|
||||||
|
let TotalAnnualValue = transformData.map(val=>val.purchase_value)
|
||||||
|
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(TotalAnnualValue);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
|
||||||
|
innercontrol.controls[innercontrol.value.length-1].controls['purchase_value'].setValue("");
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addDailyPurchase(len){
|
||||||
|
const control=<FormArray>this.purchaseItemForm.get('purchase_product');
|
||||||
|
control.push(this.createDailyPurchase())
|
||||||
|
const innercontrol=control.at(len).get('child') as FormArray
|
||||||
|
innercontrol.push(this.createDailyPurchaseChild(''))
|
||||||
|
}
|
||||||
|
removeDailyPurchase(index){
|
||||||
|
const control=<FormArray>this.purchaseItemForm.get('purchase_product');
|
||||||
|
control.removeAt(index)
|
||||||
|
}
|
||||||
|
addChild(parentIndex,values){
|
||||||
|
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||||
|
control=control.controls[parentIndex].get('child') as FormArray;
|
||||||
|
control.push(this.createDailyPurchaseChild(values.pbw_id));
|
||||||
|
}
|
||||||
|
removeChild(parentIndex,childIndex,childValue){
|
||||||
|
let control: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||||
|
control=control.controls[parentIndex].get('child') as FormArray;
|
||||||
|
if(childValue.pbwc_id=='' || childValue.pbwc_id==null){
|
||||||
|
control.removeAt(childIndex);
|
||||||
|
let calculatControlValues: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||||
|
calculatControlValues = calculatControlValues.controls[parentIndex];
|
||||||
|
this.purchaseCalculation(parentIndex,calculatControlValues.value);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.controls[childIndex].controls.isactive.setValue(false);
|
||||||
|
let calculatControlValues: any = <FormArray>this.purchaseItemForm.controls['purchase_product'];
|
||||||
|
calculatControlValues = calculatControlValues.controls[parentIndex];
|
||||||
|
this.purchaseCalculation(parentIndex,calculatControlValues.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getDailyPurchase(records){
|
||||||
|
const control=<FormArray>this.purchaseItemForm.get('purchase_product')
|
||||||
|
// const innercontrol=control.at(0).get('child') as FormArray
|
||||||
|
records.forEach((element,index)=>{
|
||||||
|
let purchaseChildControlarr=[]
|
||||||
|
let nexContro=[]
|
||||||
|
control.push(this.createPurchaseItemWithData(element))
|
||||||
|
console.log("records",element)
|
||||||
|
let result=Object.assign({},...element.items);
|
||||||
|
console.log("result",result);
|
||||||
|
// let expandBodyContent= Object.keys(result).map(key => ({ header:key, value: result[key] }));
|
||||||
|
// console.log("expandBody",expandBodyContent);
|
||||||
|
// let listItems: any=[];
|
||||||
|
nexContro[index] = Object.keys(element['items']).map(key => element['items'][key]);
|
||||||
|
console.log("purchasechildcontrol",nexContro[index])
|
||||||
|
purchaseChildControlarr[index]=Object.keys(result).map(key=>result[key])
|
||||||
|
console.log("nexcontrol",purchaseChildControlarr[index])
|
||||||
|
// expandBodyContent.forEach((expnadElement, expnadIndex) => {
|
||||||
|
// console.log("expand",expnadElement)
|
||||||
|
// let calculateItems = expnadElement.value.reduce((acc, calculate) => acc + Number(calculate.purchase_value), 0);
|
||||||
|
// console.log("calculateItems",calculateItems)
|
||||||
|
// listItems.push({items:expnadElement, itemsTotal:calculateItems})
|
||||||
|
const innercontrol=control.at(index).get('child') as FormArray
|
||||||
|
purchaseChildControlarr[index].forEach(chilVal=>{
|
||||||
|
chilVal.forEach((val,index)=>{
|
||||||
|
if(val.purchase_date ){
|
||||||
|
let saleDate = new Date(val.purchase_date);
|
||||||
|
console.log(saleDate.getDay())
|
||||||
|
console.log(saleDate.getDate());
|
||||||
|
val.purchase_date= saleDate.getFullYear() + '-' + ("0" + (saleDate.getMonth() + 1)).slice(-2) + '-' + ("0" + (saleDate.getDay() )).slice(-2);
|
||||||
|
console.log( val.purchase_date)
|
||||||
|
}
|
||||||
|
if(val.purchase_value != ''){
|
||||||
|
this.inWords(val.purchase_value,index)
|
||||||
|
}
|
||||||
|
console.log("child",val)
|
||||||
|
innercontrol.push(this.createDailyPurchaseWithData(val,element))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
// console.log("list_items",listItems)
|
||||||
|
// })
|
||||||
|
// control.push(this.createPurchaseItemWithData(records))
|
||||||
|
|
||||||
|
//console.log('innercontrol',innercontrol)
|
||||||
|
// records.items.forEach((element,index)=>{
|
||||||
|
// innercontrol.push(this.createDailyPurchaseWithData(element,records))
|
||||||
|
// })
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
submitDetails(records){
|
||||||
|
records.purchase_product.forEach(parVal=>{
|
||||||
|
parVal.child.forEach(childVal=>{
|
||||||
|
if(childVal['custum_date']){
|
||||||
|
delete childVal['custum_date']
|
||||||
|
}
|
||||||
|
if(childVal['purchase_date']){
|
||||||
|
childVal['purchase_date']=this.pipe.transform(childVal['purchase_date'], 'yyyy-MM-dd')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
let recordVal:any={'records':records.purchase_product}
|
||||||
|
this.quesCat.saveassessedForms('saveAssessedIncomePurchaseBillwise',recordVal).subscribe(res=>{
|
||||||
|
if(res['dataStatus']== true){
|
||||||
|
this.toast.pdTriggerappmessage("Record Saved Successfully..!")
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.navCtrl.pop()
|
||||||
|
},1500)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("Error");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -19,7 +19,13 @@
|
|||||||
[formGroupName]="sale_i">
|
[formGroupName]="sale_i">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<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">
|
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
|
||||||
|
<mat-option *ngFor="let product of product_and_services" [value]="product.name">{{product.name | titlecase}}</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="item.controls['sales_item'].value == 'Others'" style="width: 100%">
|
||||||
|
<input matInput autocomplete="off" type="text" formControlName="other_sales_item" placeholder="Other Product/Services">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-radio-group class="example-radio-group" formControlName="sales_type" (change)="changeOptions(sale_i,$event.value)">
|
<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>
|
||||||
@ -33,6 +39,7 @@
|
|||||||
<div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i">
|
<div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="date" max="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date">
|
<input matInput type="date" max="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date">
|
||||||
|
<mat-error align="end" style="font-size: 12px">Sales Date is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput type="number" (blur)="salesCalculation(sale_i,item.value)" placeholder="Bill Value" (keyup)="salesCalculation(sale_i,item.value);inWords($event.target.value,i,1)" formControlName="sales_value" name="sales_value">
|
<input matInput type="number" (blur)="salesCalculation(sale_i,item.value)" placeholder="Bill Value" (keyup)="salesCalculation(sale_i,item.value);inWords($event.target.value,i,1)" formControlName="sales_value" name="sales_value">
|
||||||
|
|||||||
@ -35,6 +35,7 @@ export class PdQuestionAssessedDailySalesPage {
|
|||||||
frequencyData: any=[];
|
frequencyData: any=[];
|
||||||
freqAmtInwords: any=[];
|
freqAmtInwords: any=[];
|
||||||
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
|
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
|
||||||
|
product_and_services: any=[];
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider, public fb: FormBuilder,public constant:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider, public fb: FormBuilder,public constant:ConstantsProvider) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
@ -65,6 +66,41 @@ export class PdQuestionAssessedDailySalesPage {
|
|||||||
this.qustCat.getcommondrop('FREQUENCY').subscribe(data=>{
|
this.qustCat.getcommondrop('FREQUENCY').subscribe(data=>{
|
||||||
this.frequencyData=data['records'].filter(val=>val.isactive == 1)
|
this.frequencyData=data['records'].filter(val=>val.isactive == 1)
|
||||||
})
|
})
|
||||||
|
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id,this.pdDetails.company_id).subscribe(res=>{
|
||||||
|
if(res.dataStatus == true){
|
||||||
|
let datas=res.records
|
||||||
|
let api=Object.keys(datas.type_of_activity).map(function(key){
|
||||||
|
return datas.type_of_activity[key];
|
||||||
|
})
|
||||||
|
if(api.length>0){
|
||||||
|
api.forEach(val=>{
|
||||||
|
if(val.type_of_activity_id == 2){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 3){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 4){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 5){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("before",this.product_and_services)
|
||||||
|
this.product_and_services = [].concat.apply([], this.product_and_services);
|
||||||
|
console.log("After",this.product_and_services)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 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{
|
||||||
@ -125,7 +161,8 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
{
|
{
|
||||||
sim_id: [null],
|
sim_id: [null],
|
||||||
sales_item: [null, Validators.compose([Validators.required])],
|
sales_item: [null, Validators.compose([Validators.required])],
|
||||||
sales_type:[null,Validators.compose([Validators.required])],
|
other_sales_item:[null],
|
||||||
|
sales_type:["1"],
|
||||||
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],
|
company_id:[this.pdDetails.company_id],
|
||||||
@ -140,10 +177,10 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
simc_id: [null],
|
simc_id: [null],
|
||||||
fk_sim_id: [null],
|
fk_sim_id: [null],
|
||||||
sales_date: [null, Validators.compose([Validators.required])],
|
sales_date: [null],
|
||||||
sales_value: [null, Validators.compose([Validators.required])],
|
sales_value: [null],
|
||||||
fk_frequency_id:[null,Validators.compose([Validators.required])],
|
fk_frequency_id:[null],
|
||||||
frequency_value:[null,Validators.compose([Validators.required])],
|
frequency_value:[null],
|
||||||
isactive: ['1'],
|
isactive: ['1'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -370,6 +407,7 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
console.log("pd",this.salesDailyForm);
|
||||||
this.toast.pdTriggerappmessage("Please Fill all the Fields")
|
this.toast.pdTriggerappmessage("Please Fill all the Fields")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,6 +477,7 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
{
|
{
|
||||||
sim_id: [data.sim_id],
|
sim_id: [data.sim_id],
|
||||||
sales_item: [data.sales_item, Validators.compose([Validators.required])],
|
sales_item: [data.sales_item, Validators.compose([Validators.required])],
|
||||||
|
other_sales_item:[data.other_sales_item],
|
||||||
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],
|
||||||
|
|||||||
@ -24,9 +24,10 @@
|
|||||||
<form [formGroup]="assessedForm">
|
<form [formGroup]="assessedForm">
|
||||||
<mat-list style="width: 100%">
|
<mat-list style="width: 100%">
|
||||||
<p>Purchase Detail Available</p>
|
<p>Purchase Detail Available</p>
|
||||||
<mat-radio-group formControlName="mode">
|
<mat-radio-group formControlName="purchase_type" class="radio">
|
||||||
<mat-radio-button value="1">Yes</mat-radio-button>
|
<mat-radio-button class="radio" value="1">Purchase Item Wise</mat-radio-button><br/>
|
||||||
<mat-radio-button value="2">No</mat-radio-button>
|
<mat-radio-button class="radio" value="2">Purchase Bill Wise</mat-radio-button><br/>
|
||||||
|
<mat-radio-button class="radio" value="0">Not Available</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</mat-list>
|
</mat-list>
|
||||||
<!-- <mat-list style="width: 100%" *ngIf="assessedForm.get('mode').value==2">
|
<!-- <mat-list style="width: 100%" *ngIf="assessedForm.get('mode').value==2">
|
||||||
|
|||||||
@ -101,5 +101,13 @@ page-pd-question-assessed-dash {
|
|||||||
// .ribbon.javascript {
|
// .ribbon.javascript {
|
||||||
// @include ribbonize($javascript, black);
|
// @include ribbonize($javascript, black);
|
||||||
// }
|
// }
|
||||||
|
.radio{
|
||||||
|
padding-top:10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
//color:blue;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size:24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,8 +46,10 @@ export class PdQuestionAssessedDashPage {
|
|||||||
{
|
{
|
||||||
calc_type_id:[null],
|
calc_type_id:[null],
|
||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
mode:[null,Validators.compose([Validators.required])],
|
// radio_for_mode:[null,Validators.compose([Validators.required])],
|
||||||
|
mode:[null],
|
||||||
margin:[null],
|
margin:[null],
|
||||||
|
purchase_type:[null,Validators.compose([Validators.required])],
|
||||||
fk_createdby:[null],
|
fk_createdby:[null],
|
||||||
fk_updatedby:[null],
|
fk_updatedby:[null],
|
||||||
})
|
})
|
||||||
@ -76,13 +78,21 @@ else{
|
|||||||
|
|
||||||
if(this.assessedForm.valid)
|
if(this.assessedForm.valid)
|
||||||
{
|
{
|
||||||
console.log("mode",answerData.mode.value)
|
console.log("mode",answerData.purchase_type.value)
|
||||||
if(this.assessedForm.controls['mode'].value == 1 ){
|
if(this.assessedForm.controls['purchase_type'].value == 1 ){
|
||||||
this.assessedForm.controls['margin'].setValue(1)
|
this.assessedForm.controls['mode'].setValue(1)
|
||||||
}
|
this.assessedForm.controls['margin'].setValue(null)
|
||||||
else if(this.assessedForm.controls['mode'].value == 2 ){
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(this.assessedForm.controls['purchase_type'].value == 2){
|
||||||
|
this.assessedForm.controls['mode'].setValue(1)
|
||||||
|
this.assessedForm.controls['margin'].setValue(null)
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(this.assessedForm.controls['purchase_type'].value == 0){
|
||||||
|
this.assessedForm.controls['mode'].setValue(2)
|
||||||
this.assessedForm.controls['margin'].setValue(2)
|
this.assessedForm.controls['margin'].setValue(2)
|
||||||
|
this.assessedForm.controls['purchase_type'].setValue(null)
|
||||||
}
|
}
|
||||||
if(this.assessedForm.controls['calc_type_id'].value != null){
|
if(this.assessedForm.controls['calc_type_id'].value != null){
|
||||||
this.assessedForm.controls['fk_updatedby'].setValue(this.users)
|
this.assessedForm.controls['fk_updatedby'].setValue(this.users)
|
||||||
@ -92,7 +102,9 @@ else{
|
|||||||
}
|
}
|
||||||
console.log(this.assessedForm.value);
|
console.log(this.assessedForm.value);
|
||||||
let records = {'records':this.assessedForm.value};
|
let records = {'records':this.assessedForm.value};
|
||||||
|
// delete records.records.radio_for_mode
|
||||||
|
|
||||||
|
// console.log("after",records);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -150,7 +162,11 @@ else{
|
|||||||
if(this.grossprofit !==undefined)
|
if(this.grossprofit !==undefined)
|
||||||
{
|
{
|
||||||
this.grossAccess = true;
|
this.grossAccess = true;
|
||||||
this.assessedForm.controls['mode'].setValue(this.grossprofit.mode);
|
this.assessedForm.controls['mode'].setValue(this.grossprofit.mode);
|
||||||
|
if(this.grossprofit.purchase_type == null ){
|
||||||
|
this.assessedForm.controls['purchase_type'].setValue(0);
|
||||||
|
}
|
||||||
|
// this.assessedForm.controls['purchase_type'].setValue(this.grossprofit.purchase_type);
|
||||||
this.assessedForm.controls['margin'].setValue(this.grossprofit.margin);
|
this.assessedForm.controls['margin'].setValue(this.grossprofit.margin);
|
||||||
this.assessedForm.controls['calc_type_id'].setValue(this.grossprofit.calc_type_id);
|
this.assessedForm.controls['calc_type_id'].setValue(this.grossprofit.calc_type_id);
|
||||||
this.assessedForm.controls['fk_createdby'].setValue(this.grossprofit.fk_createdby);
|
this.assessedForm.controls['fk_createdby'].setValue(this.grossprofit.fk_createdby);
|
||||||
|
|||||||
@ -114,7 +114,7 @@
|
|||||||
<ion-item (click)="editDetails(salesItem.sci_id)">
|
<ion-item (click)="editDetails(salesItem.sci_id)">
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-6>
|
<ion-col col-6>
|
||||||
{{salesItem.sales_item}}
|
{{salesItem.sales_item}}<span *ngIf="salesItem.sales_item == 'Others'">({{salesItem.other_sales_item}})</span>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-6 text-right>
|
<ion-col col-6 text-right>
|
||||||
{{"₹"}} {{salesItem.annual_sale_value}}
|
{{"₹"}} {{salesItem.annual_sale_value}}
|
||||||
@ -146,7 +146,7 @@
|
|||||||
<div *ngFor="let monthwise of sales_month_wise_data">
|
<div *ngFor="let monthwise of sales_month_wise_data">
|
||||||
|
|
||||||
<div (click)="editAssessedDailyForm(monthwise.simId)">
|
<div (click)="editAssessedDailyForm(monthwise.simId)">
|
||||||
<h3 text-center>{{monthwise.salesItem | titlecase}}</h3>
|
<h3 text-center>{{monthwise.salesItem | titlecase}}<span *ngIf="monthwise.salesItem == 'Others'">({{monthwise.otherSaleItem | titlecase}})</span></h3>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-12 *ngFor="let eachItem of monthwise.expandElements">
|
<ion-col col-12 *ngFor="let eachItem of monthwise.expandElements">
|
||||||
<mat-card-title>
|
<mat-card-title>
|
||||||
@ -238,7 +238,8 @@
|
|||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</form> -->
|
</form> -->
|
||||||
<mat-card>
|
|
||||||
|
<mat-card *ngIf="purchase_type == '1'">
|
||||||
<mat-card-header><h4>Purchase Item</h4></mat-card-header>
|
<mat-card-header><h4>Purchase Item</h4></mat-card-header>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-3 *ngIf="purchse_details !=''"><a (click)="editPurchaseAllDetails(purchse_details)"><h2>{{"✎"}}</h2></a></ion-col>
|
<ion-col col-3 *ngIf="purchse_details !=''"><a (click)="editPurchaseAllDetails(purchse_details)"><h2>{{"✎"}}</h2></a></ion-col>
|
||||||
@ -252,7 +253,7 @@
|
|||||||
<ion-item (click)="editPurchaseDetails(purchase.purchase_id)">
|
<ion-item (click)="editPurchaseDetails(purchase.purchase_id)">
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-6>
|
<ion-col col-6>
|
||||||
{{purchase.purchase_item}}
|
{{purchase.purchase_item}}<span *ngIf="purchase.purchase_item == 'Others'">({{purchase.other_purchase_item}})</span>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-6 text-right>
|
<ion-col col-6 text-right>
|
||||||
{{"₹"}} {{purchase.annual_purchase_value}}
|
{{"₹"}} {{purchase.annual_purchase_value}}
|
||||||
@ -263,6 +264,32 @@
|
|||||||
|
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
<mat-card *ngIf="purchase_type == '2'">
|
||||||
|
<mat-card-header><h4>Purchase Calculate Daily Wise</h4></mat-card-header>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-3 *ngIf="purchase_bill_wise !=''"><a (click)="alleditPurchaseBillWise(purchase_bill_wise)"><h2>{{"✎"}}</h2></a></ion-col>
|
||||||
|
<ion-col offset-9 col-3 text-right>
|
||||||
|
<a (click)="AddPurchaseBillWiseForm()">
|
||||||
|
<ion-icon name="add-circle" color="optblue" style="font-size: 24px;"></ion-icon>
|
||||||
|
</a>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-list *ngFor="let purchase of purchase_bill_wise">
|
||||||
|
<ion-item (click)="editPurchaseBillWise(purchase.pbw_id)">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-6>
|
||||||
|
{{purchase.purchase_item}}<span *ngIf="purchase.purchase_item == 'Others'">({{purchase.other_purchase_item}})</span>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col col-6 text-right>
|
||||||
|
{{"₹"}} {{purchase.annual_purchase_value}}
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<hr/>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="pageId==3">
|
<div *ngIf="pageId==3">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
|
|||||||
@ -17,9 +17,9 @@ page-pd-question-assessed-info {
|
|||||||
// p{
|
// p{
|
||||||
// font-size: 12px;
|
// font-size: 12px;
|
||||||
// }
|
// }
|
||||||
.scroll-content{
|
// .scroll-content{
|
||||||
background-color: none;
|
// background-color: none;
|
||||||
}
|
// }
|
||||||
ion-scroll.scroll-y .scroll-content{
|
ion-scroll.scroll-y .scroll-content{
|
||||||
|
|
||||||
width:100%;
|
width:100%;
|
||||||
@ -38,6 +38,20 @@ page-pd-question-assessed-info {
|
|||||||
input{
|
input{
|
||||||
height:30px;
|
height:30px;
|
||||||
}
|
}
|
||||||
|
.scroll-content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
.scroll-content{
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
.mat-card{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-radius: 10px !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;
|
||||||
|
}
|
||||||
|
.mat-card-content{
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import { PdQuestionAssessedHouseholdPage } from '../pd-question-assessed-househo
|
|||||||
import { PdQuestionAssessedBusinessIncomePage } from '../pd-question-assessed-business-income/pd-question-assessed-business-income';
|
import { PdQuestionAssessedBusinessIncomePage } from '../pd-question-assessed-business-income/pd-question-assessed-business-income';
|
||||||
|
|
||||||
import {ConstantsProvider} from '../../../providers/constants/constants'
|
import {ConstantsProvider} from '../../../providers/constants/constants'
|
||||||
|
import {PdQuestionAssessedDailyPurchasePage} from '../pd-question-assessed-daily-purchase/pd-question-assessed-daily-purchase'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,10 +62,12 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
activateMarginCalculation:boolean=false
|
activateMarginCalculation:boolean=false
|
||||||
SaleAmtInwords: any=[];
|
SaleAmtInwords: any=[];
|
||||||
marginAmtInwords: any=[];
|
marginAmtInwords: any=[];
|
||||||
|
purchase_bill_wise: any;
|
||||||
|
purchase_type:any;
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public cons:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public cons:ConstantsProvider) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.pageId = this.navParams.get('pageId');
|
this.pageId = this.navParams.get('pageId');
|
||||||
|
// this.getAssessedDetails();
|
||||||
switch(this.pageId)
|
switch(this.pageId)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -126,7 +129,7 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
}
|
}
|
||||||
ionViewCanEnter()
|
ionViewCanEnter()
|
||||||
{
|
{
|
||||||
this.getAssessedDetails();
|
this.getAssessedDetails()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -218,7 +221,10 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
this.sales_item_value = res['records'].sales_calculated_by_itemwise;
|
this.sales_item_value = res['records'].sales_calculated_by_itemwise;
|
||||||
this.sales_item_month_value = res['records'].sales_items_by_monthwise;
|
this.sales_item_month_value = res['records'].sales_items_by_monthwise;
|
||||||
this.purchse_details = res['records'].purchase_details;
|
this.purchse_details = res['records'].purchase_details;
|
||||||
|
this.purchase_bill_wise=res['records'].purchase_billwise
|
||||||
this.grossprofitCalc = res['records'].gross_profit_calculation_type[0]
|
this.grossprofitCalc = res['records'].gross_profit_calculation_type[0]
|
||||||
|
this.purchase_type=this.grossprofitCalc.purchase_type;
|
||||||
|
console.log("gross",this.grossprofitCalc);
|
||||||
this.mode = this.grossprofitCalc.mode;
|
this.mode = this.grossprofitCalc.mode;
|
||||||
|
|
||||||
var lenOfGrossProfit=res['records'].gross_profit_calculation_type.length
|
var lenOfGrossProfit=res['records'].gross_profit_calculation_type.length
|
||||||
@ -266,7 +272,7 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
year_message: ' Yearly Sales Arrived : '+ calculateAllItemsTotal * convertYear,
|
year_message: ' Yearly Sales Arrived : '+ calculateAllItemsTotal * convertYear,
|
||||||
year_value: calculateAllItemsTotal * convertYear,
|
year_value: calculateAllItemsTotal * convertYear,
|
||||||
})
|
})
|
||||||
this.sales_month_wise_data.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage,simId:itemElement.sim_id});
|
this.sales_month_wise_data.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage,simId:itemElement.sim_id,otherSaleItem:itemElement.other_sales_item});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -355,7 +361,17 @@ export class PdQuestionAssessedInfoPage {
|
|||||||
console.log('260',AllpurchaseData);
|
console.log('260',AllpurchaseData);
|
||||||
this.navCtrl.push(PdQuestionAssessedPurchasePage,{'pdDetails':this.pdDetails,'purchase':AllpurchaseData});
|
this.navCtrl.push(PdQuestionAssessedPurchasePage,{'pdDetails':this.pdDetails,'purchase':AllpurchaseData});
|
||||||
}
|
}
|
||||||
|
AddPurchaseBillWiseForm(){
|
||||||
|
this.navCtrl.push(PdQuestionAssessedDailyPurchasePage,{'pdDetails':this.pdDetails,'purchaseDaily':null})
|
||||||
|
}
|
||||||
|
|
||||||
|
alleditPurchaseBillWise(all_purchase_daily){
|
||||||
|
this.navCtrl.push(PdQuestionAssessedDailyPurchasePage,{'pdDetails':this.pdDetails,'purchaseDaily':all_purchase_daily})
|
||||||
|
}
|
||||||
|
editPurchaseBillWise(daily_purchase){
|
||||||
|
let single_purchase=this.purchase_bill_wise.filter(val=>val.pbw_id==daily_purchase)
|
||||||
|
this.navCtrl.push(PdQuestionAssessedDailyPurchasePage,{'pdDetails':this.pdDetails,'purchaseDaily':single_purchase})
|
||||||
|
}
|
||||||
|
|
||||||
/**Business Expense */
|
/**Business Expense */
|
||||||
AddExpenseForm()
|
AddExpenseForm()
|
||||||
|
|||||||
@ -20,16 +20,28 @@
|
|||||||
|
|
||||||
<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="Raw Material / Trading Item" type="text" name="purchase_item" formControlName="purchase_item" required>
|
<!-- <input matInput placeholder="Raw Material / Trading Item" type="text" name="purchase_item" formControlName="purchase_item" required> -->
|
||||||
|
<mat-select placeholder="Raw Material/Trading Item" formControlName="purchase_item" required>
|
||||||
|
<mat-option>Select</mat-option>
|
||||||
|
<mat-option *ngFor="let prod of productListData" [value]="prod">{{ prod }}</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<input matInput autocomplete="off" formControlName="other_purchase_item" placeholder="Other Raw Material/Trading Item">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
<mat-radio-group formControlName="purchase_type" class="example-radio-group" (change)="changeOptions(i,$event)">
|
||||||
|
<mat-radio-button style="padding-top:10px;padding-bottom: 10px" 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>
|
||||||
|
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="item.value.purchase_type=='1'">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput placeholder="Purchase Quantity" type="number" name="purchase_qty" (keyup)="purchaseCalculation(i,item.value)" formControlName="purchase_qty" required>
|
<input matInput placeholder="Purchase Quantity" type="number" name="purchase_qty" (keyup)="purchaseCalculation(i,item.value)" formControlName="purchase_qty" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="item.value.purchase_type=='1'">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
|
|
||||||
<mat-select placeholder="UOM" name="fk_uom_id" formControlName="fk_uom_id">
|
<mat-select placeholder="UOM" name="fk_uom_id" formControlName="fk_uom_id">
|
||||||
@ -42,9 +54,10 @@
|
|||||||
<mat-form-field style="width: 100%" *ngIf="item.get('fk_uom_id').value == 1 ">
|
<mat-form-field style="width: 100%" *ngIf="item.get('fk_uom_id').value == 1 ">
|
||||||
<input matInput autocomplete="off" placeholder="Other UOM" formControlName="uom_other">
|
<input matInput autocomplete="off" placeholder="Other UOM" formControlName="uom_other">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div *ngIf="item.value.purchase_type=='1'">
|
||||||
|
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="item.value.purchase_type=='1'">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<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>
|
<input matInput placeholder="Rate / Unit of Purchase" type="number" name="rate_per_unit" formControlName="rate_per_unit" (keyup)="inWords($event.target.value,i,1);purchaseCalculation(i,item.value)" 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>
|
||||||
@ -63,10 +76,31 @@
|
|||||||
<input matInput placeholder="Annual Purchase" type="text" name="annual_purchase_value" formControlName="annual_purchase_value" readonly>
|
<input matInput placeholder="Annual Purchase" type="text" name="annual_purchase_value" formControlName="annual_purchase_value" readonly>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('annual_purchase_value').value != null"> {{"₹"}} {{AnnualPurchase[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('annual_purchase_value').value != null"> {{"₹"}} {{AnnualPurchase[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="item.value.purchase_type=='2'">
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
|
||||||
|
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(i,item.value)">
|
||||||
|
<mat-option>Select</mat-option>
|
||||||
|
<mat-option *ngFor="let frq of m_freqOfPurchase" [value]="frq.frequency_id
|
||||||
|
">{{frq.name}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input 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)="purchaseCalculation(i,item.value)" 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>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
|
<input matInput type="number" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
||||||
|
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('annual_purchase_value').value != null"> {{"₹"}} {{AnnualPurchase[i]}} Only</mat-hint>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<textarea matInput autocomplete="off" formControlName="comments" placeholder="Remarks"></textarea>
|
<textarea matInput autocomplete="off" formControlName="comments" placeholder="Remarks"></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
|
||||||
|
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<ion-col col-1>
|
<ion-col col-1>
|
||||||
<a (click)="deletePurchaseDetails(i,item.value)">
|
<a (click)="deletePurchaseDetails(i,item.value)">
|
||||||
|
|||||||
@ -30,6 +30,8 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
rawMaterialForm:FormGroup;
|
rawMaterialForm:FormGroup;
|
||||||
RateOfPurchase: any=[];
|
RateOfPurchase: any=[];
|
||||||
AnnualPurchase: any=[];
|
AnnualPurchase: any=[];
|
||||||
|
productListData:any=[]
|
||||||
|
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
|
||||||
constructor(public navCtrl: NavController, public fb:FormBuilder,public navParams: NavParams,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public aws:AwsServiceProvider,public cons:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public fb:FormBuilder,public navParams: NavParams,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public aws:AwsServiceProvider,public cons:ConstantsProvider) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.purchaseDetails = this.navParams.get('purchase');
|
this.purchaseDetails = this.navParams.get('purchase');
|
||||||
@ -64,6 +66,8 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
company_id:[this.pdDetails.company_id],
|
company_id:[this.pdDetails.company_id],
|
||||||
purchase_item:[null,Validators.compose([Validators.required])],
|
purchase_item:[null,Validators.compose([Validators.required])],
|
||||||
|
other_purchase_item:[null],
|
||||||
|
purchase_type:['1'],
|
||||||
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])],
|
||||||
uom_other:[null],
|
uom_other:[null],
|
||||||
@ -98,6 +102,29 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
this.businessExpenses = res['records'].filter(bus=>bus.isactive==1);
|
this.businessExpenses = res['records'].filter(bus=>bus.isactive==1);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.qustCat.stockFormAccess(this.pdDetails.pd_id,this.pdDetails.company_id).subscribe(data=>{
|
||||||
|
if (data.dataStatus){
|
||||||
|
let datas = data.record;
|
||||||
|
|
||||||
|
let type2 = datas.from_business.filter(data => data.type_of_activity_id == 2);
|
||||||
|
if(type2[0].hasOwnProperty("products")){
|
||||||
|
// this.productListData.push(type2[0].products);
|
||||||
|
}
|
||||||
|
let type3 = datas.from_business.filter(data => data.type_of_activity_id == 3);
|
||||||
|
if(type3[0].hasOwnProperty("products")){
|
||||||
|
this.productListData.push(type3[0].products);
|
||||||
|
}
|
||||||
|
let type4 = datas.from_business.filter(data => data.type_of_activity_id == 4);
|
||||||
|
if(type4[0].hasOwnProperty("products")){
|
||||||
|
this.productListData.push(type4[0].products);
|
||||||
|
}
|
||||||
|
if(datas.from_supplier.hasOwnProperty("raw_material")){
|
||||||
|
this.productListData.push(datas.from_supplier.raw_material);
|
||||||
|
}
|
||||||
|
this.productListData = [].concat.apply([], this.productListData);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
addPurchaseDetails()
|
addPurchaseDetails()
|
||||||
{
|
{
|
||||||
@ -144,14 +171,19 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
|
|
||||||
purchaseCalculation(indexVal,values)
|
purchaseCalculation(indexVal,values)
|
||||||
{
|
{
|
||||||
|
console.log("value",values);
|
||||||
let control:any = <FormArray>this.rawMaterialForm.controls['purchase'];
|
let control:any = <FormArray>this.rawMaterialForm.controls['purchase'];
|
||||||
if(values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='' && values.purchase_qty!=null && values.rate_per_unit!=null && values.fk_frequency_id!=null) {
|
if(values.purchase_type == "1" && values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='' && values.purchase_qty!=null && values.rate_per_unit!=null && values.fk_frequency_id!=null) {
|
||||||
let filterFrequencyValue: any = this.m_freqOfPurchase.filter(val =>val.frequency_id==values.fk_frequency_id);
|
let filterFrequencyValue: any = this.m_freqOfPurchase.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||||
this.inWords(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor),indexVal,2)
|
this.inWords(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor),indexVal,2)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if(values.purchase_type=="2" && values.rate_per_unit !='' && values.rate_per_unit !=null && values.fk_frequency_id != '' && values.fk_frequency_id != null ){
|
||||||
|
let filterFrequencyValue: any = this.m_freqOfPurchase.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||||
|
this.inWords(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor),indexVal,2)
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(null);
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(null);
|
||||||
}
|
}
|
||||||
@ -266,6 +298,8 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
company_id:[this.pdDetails.company_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])],
|
||||||
|
other_purchase_item:[data.other_purchase_item],
|
||||||
|
purchase_type:[data.purchase_type],
|
||||||
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])],
|
||||||
uom_other:[data.uom_other],
|
uom_other:[data.uom_other],
|
||||||
@ -277,6 +311,28 @@ export class PdQuestionAssessedPurchasePage {
|
|||||||
fk_createdby:[this.users]
|
fk_createdby:[this.users]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
changeOptions(indexVal: any,event: any): void{
|
||||||
|
console.log('event',event)
|
||||||
|
let control: any = <FormArray>this.rawMaterialForm.controls['purchase'];
|
||||||
|
if(event.value=="1"){
|
||||||
|
control.controls[indexVal].controls['purchase_qty'].setValidators([Validators.required]);
|
||||||
|
control.controls[indexVal].controls['purchase_qty'].updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[indexVal].controls['fk_uom_id'].setValidators([Validators.required]);
|
||||||
|
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
|
||||||
|
this.purchaseCalculation(indexVal,control.controls[indexVal].value);
|
||||||
|
}
|
||||||
|
else if(event.value=="2"){
|
||||||
|
control.controls[indexVal].controls['purchase_qty'].setValue("");
|
||||||
|
control.controls[indexVal].controls['purchase_qty'].clearValidators();
|
||||||
|
control.controls[indexVal].controls['purchase_qty'].updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[indexVal].controls['fk_uom_id'].setValue("");
|
||||||
|
control.controls[indexVal].controls['fk_uom_id'].clearValidators();
|
||||||
|
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
|
||||||
|
this.purchaseCalculation(indexVal,control.controls[indexVal].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
inWords(e,c,flag){
|
inWords(e,c,flag){
|
||||||
switch(flag){
|
switch(flag){
|
||||||
case 1 :
|
case 1 :
|
||||||
|
|||||||
@ -19,7 +19,14 @@
|
|||||||
<mat-card>
|
<mat-card>
|
||||||
<!-- <h3>Itemwise</h3> -->
|
<!-- <h3>Itemwise</h3> -->
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input type="text" matInput placeholder="Product/Services" formControlName="sales_item" (keyup)="salesCalculation(i,item.value)" name="sales_item">
|
<!-- <input type="text" matInput placeholder="Product/Services" formControlName="sales_item" (keyup)="salesCalculation(i,item.value)" name="sales_item"> -->
|
||||||
|
<mat-select placeholder="Product/Services" formControlName="sales_item" required>
|
||||||
|
<mat-option *ngFor="let product of product_and_services" [value]="product.name">{{product.name | titlecase}}</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="item.controls['sales_item'].value == 'Others'" style="width: 100%">
|
||||||
|
<input matInput autocomplete="off" type="text" formControlName="other_sales_item" placeholder="Other Product/Services">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-radio-group formControlName="sales_type" class="example-radio-group" (change)="changeOptions(i,$event)">
|
<mat-radio-group formControlName="sales_type" class="example-radio-group" (change)="changeOptions(i,$event)">
|
||||||
<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>
|
||||||
|
|||||||
@ -36,6 +36,7 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
ratePerUnitAmtInwords: any=[];
|
ratePerUnitAmtInwords: any=[];
|
||||||
margin_calculation_status:any=[]
|
margin_calculation_status:any=[]
|
||||||
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
|
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
|
||||||
|
product_and_services: any=[];
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public cons:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public cons:ConstantsProvider) {
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
@ -78,6 +79,42 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
this.UOM = res['records'].filter(uom=>uom.isactive==1);
|
this.UOM = res['records'].filter(uom=>uom.isactive==1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id,this.pdDetails.company_id).subscribe(res=>{
|
||||||
|
if(res.dataStatus == true){
|
||||||
|
let datas=res.records
|
||||||
|
let api=Object.keys(datas.type_of_activity).map(function(key){
|
||||||
|
return datas.type_of_activity[key];
|
||||||
|
})
|
||||||
|
if(api.length>0){
|
||||||
|
api.forEach(val=>{
|
||||||
|
if(val.type_of_activity_id == 2){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 3){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 4){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(val.type_of_activity_id == 5){
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.product_and_services.push(val.prodcuts)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("before",this.product_and_services)
|
||||||
|
this.product_and_services = [].concat.apply([], this.product_and_services);
|
||||||
|
console.log("After",this.product_and_services)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
createSalesCal()
|
createSalesCal()
|
||||||
@ -89,8 +126,9 @@ export class PdQuestionAssessedSalesPage {
|
|||||||
fk_pd_id:[this.pdDetails.pd_id],
|
fk_pd_id:[this.pdDetails.pd_id],
|
||||||
company_id:[this.pdDetails.company_id],
|
company_id:[this.pdDetails.company_id],
|
||||||
sales_item:[null,Validators.compose([Validators.required])],
|
sales_item:[null,Validators.compose([Validators.required])],
|
||||||
|
other_sales_item:[null],
|
||||||
sales_qty:[null,Validators.compose([Validators.required])],
|
sales_qty:[null,Validators.compose([Validators.required])],
|
||||||
sales_type:[null,Validators.compose([Validators.required])],
|
sales_type:["1"],
|
||||||
fk_uom_id:[null,Validators.compose([Validators.required])],
|
fk_uom_id:[null,Validators.compose([Validators.required])],
|
||||||
uom_other:[null],
|
uom_other:[null],
|
||||||
rate_per_unit:[null,Validators.compose([Validators.required])],
|
rate_per_unit:[null,Validators.compose([Validators.required])],
|
||||||
@ -433,6 +471,7 @@ else{
|
|||||||
company_id:[this.pdDetails.company_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])],
|
||||||
|
other_sales_item:[data.other_sales_item],
|
||||||
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])],
|
||||||
|
|||||||
@ -35,15 +35,18 @@ export class PdQuestionAssessedSummaryPage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
getAssessedDetails(){
|
getAssessedDetails(){
|
||||||
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){
|
||||||
|
if(res['records'].final_data.length != 0){
|
||||||
this.salesCustomer=res['records'].final_data[0].sales_declared_by_customer
|
this.salesCustomer=res['records'].final_data[0].sales_declared_by_customer
|
||||||
this.salesItemWise=res['records'].final_data[0].sales_calculated_by_itemwise
|
this.salesItemWise=res['records'].final_data[0].sales_calculated_by_itemwise
|
||||||
this.salesMonthWise=res['records'].final_data[0].sales_calculated_by_monthwise
|
this.salesMonthWise=res['records'].final_data[0].sales_calculated_by_monthwise
|
||||||
this.consolidatedReport=res['records'].final_data[0].consolidated_report
|
this.consolidatedReport=res['records'].final_data[0].consolidated_report
|
||||||
console.log(this.salesCustomer);
|
console.log(this.salesCustomer);
|
||||||
|
}
|
||||||
this.loadData=true
|
this.loadData=true
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,10 +5,62 @@
|
|||||||
</button>
|
</button>
|
||||||
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
|
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
<ion-segment [(ngModel)]="tab" color="optblue">
|
||||||
|
<ion-segment-button value="0">
|
||||||
|
Form
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="1">
|
||||||
|
Pictures
|
||||||
|
</ion-segment-button>
|
||||||
|
</ion-segment>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
<div [ngSwitch]="tab">
|
||||||
<form [formGroup]="AssetsDetailsForm" >
|
<mat-card *ngSwitchCase="'1'" #picContent>
|
||||||
|
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found</strong></mat-label>
|
||||||
|
|
||||||
|
<ion-grid *ngIf="imageDisplay.length >0 ">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-6 *ngFor="let image of imageDisplay; let i=index" no-padding>
|
||||||
|
<img src="{{image.image}}" imageViewer>
|
||||||
|
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
|
||||||
|
|
||||||
|
<input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)">
|
||||||
|
<button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
||||||
|
</ion-col>
|
||||||
|
<hr/>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<ion-grid *ngIf="imageBucket.length >0 ">
|
||||||
|
<label style="font-size:14px;color:gray">Newly Captured Pics</label><br/>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-6 *ngFor="let image of imageBucket; let i=index" no-padding>
|
||||||
|
<img src="{{image.image}}" imageViewer>
|
||||||
|
<label *ngIf="image.Name != ''"><strong>{{image.Name}}</strong></label>
|
||||||
|
|
||||||
|
<input #focusName *ngIf="image.Name ==''" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeNameForBucket($event.target.value,i,image.image)">
|
||||||
|
<button float-right ion-button clear color="optblue" (click)="removeImgForBucket(i)"><ion-icon style="font-size:22px" name="md-trash"></ion-icon></button>
|
||||||
|
</ion-col>
|
||||||
|
<hr/>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
</mat-card-content>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
|
<form [formGroup]="AssetsDetailsForm" *ngSwitchCase="'0'">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <button ion-button block (click)="sendImage()">Send</button> -->
|
||||||
<!-- *ngIf="apiLoadFinish && loadDetails"-->
|
<!-- *ngIf="apiLoadFinish && loadDetails"-->
|
||||||
<div fxLayout="row" fxLayoutAlign="start none">
|
<div fxLayout="row" fxLayoutAlign="start none">
|
||||||
<div formArrayName="assets_details" fxFill>
|
<div formArrayName="assets_details" fxFill>
|
||||||
@ -73,7 +125,7 @@
|
|||||||
|
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
|
<input matInput placeholder="Area Covered" formControlName="area_covered_by_this_property"
|
||||||
autocomplete="off">
|
autocomplete="off" type="number">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
@ -369,7 +421,13 @@
|
|||||||
|
|
||||||
</ion-row>
|
</ion-row>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<ion-fab bottom right mini>
|
||||||
|
<button mini style="margin-bottom: 10px" ion-fab color="optblue" slot="fixed" (click)="savePhoto()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button></ion-fab>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
|
|
||||||
|
|
||||||
<button ion-button full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
|
<button ion-button full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
|
||||||
</ion-footer>
|
</ion-footer>
|
||||||
@ -13,4 +13,45 @@ page-pd-question-assests {
|
|||||||
.mat-card-content{
|
.mat-card-content{
|
||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
}
|
}
|
||||||
|
img{
|
||||||
|
padding:0 5px 5px 5px;
|
||||||
|
height: 180px;
|
||||||
|
//width:130px;
|
||||||
|
//border:3px solid black;
|
||||||
|
//border-radius: 20px;
|
||||||
|
//background-color: gray;
|
||||||
|
}
|
||||||
|
input{
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-color: gray;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 28px;
|
||||||
|
|
||||||
|
}
|
||||||
|
// .prompt_alert .alert-input{
|
||||||
|
// border-bottom: none!important;
|
||||||
|
// caret-color: #F58282;
|
||||||
|
// }
|
||||||
|
// .prompt_alert .alert-input-group:before {
|
||||||
|
// content: '#';
|
||||||
|
// display: inline-block;
|
||||||
|
// // float: right;
|
||||||
|
// line-height: 3.5;
|
||||||
|
// color: black;
|
||||||
|
// }
|
||||||
|
// .prompt_alert .alert-input-wrapper {
|
||||||
|
// display: flex;
|
||||||
|
// padding-right: 3px;
|
||||||
|
// }
|
||||||
|
// .buttoncss{
|
||||||
|
// color:red;
|
||||||
|
// background: green
|
||||||
|
// }
|
||||||
|
// .btnYes{
|
||||||
|
// color:red;
|
||||||
|
// }
|
||||||
|
// .btnNo{
|
||||||
|
// color:green;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, ViewChild } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams,AlertController, Content } from 'ionic-angular';
|
||||||
import { FormArray,FormGroup,FormBuilder,Validators} from '@angular/forms';
|
import { FormArray,FormGroup,FormBuilder,Validators} from '@angular/forms';
|
||||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||||
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
||||||
import {ConstantsProvider} from '../../../providers/constants/constants'
|
import {ConstantsProvider} from '../../../providers/constants/constants'
|
||||||
import { ToastProvider } from '../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
|
import {Camera} from '@ionic-native/camera'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionAssestsPage page.
|
* Generated class for the PdQuestionAssestsPage page.
|
||||||
@ -19,6 +20,7 @@ import { ToastProvider } from '../../../providers/common-provider/toast';
|
|||||||
templateUrl: 'pd-question-assests.html',
|
templateUrl: 'pd-question-assests.html',
|
||||||
})
|
})
|
||||||
export class PdQuestionAssestsPage {
|
export class PdQuestionAssestsPage {
|
||||||
|
tab:any='0'
|
||||||
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
|
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
|
||||||
{'value': "no",'viewValue': "No"},
|
{'value': "no",'viewValue': "No"},
|
||||||
{'value': "nan",'viewValue': "NA"}]
|
{'value': "nan",'viewValue': "NA"}]
|
||||||
@ -50,7 +52,12 @@ export class PdQuestionAssestsPage {
|
|||||||
isOtherOwner: any = [];
|
isOtherOwner: any = [];
|
||||||
pdid:any;
|
pdid:any;
|
||||||
currentYear: any = new Date().getFullYear();
|
currentYear: any = new Date().getFullYear();
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public constprovider:ConstantsProvider) {
|
imageBucket: any=[];
|
||||||
|
base64: string;
|
||||||
|
imageDisplay: any=[];
|
||||||
|
@ViewChild('focusName') inputFocus;
|
||||||
|
@ViewChild('picContent') content: Content
|
||||||
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public constprovider:ConstantsProvider,public camera:Camera,public alert: AlertController) {
|
||||||
|
|
||||||
this.assestInfo = "busass";
|
this.assestInfo = "busass";
|
||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
@ -73,6 +80,50 @@ export class PdQuestionAssestsPage {
|
|||||||
}
|
}
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
console.log('ionViewDidLoad PdQuestionAssestsPage');
|
console.log('ionViewDidLoad PdQuestionAssestsPage');
|
||||||
|
console.log("Form",this.AssetsDetailsForm)
|
||||||
|
}
|
||||||
|
// ionViewWillLeave(){
|
||||||
|
// console.log(this.AssetsDetailsForm.dirty);
|
||||||
|
// if(this.AssetsDetailsForm.dirty){
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
ionViewCanLeave(){
|
||||||
|
console.log("dirty",this.AssetsDetailsForm.dirty);
|
||||||
|
if(this.AssetsDetailsForm.dirty){
|
||||||
|
// console.log("dirty",this.AssetsDetailsForm.dirty)
|
||||||
|
//return false;
|
||||||
|
// let val=this.toast.setAlert('Form is Modified','Are you sure want to Go Back');
|
||||||
|
// console.log("v",val)
|
||||||
|
// if(val==1){
|
||||||
|
|
||||||
|
// }
|
||||||
|
// if(val.__zone_symbol__state)
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let alert=this.alert.create({
|
||||||
|
title:'Form is Modified',
|
||||||
|
message:'Are you sure want to Go Back',
|
||||||
|
cssClass:'buttoncss',
|
||||||
|
buttons:[{
|
||||||
|
text:'Yes',
|
||||||
|
cssClass:'btnYes',
|
||||||
|
handler:()=>{
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text:'No',
|
||||||
|
cssClass:'btnNo',
|
||||||
|
handler:()=>{
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
alert.present()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getdropList()
|
getdropList()
|
||||||
@ -444,6 +495,10 @@ export class PdQuestionAssestsPage {
|
|||||||
|
|
||||||
saveAssetDetails(answerData)
|
saveAssetDetails(answerData)
|
||||||
{
|
{
|
||||||
|
if(!this.AssetsDetailsForm.dirty){
|
||||||
|
this.toast.pdTriggerappmessage("Modified"+' '+this.AssetsDetailsForm.dirty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]);
|
Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]);
|
||||||
// answerData.assets_details.map(val => {
|
// answerData.assets_details.map(val => {
|
||||||
@ -501,11 +556,13 @@ export class PdQuestionAssestsPage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let Avaliablity = 1;
|
let Avaliablity = 1;
|
||||||
|
if(val.name_of_the_owner.length>0){
|
||||||
val.name_of_the_owner.forEach(option => {
|
val.name_of_the_owner.forEach(option => {
|
||||||
if (option.id == 0 && option.group_id == 2) {
|
if (option.id == 0 && option.group_id == 2) {
|
||||||
Avaliablity = option.id;
|
Avaliablity = option.id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.isOtherOwner[index] = Avaliablity == 0 ? true : false
|
this.isOtherOwner[index] = Avaliablity == 0 ? true : false
|
||||||
|
|
||||||
const control = <FormArray>this.AssetsDetailsForm.controls['assets_details'];
|
const control = <FormArray>this.AssetsDetailsForm.controls['assets_details'];
|
||||||
@ -526,9 +583,35 @@ export class PdQuestionAssestsPage {
|
|||||||
// this.addAsset(2);
|
// this.addAsset(2);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
/*FOR RETRIEVING PHOTOS*/
|
||||||
|
let record_for_pic = {'pd_id':this.pdDetails.pd_id,'form_id':this.FormId.form_id}
|
||||||
|
this.qustCat.getPDImages(record_for_pic).subscribe(val=>{
|
||||||
|
if(!val['msg']){
|
||||||
|
console.log(val['records'])
|
||||||
|
if(val['records'].length>0){
|
||||||
|
val['records'].forEach(result=>{
|
||||||
|
this.imageDisplay.push({'image':result.doc_url,'Name':result.pd_document_title,'option':'dummy'})
|
||||||
|
})
|
||||||
|
console.log("imageBuck",this.imageDisplay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeName(value,index,img){
|
||||||
|
console.log(value);
|
||||||
|
this.imageDisplay[index]={'image':img,'Name':value}
|
||||||
|
|
||||||
|
}
|
||||||
|
changeNameForBucket(value,index,img){
|
||||||
|
this.imageBucket[index]={'image':img,'Name':value}
|
||||||
|
}
|
||||||
|
removeImg(index){
|
||||||
|
this.imageDisplay.splice(index,1);
|
||||||
|
}
|
||||||
|
removeImgForBucket(index){
|
||||||
|
this.imageBucket.splice(index,1)
|
||||||
|
}
|
||||||
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
|
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
|
||||||
let val = i;
|
let val = i;
|
||||||
|
|
||||||
@ -702,5 +785,84 @@ export class PdQuestionAssestsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
savePhoto(){
|
||||||
|
let num_of_images=(this.imageBucket.length+1)+(this.imageDisplay.length+1)
|
||||||
|
console.log("num of images",num_of_images)
|
||||||
|
if(num_of_images <=10){
|
||||||
|
this.camera.getPicture({
|
||||||
|
quality: 100,
|
||||||
|
destinationType: this.camera.DestinationType.DATA_URL,
|
||||||
|
targetWidth: 500,
|
||||||
|
targetHeight: 600,
|
||||||
|
correctOrientation: true
|
||||||
|
}).then((imageData)=>{
|
||||||
|
this.base64='data:image/png;base64,'+imageData
|
||||||
|
this.imageBucket.push({'image':this.base64,'Name':''});
|
||||||
|
// this.imageDisplay.push({'image':this.base64,'Name':''})
|
||||||
|
this. getImageName(this.imageBucket.length-1)
|
||||||
|
|
||||||
|
},(err)=>{
|
||||||
|
//alert("error");
|
||||||
|
})
|
||||||
|
this.tab='1';
|
||||||
|
// this.content.scrollToBottom();
|
||||||
|
// let dimensions = this.content.getContentDimensions();
|
||||||
|
// this.content.scrollTo(0, dimensions.contentHeight+100, 100);
|
||||||
|
// this.inputFocus.setFocus();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage("You are reached the image Limit. To Capture new one Delete the Previous image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getImageName(index){
|
||||||
|
console.log("index",index);
|
||||||
|
let alert=this.alert.create({
|
||||||
|
title:'Document Name',
|
||||||
|
message: 'Please Enter the Document Name',
|
||||||
|
cssClass:'prompt_alert',
|
||||||
|
inputs:[
|
||||||
|
{
|
||||||
|
name:'Name',
|
||||||
|
//value:this.imageBucket[index].Name
|
||||||
|
placeholder:'Document Name'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
text:'Submit',
|
||||||
|
handler:data=>{
|
||||||
|
console.log(data.Name)
|
||||||
|
this.imageBucket[index].Name=data.Name
|
||||||
|
alert.dismiss
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
alert.present();
|
||||||
|
//this.inputFocus.setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
// al(){
|
||||||
|
// this.toast.pdTriggerappmessage("touched");
|
||||||
|
// }
|
||||||
|
sendImage(){
|
||||||
|
console.log("ll",JSON.stringify(this.imageBucket));
|
||||||
|
let records:any={
|
||||||
|
'pd_id':this.pdDetails.pd_id,
|
||||||
|
'formid':this.FormId.form_id,
|
||||||
|
'images':this.imageBucket,
|
||||||
|
'company_id':''
|
||||||
|
}
|
||||||
|
console.log("records",JSON.stringify(records))
|
||||||
|
|
||||||
|
this.qustCat.savePDImages(records).subscribe(res=>{
|
||||||
|
if(res['dataStatus']== true){
|
||||||
|
this.toast.pdTriggerappmessage("Image Saved Successfully")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toast.pdTriggerappmessage('Fail');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -34,10 +34,12 @@
|
|||||||
<input matInput placeholder="Specify Others(Name)" formControlName="partner_other_name"
|
<input matInput placeholder="Specify Others(Name)" formControlName="partner_other_name"
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<div *ngIf="generalExistEntityType.value!=''">
|
||||||
<mat-form-field style="width:100%;" *ngIf="!EntityTypeFlag && generalExistEntityType!='4' && generalExistEntityType!='9' && generalExistEntityType.value!=''">
|
<mat-form-field style="width:100%;" *ngIf="!EntityTypeFlag && generalExistEntityType!='4' && generalExistEntityType!='9' && generalExistEntityType.value!=''">
|
||||||
<input matInput type="number" #shareholding placeholder="Share of Profit / Shareholding (%)"
|
<input matInput type="number" #shareholding placeholder="Share of Profit / Shareholding (%)"
|
||||||
formControlName="shareholding" autocomplete="off">
|
formControlName="shareholding" autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
<mat-form-field style="width:100%;" *ngIf="!EntityTypeFlag">
|
<mat-form-field style="width:100%;" *ngIf="!EntityTypeFlag">
|
||||||
<mat-select placeholder="Started Business" formControlName="started_business"
|
<mat-select placeholder="Started Business" formControlName="started_business"
|
||||||
(selectionChange)="changeOfStartedBusiness(member,i,$event.value);" *ngIf="!EntityTypeFlag">
|
(selectionChange)="changeOfStartedBusiness(member,i,$event.value);" *ngIf="!EntityTypeFlag">
|
||||||
@ -280,7 +282,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="l">
|
<ion-col col-2 offset-1 *ngIf="l">
|
||||||
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More</button>
|
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</div>
|
</div>
|
||||||
@ -396,7 +398,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="l">
|
<ion-col col-2 offset-1 *ngIf="l">
|
||||||
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More</button>
|
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</div>
|
</div>
|
||||||
@ -498,7 +500,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="retail.value.pan_india_options=='No' && l">
|
<ion-col col-2 offset-1 *ngIf="retail.value.pan_india_options=='No' && l">
|
||||||
<button ion-button color="optblue" (click)="addRetailMoreState(r,'1')">Add More</button>
|
<button ion-button color="optblue" (click)="addRetailMoreState(r,'1')">Add More State</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</div>
|
</div>
|
||||||
@ -559,7 +561,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col *ngIf="l">
|
<ion-col *ngIf="l">
|
||||||
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More</button>
|
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</div>
|
</div>
|
||||||
@ -675,7 +677,7 @@
|
|||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="l">
|
<ion-col col-2 offset-1 *ngIf="l">
|
||||||
|
|
||||||
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More</button>
|
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</div>
|
</div>
|
||||||
@ -841,7 +843,7 @@
|
|||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="l">
|
<ion-col col-2 offset-1 *ngIf="l">
|
||||||
<button ion-button color="optblue" (click)="addWholesaleMoreState(w,'2')">Add
|
<button ion-button color="optblue" (click)="addWholesaleMoreState(w,'2')">Add
|
||||||
More</button>
|
More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
|
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
@ -957,7 +959,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button ion-button float-right color="optblue" (click)="addWholesaleMoreState(w,'2')">Add
|
<button ion-button float-right color="optblue" (click)="addWholesaleMoreState(w,'2')">Add
|
||||||
State</button>
|
Countries</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -1247,7 +1249,7 @@
|
|||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1 *ngIf="l">
|
<ion-col col-2 offset-1 *ngIf="l">
|
||||||
<button ion-button color="optblue" (click)="addServiceMoreState(sp,'2')">Add
|
<button ion-button color="optblue" (click)="addServiceMoreState(sp,'2')">Add
|
||||||
More</button>
|
More Countries</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<!-- </div>
|
<!-- </div>
|
||||||
|
|||||||
@ -163,7 +163,22 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
this.qustCat.getcommondrop('BUSINESSENTITYTYPE').subscribe(data=>{
|
||||||
|
if(data['dataStatus']==true){
|
||||||
|
let filterList = data['records'].filter(val=>val.business_entity_type_id==this.generalExistEntityType);
|
||||||
|
console.log("Filter",filterList)
|
||||||
|
if(filterList.length>0){
|
||||||
|
this.businessEntityTypeList.business_entity_type_id = filterList[0].business_entity_type_id==1;
|
||||||
|
this.businessEntityTypeList.business_entity_type_name = filterList[0].business_entity_type_id!=1 ? filterList[0].business_entity_type_name : this.generalExistEntityType_other;
|
||||||
|
this.businessEntityTypeList.section_label = filterList[0].business_entity_type_id!=1 ? filterList[0].section_label : this.generalExistEntityType_other;
|
||||||
|
|
||||||
|
if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){
|
||||||
|
this.EntityTypeFlag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
this.qustCat.getcommondrop('INDUSTRYCLASSIFICATION').subscribe(data => {
|
this.qustCat.getcommondrop('INDUSTRYCLASSIFICATION').subscribe(data => {
|
||||||
|
|
||||||
data['records'].forEach(val => {
|
data['records'].forEach(val => {
|
||||||
@ -181,19 +196,7 @@ export class PdQuestionBusinessInfoPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
this.qustCat.getcommondrop('BUSINESSENTITYTYPE').subscribe(data=>{
|
|
||||||
let filterList = data['records'].filter(val=>val.business_entity_type_id==this.generalExistEntityType);
|
|
||||||
console.log("Filter",filterList)
|
|
||||||
this.businessEntityTypeList.business_entity_type_id = filterList[0].business_entity_type_id==1;
|
|
||||||
this.businessEntityTypeList.business_entity_type_name = filterList[0].business_entity_type_id!=1 ? filterList[0].business_entity_type_name : this.generalExistEntityType_other;
|
|
||||||
this.businessEntityTypeList.section_label = filterList[0].business_entity_type_id!=1 ? filterList[0].section_label : this.generalExistEntityType_other;
|
|
||||||
|
|
||||||
if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){
|
|
||||||
this.EntityTypeFlag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe(data=>{
|
this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe(data=>{
|
||||||
this.companyRelationShipList=data['records'].filter(val=>val.isactive==1);
|
this.companyRelationShipList=data['records'].filter(val=>val.isactive==1);
|
||||||
|
|
||||||
|
|||||||
@ -151,16 +151,16 @@
|
|||||||
[formGroupName]="i">
|
[formGroupName]="i">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput type="number" placeholder="Annual Sales From" formControlName="estimate_sales_from" (change)="calculateSalesAverage(i,details)" (keyup)="inWords($event,i,11)">
|
<input matInput type="number" placeholder="Annual Sales From" formControlName="estimate_sales_from" (change)="calculateSalesAverage(i,details);AllCalculation(details,i)" (keyup)="inWords($event,i,11)">
|
||||||
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_from').value != ''">{{"₹"}} {{AV_SalesFrmInwords[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_from').value != ''">{{"₹"}} {{AV_SalesFrmInwords[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput type="number" placeholder="Annual Sales To" formControlName="estimate_sales_to" (change)="confirmAlert(i,details)" (keyup)="inWords($event,i,12)">
|
<input matInput type="number" placeholder="Annual Sales To" formControlName="estimate_sales_to" (change)="confirmAlert(i,details);AllCalculation(details,i)" (keyup)="inWords($event,i,12)">
|
||||||
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_to').value != ''">{{"₹"}} {{AV_SalesToInwords[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_to').value != ''">{{"₹"}} {{AV_SalesToInwords[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput type="number" placeholder="Consider Sales Average" formControlName="estimate_sales_average" readonly>
|
<input matInput type="number" placeholder="Consider Sales Average" formControlName="estimate_sales_average" readonly>
|
||||||
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_to').value != ''">{{"₹"}} {{AV_SalesInwords[i]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:11px" *ngIf="details.get('estimate_sales_average').value != ''">{{"₹"}} {{AV_SalesInwords[i]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
|||||||
@ -67,6 +67,15 @@ export class PdQuestionFinancialInfoPage {
|
|||||||
this.CustSegAbbr=x[1]
|
this.CustSegAbbr=x[1]
|
||||||
|
|
||||||
this.initFinancialForm()
|
this.initFinancialForm()
|
||||||
|
// console.log("ld",this.financialForm.controls['estimated_value'])
|
||||||
|
// if(this.financialForm.controls['estimated_value']['controls'].length>0){
|
||||||
|
// console.log(this.financialForm.controls['estimated_value']['controls'][0].controls)
|
||||||
|
// const estime_value=this.financialForm.controls['estimated_value']['controls'][0].controls['estimate_sales_average']
|
||||||
|
// console.log(estime_value)
|
||||||
|
// estime_value.valueChanges.subscribe(res=>{
|
||||||
|
// console.log("changes",res);
|
||||||
|
// })
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
@ -74,6 +83,33 @@ export class PdQuestionFinancialInfoPage {
|
|||||||
this.getDetails()
|
this.getDetails()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AllCalculation(control,index){
|
||||||
|
console.log("all",control)
|
||||||
|
if(control.controls['estimate_profit_or_loss'].value == 1 && control.controls['estimate_net_margin_availablity'].value =='yes'){
|
||||||
|
if(control.controls['estimate_profit_range_from'].value != '' && control.controls['estimate_profit_range_to'].value != ''){
|
||||||
|
console.log("calculate marginP")
|
||||||
|
this.calculateMarginProfit(index,control)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(control.controls['estimate_profit_or_loss'].value == 1 && control.controls['estimate_net_margin_availablity'].value =='no'){
|
||||||
|
if(control.controls['estimate_net_profit_from'].value != '' && control.controls['estimate_net_profit_to'].value != ''){
|
||||||
|
console.log("calculate Profit ")
|
||||||
|
this.calculateProfitAmount(index,control)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(control.controls['estimate_profit_or_loss'].value == 2 && control.controls['estimate_net_margin_availablity'].value =='yes'){
|
||||||
|
if(control.controls['estimate_loss_range_from'].value != '' && control.controls['estimate_loss_range_to'].value != ''){
|
||||||
|
console.log("calculate marginL")
|
||||||
|
this.calculateMarginLoss(index,control)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(control.controls['estimate_profit_or_loss'].value == 2 && control.controls['estimate_net_margin_availablity'].value =='no'){
|
||||||
|
if(control.controls['estimate_net_loss_from'].value != '' && control.controls['estimate_net_loss_to'].value != ''){
|
||||||
|
console.log("calculate Loss")
|
||||||
|
this.calculateLossAmount(index,control)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
selectedStatement(e :any):void{
|
selectedStatement(e :any):void{
|
||||||
|
|
||||||
if(e == 'yes'){
|
if(e == 'yes'){
|
||||||
|
|||||||
@ -38,7 +38,15 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Unit of Mearsurement" formControlName="raw_uom">
|
<mat-select placeholder="Unit of Mearsurement" formControlName="raw_uom">
|
||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
<mat-option>
|
||||||
|
<ngx-mat-select-search formControlName="uomSearch"
|
||||||
|
[placeholderLabel]="'Search Unit'"
|
||||||
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(mrm,a)">
|
||||||
|
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||||
|
</ngx-mat-select-search>
|
||||||
|
</mat-option>
|
||||||
|
<mat-option> Select</mat-option>
|
||||||
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="mrm.get('raw_uom').value == 1" style="width:100%">
|
<mat-form-field *ngIf="mrm.get('raw_uom').value == 1" style="width:100%">
|
||||||
@ -114,7 +122,15 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Unit of Mearsurement" formControlName="goods_uom">
|
<mat-select placeholder="Unit of Mearsurement" formControlName="goods_uom">
|
||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
<mat-option>
|
||||||
|
<ngx-mat-select-search formControlName="uomSearch"
|
||||||
|
[placeholderLabel]="'Search Unit'"
|
||||||
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(mfg,a)">
|
||||||
|
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||||
|
</ngx-mat-select-search>
|
||||||
|
</mat-option>
|
||||||
|
<mat-option> Select</mat-option>
|
||||||
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="mfg.get('goods_uom').value == 1" style="width:100%">
|
<mat-form-field *ngIf="mfg.get('goods_uom').value == 1" style="width:100%">
|
||||||
@ -187,7 +203,15 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
|
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
|
||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
<mat-option>
|
||||||
|
<ngx-mat-select-search formControlName="uomSearch"
|
||||||
|
[placeholderLabel]="'Search Unit'"
|
||||||
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(item,a)">
|
||||||
|
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||||
|
</ngx-mat-select-search>
|
||||||
|
</mat-option>
|
||||||
|
<mat-option> Select</mat-option>
|
||||||
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="item.get('traded_goods_uom').value == 1" style="width:100%">
|
<mat-form-field *ngIf="item.get('traded_goods_uom').value == 1" style="width:100%">
|
||||||
@ -263,7 +287,15 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
|
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
|
||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
<mat-option>
|
||||||
|
<ngx-mat-select-search formControlName="uomSearch"
|
||||||
|
[placeholderLabel]="'Search Unit'"
|
||||||
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(tradetg,a)">
|
||||||
|
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||||
|
</ngx-mat-select-search>
|
||||||
|
</mat-option>
|
||||||
|
<mat-option> Select</mat-option>
|
||||||
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:100%">
|
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:100%">
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { AwsServiceProvider } from '../../../../providers/aws-service/aws-servic
|
|||||||
import { ToastProvider } from '../../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../../providers/common-provider/toast';
|
||||||
import { FormArray, FormGroup, FormBuilder } from '@angular/forms';
|
import { FormArray, FormGroup, FormBuilder } from '@angular/forms';
|
||||||
import { ConstantsProvider } from '../../../../providers/constants/constants';
|
import { ConstantsProvider } from '../../../../providers/constants/constants';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionStockInfoPage page.
|
* Generated class for the PdQuestionStockInfoPage page.
|
||||||
@ -21,6 +23,7 @@ import { ConstantsProvider } from '../../../../providers/constants/constants';
|
|||||||
export class PdQuestionStockInfoPage {
|
export class PdQuestionStockInfoPage {
|
||||||
|
|
||||||
uomData: any;
|
uomData: any;
|
||||||
|
uomDataValue:any;
|
||||||
rawmaterial: any;
|
rawmaterial: any;
|
||||||
users: any;
|
users: any;
|
||||||
formDetails: any;
|
formDetails: any;
|
||||||
@ -44,6 +47,8 @@ export class PdQuestionStockInfoPage {
|
|||||||
suppliers_wholesale_trade_details: any = [];
|
suppliers_wholesale_trade_details: any = [];
|
||||||
suppliers_finished_goods: any = [];
|
suppliers_finished_goods: any = [];
|
||||||
|
|
||||||
|
protected _onDestroy = new Subject<void>();
|
||||||
|
|
||||||
RMCommentCard: boolean = false;
|
RMCommentCard: boolean = false;
|
||||||
TGCommentCard: boolean = false
|
TGCommentCard: boolean = false
|
||||||
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
|
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
|
||||||
@ -101,6 +106,14 @@ export class PdQuestionStockInfoPage {
|
|||||||
this.qustCat.retiverForm(params).subscribe(value => {
|
this.qustCat.retiverForm(params).subscribe(value => {
|
||||||
if (value['status'] == 200) {
|
if (value['status'] == 200) {
|
||||||
let dataForm = value['records'];
|
let dataForm = value['records'];
|
||||||
|
// dataForm.manufacturing_details.forEach(top=>{
|
||||||
|
// top.manufacturing_finished_goods.forEach(below1=>{
|
||||||
|
// below1.uomSearch=''
|
||||||
|
// })
|
||||||
|
// top.manufacturing_raw_materials.forEach(below2=>{
|
||||||
|
// below2.uomSearch=''
|
||||||
|
// })
|
||||||
|
// })
|
||||||
if (dataForm !== undefined) {
|
if (dataForm !== undefined) {
|
||||||
this.stockForm = this.fb.group({
|
this.stockForm = this.fb.group({
|
||||||
pdid: [this.pdid],
|
pdid: [this.pdid],
|
||||||
@ -283,6 +296,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
this.qustCat.getcommondrop('UOM').subscribe(data => {
|
this.qustCat.getcommondrop('UOM').subscribe(data => {
|
||||||
if (data['dataStatus'] == true) {
|
if (data['dataStatus'] == true) {
|
||||||
this.uomData = data['records'].filter(uom => uom.isactive == 1 && uom.is_land_uom == 0 || uom.is_land_uom == 2);
|
this.uomData = data['records'].filter(uom => uom.isactive == 1 && uom.is_land_uom == 0 || uom.is_land_uom == 2);
|
||||||
|
this.uomDataValue=this.uomData.slice();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -438,6 +452,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
stock_observed: [''],
|
stock_observed: [''],
|
||||||
raw_quantity: [''],
|
raw_quantity: [''],
|
||||||
raw_uom: [''],
|
raw_uom: [''],
|
||||||
|
uomSearch:[null],
|
||||||
other_uom: [''],
|
other_uom: [''],
|
||||||
raw_value: [''],
|
raw_value: [''],
|
||||||
is_sufficiant_raw: [''],
|
is_sufficiant_raw: [''],
|
||||||
@ -449,6 +464,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
stock_observed: [records.stock_observed],
|
stock_observed: [records.stock_observed],
|
||||||
raw_quantity: [records.raw_quantity],
|
raw_quantity: [records.raw_quantity],
|
||||||
raw_uom: [records.raw_uom],
|
raw_uom: [records.raw_uom],
|
||||||
|
uomSearch:[null],
|
||||||
other_uom: [records.other_uom],
|
other_uom: [records.other_uom],
|
||||||
raw_value: [records.raw_value],
|
raw_value: [records.raw_value],
|
||||||
is_sufficiant_raw: [records.is_sufficiant_raw],
|
is_sufficiant_raw: [records.is_sufficiant_raw],
|
||||||
@ -504,6 +520,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
goods_observed: [''],
|
goods_observed: [''],
|
||||||
goods_quantity: [''],
|
goods_quantity: [''],
|
||||||
goods_uom: [''],
|
goods_uom: [''],
|
||||||
|
uomSearch:[null],
|
||||||
goods_other_uom: [''],
|
goods_other_uom: [''],
|
||||||
goods_value: [''],
|
goods_value: [''],
|
||||||
is_sufficiant_goods: [''],
|
is_sufficiant_goods: [''],
|
||||||
@ -516,6 +533,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
goods_observed: [records.goods_observed],
|
goods_observed: [records.goods_observed],
|
||||||
goods_quantity: [records.goods_quantity],
|
goods_quantity: [records.goods_quantity],
|
||||||
goods_uom: [records.goods_uom],
|
goods_uom: [records.goods_uom],
|
||||||
|
uomSearch:[null],
|
||||||
goods_other_uom: [records.goods_other_uom],
|
goods_other_uom: [records.goods_other_uom],
|
||||||
goods_value: [records.goods_value],
|
goods_value: [records.goods_value],
|
||||||
is_sufficiant_goods: [records.is_sufficiant_goods],
|
is_sufficiant_goods: [records.is_sufficiant_goods],
|
||||||
@ -570,6 +588,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
traded_goods_observed: [''],
|
traded_goods_observed: [''],
|
||||||
traded_goods_quantity: [''],
|
traded_goods_quantity: [''],
|
||||||
traded_goods_uom: [''],
|
traded_goods_uom: [''],
|
||||||
|
uomSearch:[null],
|
||||||
traded_goods_other_uom: [''],
|
traded_goods_other_uom: [''],
|
||||||
estimated_traded_goods_value: [''],
|
estimated_traded_goods_value: [''],
|
||||||
is_sufficiant_traded_goods: [''],
|
is_sufficiant_traded_goods: [''],
|
||||||
@ -582,6 +601,7 @@ export class PdQuestionStockInfoPage {
|
|||||||
traded_goods_observed: [records.traded_goods_observed],
|
traded_goods_observed: [records.traded_goods_observed],
|
||||||
traded_goods_quantity: [records.traded_goods_quantity],
|
traded_goods_quantity: [records.traded_goods_quantity],
|
||||||
traded_goods_uom: [records.traded_goods_uom],
|
traded_goods_uom: [records.traded_goods_uom],
|
||||||
|
uomSearch:[null],
|
||||||
traded_goods_other_uom: [records.traded_goods_other_uom],
|
traded_goods_other_uom: [records.traded_goods_other_uom],
|
||||||
estimated_traded_goods_value: [records.estimated_traded_goods_value],
|
estimated_traded_goods_value: [records.estimated_traded_goods_value],
|
||||||
is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods],
|
is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods],
|
||||||
@ -785,5 +805,13 @@ export class PdQuestionStockInfoPage {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
searchFun(control,index){
|
||||||
|
console.log("control",control.controls['uomSearch'].value)
|
||||||
|
control.controls['uomSearch'].valueChanges
|
||||||
|
.pipe(takeUntil(this._onDestroy))
|
||||||
|
.subscribe(()=>{
|
||||||
|
this.uomDataValue=this.constant.searchData(this.uomData,control.controls['uomSearch'].value,'')
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,8 +44,15 @@
|
|||||||
|
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select placeholder="Lender" formControlName="lender">
|
<mat-select placeholder="Lender" formControlName="lender">
|
||||||
|
<mat-option>
|
||||||
|
<ngx-mat-select-search formControlName="bankSearch"
|
||||||
|
[placeholderLabel]="'Search Unit'"
|
||||||
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(details)">
|
||||||
|
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||||
|
</ngx-mat-select-search>
|
||||||
|
</mat-option>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{btLen.lender_name}}</mat-option>
|
<mat-option *ngFor="let btLen of lenderDataValue" [value]="btLen.bt_lender_list_id">{{btLen.lender_name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="details.get('lender').value == 3 ">
|
<mat-form-field *ngIf="details.get('lender').value == 3 ">
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { QuestionCategoryProvider } from '../../../providers/question-category/q
|
|||||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||||
import { ToastProvider } from '../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
import {ConstantsProvider} from '../../../providers/constants/constants'
|
import {ConstantsProvider} from '../../../providers/constants/constants'
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionCurrentLoansPage page.
|
* Generated class for the PdQuestionCurrentLoansPage page.
|
||||||
*
|
*
|
||||||
@ -41,6 +43,8 @@ applicants: any;
|
|||||||
propertyTypeData: any;
|
propertyTypeData: any;
|
||||||
tentureErrorFlag:boolean=false
|
tentureErrorFlag:boolean=false
|
||||||
@ViewChild('balanceTenure') TenureFocus : ElementRef
|
@ViewChild('balanceTenure') TenureFocus : ElementRef
|
||||||
|
lenderDataValue: any;
|
||||||
|
protected _onDestroy = new Subject<void>();
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider, public aws:AwsServiceProvider,public constant:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider, public aws:AwsServiceProvider,public constant:ConstantsProvider) {
|
||||||
|
|
||||||
@ -78,6 +82,7 @@ applicants: any;
|
|||||||
this.qustCat.getcommondrop('BTLENDERLIST').subscribe(res=>
|
this.qustCat.getcommondrop('BTLENDERLIST').subscribe(res=>
|
||||||
{
|
{
|
||||||
this.lenderData = res['records'].filter(len=>len.isactive==1);
|
this.lenderData = res['records'].filter(len=>len.isactive==1);
|
||||||
|
this.lenderDataValue=this.lenderData.slice();
|
||||||
});
|
});
|
||||||
this.qustCat.getcommondrop('FREQUENCY').subscribe(res=>
|
this.qustCat.getcommondrop('FREQUENCY').subscribe(res=>
|
||||||
{
|
{
|
||||||
@ -149,6 +154,7 @@ applicants: any;
|
|||||||
loan_taken_by: data == null ? [''] : [data.loan_taken_by],
|
loan_taken_by: data == null ? [''] : [data.loan_taken_by],
|
||||||
others_loan_taken: data == null ? [''] : [data.others_loan_taken],
|
others_loan_taken: data == null ? [''] : [data.others_loan_taken],
|
||||||
lender: data == null ? [''] : [data.lender],
|
lender: data == null ? [''] : [data.lender],
|
||||||
|
bankSearch:[''],
|
||||||
others_lender: data == null ? [''] : [data.others_lender],
|
others_lender: data == null ? [''] : [data.others_lender],
|
||||||
original_tenure: data == null ? [''] : [data.original_tenure],
|
original_tenure: data == null ? [''] : [data.original_tenure],
|
||||||
current_balance_tenure: data == null ? [''] : [data.current_balance_tenure],
|
current_balance_tenure: data == null ? [''] : [data.current_balance_tenure],
|
||||||
@ -313,6 +319,9 @@ submitCurrentloan(answerData) {
|
|||||||
records.existing_loan = answerData.existing_loan;
|
records.existing_loan = answerData.existing_loan;
|
||||||
records.loan_details = answerData.loan_details;
|
records.loan_details = answerData.loan_details;
|
||||||
records.currentloan_remarks = answerData.currentloan_remarks;
|
records.currentloan_remarks = answerData.currentloan_remarks;
|
||||||
|
records.loan_details.forEach(val=>{
|
||||||
|
delete val.bankSearch
|
||||||
|
})
|
||||||
console.log(' final records when save',records);
|
console.log(' final records when save',records);
|
||||||
this.qustCat.saveForm(records).subscribe(data => {
|
this.qustCat.saveForm(records).subscribe(data => {
|
||||||
|
|
||||||
@ -336,12 +345,15 @@ submitCurrentloan(answerData) {
|
|||||||
let currentLoanDetails = res['records'];
|
let currentLoanDetails = res['records'];
|
||||||
|
|
||||||
if(res['records'].loan_details !== undefined && res['records'].loan_details !=null && res['records'].loan_details !=''){
|
if(res['records'].loan_details !== undefined && res['records'].loan_details !=null && res['records'].loan_details !=''){
|
||||||
|
currentLoanDetails.loan_details.forEach(val=>{
|
||||||
|
val.bankSearch=''
|
||||||
|
})
|
||||||
var result = Object.keys(res['records'].loan_details).map(function(key) {
|
var result = Object.keys(res['records'].loan_details).map(function(key) {
|
||||||
|
|
||||||
return res['records'].loan_details[key];
|
return res['records'].loan_details[key];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
console.log("resutl",result);
|
||||||
this.currentLoans.controls['existing_loan'].setValue(currentLoanDetails.existing_loan);
|
this.currentLoans.controls['existing_loan'].setValue(currentLoanDetails.existing_loan);
|
||||||
this.currentLoans.controls['currentloan_remarks'].setValue(currentLoanDetails.currentloan_remarks);
|
this.currentLoans.controls['currentloan_remarks'].setValue(currentLoanDetails.currentloan_remarks);
|
||||||
const control = <FormArray>this.currentLoans.controls['loan_details'];
|
const control = <FormArray>this.currentLoans.controls['loan_details'];
|
||||||
@ -602,4 +614,14 @@ submitCurrentloan(answerData) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
searchFun(control){
|
||||||
|
console.log(control)
|
||||||
|
let name:string="bank"
|
||||||
|
control.controls['bankSearch'].valueChanges
|
||||||
|
.pipe(takeUntil(this._onDestroy))
|
||||||
|
.subscribe(()=>{
|
||||||
|
this.lenderDataValue=this.constant.searchData(this.lenderData,control.controls['bankSearch'].value,name)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,13 +31,13 @@
|
|||||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||||
<mat-form-field style="width: 45%">
|
<mat-form-field style="width: 45%">
|
||||||
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year"
|
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year"
|
||||||
min='0'>
|
min='0' #yearFocus>
|
||||||
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higer then business vintage</mat-error>
|
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higher than business vintage</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width: 45%">
|
<mat-form-field style="width: 45%">
|
||||||
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
||||||
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higer then business vintage</mat-error>
|
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higher than business vintage</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -171,7 +171,7 @@
|
|||||||
<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="Amount paid in Cash" formControlName="amount_paid_in_cash"
|
<input matInput placeholder="Amount paid in Cash" formControlName="amount_paid_in_cash"
|
||||||
type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)" (change)="ValidateNetSalary()">
|
type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)" (change)="ValidateNetSalary()" #cashPaidFocus>
|
||||||
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"₹"}}
|
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"₹"}}
|
||||||
{{cashAmtInWords}} Only</mat-hint>
|
{{cashAmtInWords}} Only</mat-hint>
|
||||||
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
|
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { QuestionCategoryProvider } from '../../../providers/question-category/q
|
|||||||
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
|
||||||
import { ToastProvider } from '../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
import { ConstantsProvider } from '../../../providers/constants/constants';
|
import { ConstantsProvider } from '../../../providers/constants/constants';
|
||||||
|
import { max } from 'rxjs/operators';
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionEmpInfoPage page.
|
* Generated class for the PdQuestionEmpInfoPage page.
|
||||||
*
|
*
|
||||||
@ -48,7 +49,8 @@ export class PdQuestionEmpInfoPage {
|
|||||||
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
|
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
|
||||||
public todate: any[] = this.dateonly;
|
public todate: any[] = this.dateonly;
|
||||||
@ViewChild('workExp') expFocus: ElementRef
|
@ViewChild('workExp') expFocus: ElementRef
|
||||||
|
@ViewChild('cashPaidFocus') inputCashPaidFocus :ElementRef
|
||||||
|
@ViewChild('yearFocus') inputYearFocus :ElementRef
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, public toast: ToastProvider,public constant:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, public toast: ToastProvider,public constant:ConstantsProvider) {
|
||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
this.questionDetails = this.navParams.get('questionDetails');
|
this.questionDetails = this.navParams.get('questionDetails');
|
||||||
@ -183,15 +185,30 @@ export class PdQuestionEmpInfoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveEmpInfo(){
|
saveEmpInfo(){
|
||||||
|
// console.log("has Error",this.employmentForm.controls['how_long_year'].hasError('max'))
|
||||||
|
if(this.employmentForm.controls['how_long_year'].hasError('max') || this.employmentForm.controls['how_long_month'].hasError('max')){
|
||||||
|
this.toast.pdTriggerappmessage("Higher than business Vintage")
|
||||||
|
this.inputYearFocus.nativeElement.focus();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.employmentForm.controls['total_business_experience'].hasError('min') ){
|
||||||
|
this.toast.pdTriggerappmessage('Total working Experience is Lower');
|
||||||
|
this.expFocus.nativeElement.focus();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// console.log("this.em",this.employmentForm.controls['amount_paid_in_cash'].errors)
|
||||||
|
if(this.employmentForm.controls['amount_paid_in_cash'].hasError('max') || this.employmentForm.controls['amount_paid_through_bank'].hasError('max')){
|
||||||
|
this.toast.pdTriggerappmessage("Given Value is Maximum of Net Salary")
|
||||||
|
this.inputCashPaidFocus.nativeElement.focus();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.employmentForm.valid) {
|
if (!this.employmentForm.valid) {
|
||||||
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
|
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.workExperienceErrorFlag == true){
|
|
||||||
this.toast.pdTriggerappmessage('Total working Experience is Lower');
|
|
||||||
this.expFocus.nativeElement.focus();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let records: any = {};
|
let records: any = {};
|
||||||
records.pdid = this.pdDetails.pd_id;
|
records.pdid = this.pdDetails.pd_id;
|
||||||
|
|||||||
@ -940,8 +940,14 @@ searchFun(control:any,i:number,option){
|
|||||||
// )
|
// )
|
||||||
}
|
}
|
||||||
searchRelation(val:any){
|
searchRelation(val:any){
|
||||||
val=val.controls['relationSearch'].value
|
// val=val.controls['relationSearch'].value
|
||||||
console.log("val",val);
|
console.log("val",val);
|
||||||
this.relationDataValue=this.cons.searchData(this.relationData,val)
|
val.controls['relationSearch'].valueChanges
|
||||||
|
.pipe(takeUntil(this._onDestroy))
|
||||||
|
.subscribe(()=>{
|
||||||
|
this.relationDataValue=this.cons.searchData(this.relationData,val.controls['relationSearch'].value,'')
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@
|
|||||||
|
|
||||||
<br />
|
<br />
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Business Entity Type" formControlName="business_entity_type" required>
|
<mat-select #focusBusiness placeholder="Business Entity Type" formControlName="business_entity_type" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let business of businessEntityTypeList" [value]="business.business_entity_type_id">
|
<mat-option *ngFor="let business of businessEntityTypeList" [value]="business.business_entity_type_id">
|
||||||
{{business.business_entity_type_name}}
|
{{business.business_entity_type_name}}
|
||||||
@ -291,7 +291,7 @@
|
|||||||
<mat-option value="0"> Not Applicable </mat-option>
|
<mat-option value="0"> Not Applicable </mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%" *ngIf="relation.controls['relationship'].value != 0">
|
||||||
<mat-select placeholder="RelationTo" formControlName="relation_to">
|
<mat-select placeholder="RelationTo" formControlName="relation_to">
|
||||||
|
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
@ -330,7 +330,7 @@
|
|||||||
<mat-option value="0"> Not Applicable </mat-option>
|
<mat-option value="0"> Not Applicable </mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%" *ngIf="cmprel.controls['company_relationship'].value != ''">
|
||||||
<mat-select formControlName="relation_to_company" placeholder="Relation to">
|
<mat-select formControlName="relation_to_company" placeholder="Relation to">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let comp of companyList" [value]="comp.company_order_id">{{comp.company_name |
|
<mat-option *ngFor="let comp of companyList" [value]="comp.company_order_id">{{comp.company_name |
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { DatePipe} from '@angular/common';
|
|||||||
import {PdPipe} from './../../../pipes/pd/pd';
|
import {PdPipe} from './../../../pipes/pd/pd';
|
||||||
import { removeSummaryDuplicates } from '@angular/compiler';
|
import { removeSummaryDuplicates } from '@angular/compiler';
|
||||||
import { DataSource } from '@angular/cdk/table';
|
import { DataSource } from '@angular/cdk/table';
|
||||||
|
//import {} from 'moment'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionGeneralInfoPage page.
|
* Generated class for the PdQuestionGeneralInfoPage page.
|
||||||
@ -69,6 +70,7 @@ export class PdQuestionGeneralInfoPage {
|
|||||||
public addIndi:boolean
|
public addIndi:boolean
|
||||||
updateIndex_comp: any;
|
updateIndex_comp: any;
|
||||||
@ViewChild('remark') nameField: ElementRef;
|
@ViewChild('remark') nameField: ElementRef;
|
||||||
|
@ViewChild('focusBusiness') focus_business_entity : ElementRef
|
||||||
customer_segment_abbr: any;
|
customer_segment_abbr: any;
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public modal:ModalController) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public fb:FormBuilder,public modal:ModalController) {
|
||||||
@ -867,18 +869,50 @@ getDateObjects(values: any, controlIndex) {
|
|||||||
control.controls['business_month']=''
|
control.controls['business_month']=''
|
||||||
control = control.controls[controlIndex];
|
control = control.controls[controlIndex];
|
||||||
let pd_initiation_date:string = this.pdDetails.pd_date_of_initiation.split('/').reverse().join("/");
|
let pd_initiation_date:string = this.pdDetails.pd_date_of_initiation.split('/').reverse().join("/");
|
||||||
|
let date=new Date()
|
||||||
|
|
||||||
|
let curr_date=date.getFullYear()+'/'+('0'+(date.getMonth()+1))+'/'+('0'+date.getDate())
|
||||||
|
console.log("current date",curr_date);
|
||||||
let selected_date = this.pipe.transform(values, 'yyyy/MM/dd'); ;
|
let selected_date = this.pipe.transform(values, 'yyyy/MM/dd'); ;
|
||||||
let diffInMs: number = Date.parse(pd_initiation_date) - Date.parse(selected_date);
|
console.log("pd date",pd_initiation_date);
|
||||||
let diff: number = Math.floor(diffInMs / 1000);
|
console.log("selected date",selected_date)
|
||||||
diff /= (60 * 60 * 24 * 30);
|
/*WORKING STATEMENT*/
|
||||||
diff=Math.abs(Math.round(diff));
|
let months = date.getMonth() - values.getMonth() + (12 * (date.getFullYear() - values.getFullYear()));
|
||||||
control.controls['business_years'].setValue(0);
|
|
||||||
control.controls['business_month'].setValue(0);
|
if (months >= 12) {
|
||||||
|
console.log('years:', (months - (months %12))/12 );
|
||||||
|
console.log("moth",months%12);
|
||||||
|
} else {
|
||||||
|
console.log('only months',months);
|
||||||
|
}
|
||||||
|
control.controls['business_years'].setValue((months - (months %12))/12);
|
||||||
|
control.controls['business_month'].setValue(months%12);
|
||||||
|
/*END OF WORKING STATEMENT*/
|
||||||
|
//let diffInMs: number = Date.parse(pd_initiation_date) - Date.parse(selected_date);
|
||||||
|
// function monthDiff(d1, d2) {
|
||||||
|
// var months;
|
||||||
|
// months = (d2.getFullYear() - d1.getFullYear()) * 12;
|
||||||
|
// months -= d1.getMonth() + 1;
|
||||||
|
// months += d2.getMonth();
|
||||||
|
// return months <= 0 ? 0 : months;
|
||||||
|
|
||||||
|
// }
|
||||||
|
// console.log("new",monthDiff( new Date(2008, 10, 4), new Date(2010, 2, 12) )) // March 12th, 2010);
|
||||||
|
//var start_date=moment(start_date)
|
||||||
|
/* old working statement*/
|
||||||
|
// let diffInMs: number = Date.parse(selected_date) - Date.parse(curr_date);
|
||||||
|
// let diff: number = Math.floor(diffInMs / 1000);
|
||||||
|
// console.log("diff",diff)
|
||||||
|
// diff /= (60 * 60 * 24 * 30);
|
||||||
|
// console.log("diff /",diff)
|
||||||
|
// diff=Math.abs(Math.round(diff));
|
||||||
|
// control.controls['business_years'].setValue(0);
|
||||||
|
// control.controls['business_month'].setValue(0);
|
||||||
|
|
||||||
if(diff){
|
// if(diff){
|
||||||
control.controls['business_years'].setValue(Math.floor(diff / 12));
|
// control.controls['business_years'].setValue(Math.floor(diff / 12));
|
||||||
control.controls['business_month'].setValue(Math.floor(diff % 12));
|
// control.controls['business_month'].setValue(Math.floor(diff % 12));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
temp: number = 0;
|
temp: number = 0;
|
||||||
@ -905,7 +939,14 @@ console.log('1)',this.temp);
|
|||||||
var existData=Object.keys(answerData.company_value).map(function(key){
|
var existData=Object.keys(answerData.company_value).map(function(key){
|
||||||
return answerData.company_value[key]
|
return answerData.company_value[key]
|
||||||
})
|
})
|
||||||
existData.forEach((element)=>{
|
existData.forEach((element,index)=>{
|
||||||
|
console.log("company value",element)
|
||||||
|
if(element.business_entity_type==''){
|
||||||
|
this.toast.pdTriggerappmessage("Please choose business entity type for the company");
|
||||||
|
this.editCompanies(index);
|
||||||
|
this.focus_business_entity.nativeElement.focus();
|
||||||
|
return
|
||||||
|
}
|
||||||
valuesData.push(element)
|
valuesData.push(element)
|
||||||
})
|
})
|
||||||
if(this.OldData.length>0){
|
if(this.OldData.length>0){
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export class PdQuestionLoansPage {
|
|||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.applicants = this.pdDetails.applicat_details
|
this.applicants = this.pdDetails.applicat_details
|
||||||
this.applicants = this.applicants.filter(appt => appt.applicant_type != 2);
|
this.applicants = this.applicants/*.filter(appt => appt.applicant_type != 2);*/
|
||||||
this.productAbbr = this.pdDetails.product_abbr;
|
this.productAbbr = this.pdDetails.product_abbr;
|
||||||
this.subProductName = this.pdDetails.subproduct_name;
|
this.subProductName = this.pdDetails.subproduct_name;
|
||||||
this.users = this.aws.getlocale();
|
this.users = this.aws.getlocale();
|
||||||
@ -351,7 +351,7 @@ export class PdQuestionLoansPage {
|
|||||||
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
|
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
|
||||||
let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0];
|
let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0];
|
||||||
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
|
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
|
||||||
if(property_name=='others(pleasespecify)')
|
if(property_name=='others(pleasespecify)' || property_name=='others')
|
||||||
{
|
{
|
||||||
this.mortageAccess = true;
|
this.mortageAccess = true;
|
||||||
}else
|
}else
|
||||||
|
|||||||
@ -98,12 +98,13 @@
|
|||||||
<mat-card *ngIf="neighbourhoodForm.controls.check_type.value==0">
|
<mat-card *ngIf="neighbourhoodForm.controls.check_type.value==0">
|
||||||
<div>
|
<div>
|
||||||
<mat-form-field >
|
<mat-form-field >
|
||||||
<mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status">
|
<mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status" required>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="Positive">Positive</mat-option>
|
<mat-option value="Positive">Positive</mat-option>
|
||||||
<mat-option value="Negative">Negative</mat-option>
|
<mat-option value="Negative">Negative</mat-option>
|
||||||
<mat-option value="Could not verify" >Could not verify</mat-option>
|
<mat-option value="Could not verify" >Could not verify</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="neighbourhoodForm.controls['neighbourhood_status'].errors?.required || neighbourhoodForm.controls['neighbourhood_status'].touched ">Status is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
@ -198,7 +199,8 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<textarea matInput type="text" placeholder="Remarks" name="neighbour_reference_remark" formControlName="neighbour_reference_remark"></textarea>
|
<textarea matInput type="text" placeholder="Remarks" name="neighbour_reference_remark" formControlName="neighbour_reference_remark" required></textarea>
|
||||||
|
<mat-error align="end" style="font-size:13px" *ngIf="neighbourhoodForm.controls['neighbour_reference_remark'].errors?.required">Remarks is Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
|
|||||||
@ -271,17 +271,24 @@ ChdCtrls.controls.other_organisation_owner.updateValueAndValidity();
|
|||||||
|
|
||||||
const neighbourhoodControl : FormGroup = this.neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
|
const neighbourhoodControl : FormGroup = this.neighbourhoodForm.controls['neighbourhood_list'] as FormGroup;
|
||||||
let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
|
let NbhdCtrlLength: any = neighbourhoodControl.controls.length;
|
||||||
|
// this.neighbourhoodForm.controls['neighbourhood_status'].setValidators([Validators.required]);
|
||||||
|
// this.neighbourhoodForm.controls['neighbourhood_status'].updateValueAndValidity();
|
||||||
|
|
||||||
|
// this.neighbourhoodForm.controls['neighbour_reference_remark'].setValidators([Validators.required])
|
||||||
|
// this.neighbourhoodForm.controls['neighbour_reference_remark'].updateValueAndValidity();
|
||||||
if (NbhdCtrlLength > 0) {
|
if (NbhdCtrlLength > 0) {
|
||||||
let Ncnt = 0;
|
let Ncnt = 0;
|
||||||
while(Ncnt < NbhdCtrlLength){
|
while(Ncnt < NbhdCtrlLength){
|
||||||
|
|
||||||
let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
|
let nbhdChildCtrl : any = neighbourhoodControl.controls[Ncnt];
|
||||||
|
|
||||||
nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
|
// nbhdChildCtrl.controls['neighbourhood_name'].setValidators([Validators.required]);
|
||||||
nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
|
// nbhdChildCtrl.controls['neighbourhood_name'].updateValueAndValidity();
|
||||||
|
|
||||||
|
// nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
|
||||||
|
// nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
|
||||||
|
|
||||||
|
|
||||||
nbhdChildCtrl.controls['do_know'].setValidators([Validators.required]);
|
|
||||||
nbhdChildCtrl.controls['do_know'].updateValueAndValidity();
|
|
||||||
if(nbhdChildCtrl.controls.do_know.value != ''){
|
if(nbhdChildCtrl.controls.do_know.value != ''){
|
||||||
// console.log('nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
|
// console.log('nbhdChildCtrl.controls.did_not_know_the_business_operation.value',nbhdChildCtrl.controls.did_not_know_the_business_operation.value)
|
||||||
if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
|
if(nbhdChildCtrl.controls.did_not_know_the_business_operation.value == '' || nbhdChildCtrl.controls.did_not_know_the_business_operation.value == false){
|
||||||
|
|||||||
@ -48,8 +48,9 @@
|
|||||||
<mat-label>Address</mat-label>
|
<mat-label>Address</mat-label>
|
||||||
<input matInput placeholder="Rental Info Details" formControlName="address" autocomplete="off">
|
<input matInput placeholder="Rental Info Details" formControlName="address" autocomplete="off">
|
||||||
<!-- <mat-hint align="end"><i (click)="Toview()">Rental Info Details</i></mat-hint> -->
|
<!-- <mat-hint align="end"><i (click)="Toview()">Rental Info Details</i></mat-hint> -->
|
||||||
<mat-hint align="end"><strong (click)="Toview()">Validate Rental Income</strong></mat-hint>
|
<!-- <mat-hint align="end"><strong (click)="Toview()">Validate Rental Income</strong></mat-hint> -->
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<button float-right ion-button small color="optblue" (click)="Toview()">Rental Info Details</button>
|
||||||
<mat-form-field style="width: 100%;"*ngIf="details.get('source').value == '1'">
|
<mat-form-field style="width: 100%;"*ngIf="details.get('source').value == '1'">
|
||||||
<input matInput placeholder="Specify Others Source"
|
<input matInput placeholder="Specify Others Source"
|
||||||
formControlName="others_source">
|
formControlName="others_source">
|
||||||
|
|||||||
@ -226,7 +226,7 @@ inWords(val,i){
|
|||||||
}
|
}
|
||||||
|
|
||||||
Toview(){
|
Toview(){
|
||||||
alert('Rental Income Details - Is inprogress');
|
// alert('Rental Income Details - Is inprogress');
|
||||||
|
|
||||||
// here Hardcoded;
|
// here Hardcoded;
|
||||||
let RIFormDtls = {'form_id':17,'form_name':'Rental Verification'};
|
let RIFormDtls = {'form_id':17,'form_name':'Rental Verification'};
|
||||||
|
|||||||
@ -262,8 +262,8 @@
|
|||||||
<div fxLayout="row wrap" class="align-margin" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
|
<div fxLayout="row wrap" class="align-margin" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
|
||||||
<mat-form-field style="width:100%;">
|
<mat-form-field style="width:100%;">
|
||||||
<mat-label>Rent per Unit</mat-label>
|
<mat-label>Rent per Unit</mat-label>
|
||||||
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);" required>
|
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);inWords($event.target.value,fu,1)" required>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{rent_per_unit_Inwords[f]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{rent_per_unit_Inwords[fu]}} Only</mat-hint>
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%;">
|
<mat-form-field style="width:100%;">
|
||||||
@ -281,8 +281,8 @@
|
|||||||
<div class="rent-unit" fxFlex.xs="100" fxFlex.sm="45" fxFlex.md="45" fxFlex.lg="45" fxFlex.xl="45" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
|
<div class="rent-unit" fxFlex.xs="100" fxFlex.sm="45" fxFlex.md="45" fxFlex.lg="45" fxFlex.xl="45" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
|
||||||
<mat-form-field style="width:100%" appearance="outline">
|
<mat-form-field style="width:100%" appearance="outline">
|
||||||
<mat-label>Rent Unit {{fu+1}} </mat-label>
|
<mat-label>Rent Unit {{fu+1}} </mat-label>
|
||||||
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);" required>
|
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);inWords($event.target.value,fu,3)" required>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{rent_per_unit_2_Inwords[f]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{rent_per_unit_2_Inwords[fu]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -350,20 +350,26 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank']" (keyup)="inWords($event.target.value,u,7)">
|
||||||
|
<mat-label>Amount Received in Bank</mat-label>
|
||||||
|
<input matInput autocomplete="off" placeholder="" formControlName="amount_received_bank" type="number"
|
||||||
|
required (keyup)="ValidatedRentAmount(units.value,u,1)">
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_bank'].hasError('max')">Given Value Is More Than Rent Amount</mat-error>
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_bank'].hasError('min')">Given Value Is Less Than Rent Amount</mat-error>
|
||||||
|
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank != ''">{{"₹"}} {{amount_received_bank_Inwords[u]}} Only</mat-hint>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash']">
|
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash']">
|
||||||
<mat-label>Amount Received in Cash</mat-label>
|
<mat-label>Amount Received in Cash</mat-label>
|
||||||
<input matInput autocomplete="off" placeholder="" formControlName="amount_received_cash"
|
<input matInput autocomplete="off" placeholder="" formControlName="amount_received_cash"
|
||||||
required (keyup)="inWords($event.target.value,u,6)" type="number">
|
required (keyup)="inWords($event.target.value,u,6)" type="number" >
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_cash'].hasError('max')">Given Value Is More Than Rent Amount</mat-error>
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_cash'].hasError('min')">Given Value Is Less Than Rent Amount</mat-error>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash != ''">{{"₹"}} {{amount_received_cash_Inwords[u]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash != ''">{{"₹"}} {{amount_received_cash_Inwords[u]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank']" (keyup)="inWords($event.target.value,u,7)">
|
|
||||||
<mat-label>Amount Received in Bank</mat-label>
|
|
||||||
<input matInput autocomplete="off" placeholder="" formControlName="amount_received_bank" type="number"
|
|
||||||
required>
|
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank != ''">{{"₹"}} {{amount_received_bank_Inwords[u]}} Only</mat-hint>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason']">
|
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason']">
|
||||||
<mat-label>Reason for Receiving Multiple Payment Mode</mat-label>
|
<mat-label>Reason for Receiving Multiple Payment Mode</mat-label>
|
||||||
<textarea matInput placeholder="" formControlName="payment_received_reason" required></textarea>
|
<textarea matInput placeholder="" formControlName="payment_received_reason" required></textarea>
|
||||||
@ -618,19 +624,26 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank_per_met']" (keyup)="inWords($event.target.value,u,13)">
|
||||||
|
<mat-label>Amount Paid in Bank</mat-label>
|
||||||
|
<input matInput type="number" autocomplete="off" placeholder="" formControlName="amount_received_bank_per_met"
|
||||||
|
required (keyup)="ValidatedRentAmount(units.value,u,2)">
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_bank_per_met'].hasError('max')">Given Value Is More Than Rent Amount</mat-error>
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_bank_per_met'].hasError('min')">Given Value Is Less Than Rent Amount</mat-error>
|
||||||
|
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank_per_met != ''">{{"₹"}} {{amount_received_bank_per_met_Inwords[u]}} Only</mat-hint>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash_per_met']">
|
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash_per_met']">
|
||||||
<mat-label>Amount Paid in Cash</mat-label>
|
<mat-label>Amount Paid in Cash</mat-label>
|
||||||
<input matInput type="number" autocomplete="off" placeholder="" formControlName="amount_received_cash_per_met"
|
<input matInput type="number" autocomplete="off" placeholder="" formControlName="amount_received_cash_per_met"
|
||||||
required (keyup)="inWords($event.target.value,u,12)">
|
required (keyup)="inWords($event.target.value,u,12)">
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_cash_per_met'].hasError('max')">Given Value Is More Than Rent Amount</mat-error>
|
||||||
|
<mat-error *ngIf="units.controls['amount_received_cash_per_met'].hasError('min')">Given Value Is Less Than Rent Amount</mat-error>
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash_per_met != ''">{{"₹"}} {{amount_received_cash_per_met_Inwords[u]}} Only</mat-hint>
|
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash_per_met != ''">{{"₹"}} {{amount_received_cash_per_met_Inwords[u]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank_per_met']">
|
|
||||||
<mat-label>Amount Paid in Bank</mat-label>
|
|
||||||
<input matInput type="number" autocomplete="off" placeholder="" formControlName="amount_received_bank_per_met"
|
|
||||||
required (keyup)="inWords($event.target.value,u,13)">
|
|
||||||
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank_per_met != ''">{{"₹"}} {{amount_received_bank_per_met_Inwords[u]}} Only</mat-hint>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason_per_met']">
|
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason_per_met']">
|
||||||
<mat-label>Reason for Paid Multiple Payment Mode</mat-label>
|
<mat-label>Reason for Paid Multiple Payment Mode</mat-label>
|
||||||
<textarea matInput placeholder="" formControlName="payment_received_reason_per_met" required></textarea>
|
<textarea matInput placeholder="" formControlName="payment_received_reason_per_met" required></textarea>
|
||||||
@ -727,7 +740,7 @@
|
|||||||
|
|
||||||
<!-- <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)="saveRentalDetails(rentalForms.value)"> Save</button>
|
<button ion-button full color="optblue" (click)="saveAlert(rentalForms.value)"> Save</button>
|
||||||
<!-- </ion-buttons> -->
|
<!-- </ion-buttons> -->
|
||||||
|
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
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 { ToastProvider } from '../../../providers/common-provider/toast';
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
|
||||||
import { FormGroup, FormBuilder, FormArray, Validators, FormControl } from '@angular/forms';
|
import { FormGroup, FormBuilder, FormArray, Validators, FormControl } from '@angular/forms';
|
||||||
import {ConstantsProvider} from '../../../providers/constants/constants';
|
import {ConstantsProvider} from '../../../providers/constants/constants';
|
||||||
import {DatePipe} from '@angular/common'
|
import {DatePipe} from '@angular/common'
|
||||||
|
import { Message } from '@angular/compiler/src/i18n/i18n_ast';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the PdQuestionRentalInfoPage page.
|
* Generated class for the PdQuestionRentalInfoPage page.
|
||||||
@ -58,7 +59,7 @@ export class PdQuestionRentalInfoPage {
|
|||||||
amount_received_cash_per_met_Inwords: any=[];
|
amount_received_cash_per_met_Inwords: any=[];
|
||||||
amount_received_bank_per_met_Inwords: any=[];
|
amount_received_bank_per_met_Inwords: any=[];
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public constprovider:ConstantsProvider) {
|
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public constprovider:ConstantsProvider,public alertCtrl:AlertController) {
|
||||||
this.FormId = this.navParams.get('FormId');
|
this.FormId = this.navParams.get('FormId');
|
||||||
this.pdDetails = this.navParams.get('pdDetails');
|
this.pdDetails = this.navParams.get('pdDetails');
|
||||||
this.users = this.aws.getlocale();
|
this.users = this.aws.getlocale();
|
||||||
@ -360,9 +361,16 @@ addMoreUnitDetails(){
|
|||||||
control.controls[index].removeControl('amount_received_bank');
|
control.controls[index].removeControl('amount_received_bank');
|
||||||
control.controls[index].removeControl('payment_received_reason');
|
control.controls[index].removeControl('payment_received_reason');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(type==2){
|
else if(type==2){
|
||||||
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
|
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
|
||||||
|
console.log("controls",control.controls['index'])
|
||||||
|
if( control.controls[index].controls['payment_difference_per_met']){
|
||||||
|
console.log("pay");
|
||||||
|
control.controls[index].controls['payment_difference_per_met'].setValue('')
|
||||||
|
}
|
||||||
|
|
||||||
if(value && value.payment_mode_per_met.id==1){
|
if(value && value.payment_mode_per_met.id==1){
|
||||||
control.controls[index].addControl('amount_received_cash_per_met', new FormControl(value.amount_received_cash_per_met ? value.amount_received_cash_per_met : '', Validators.required));
|
control.controls[index].addControl('amount_received_cash_per_met', new FormControl(value.amount_received_cash_per_met ? value.amount_received_cash_per_met : '', Validators.required));
|
||||||
control.controls[index].removeControl('amount_received_bank_per_met');
|
control.controls[index].removeControl('amount_received_bank_per_met');
|
||||||
@ -385,6 +393,7 @@ addMoreUnitDetails(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tenant/lessees options
|
// tenant/lessees options
|
||||||
@ -613,6 +622,7 @@ validateAgreementAmt(actualRent:number,agreementRent:number){
|
|||||||
// generate tenant met details
|
// generate tenant met details
|
||||||
generateTenantMetDetails(value: any, index: number){
|
generateTenantMetDetails(value: any, index: number){
|
||||||
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
|
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
|
||||||
|
|
||||||
if(value.met_tenant_lessees_options=="1"){
|
if(value.met_tenant_lessees_options=="1"){
|
||||||
// remove reason
|
// remove reason
|
||||||
control.controls[index].removeControl('name_tenant_lessees_reason_per_met');
|
control.controls[index].removeControl('name_tenant_lessees_reason_per_met');
|
||||||
@ -623,6 +633,7 @@ generateTenantMetDetails(value: any, index: number){
|
|||||||
control.controls[index].addControl('period_of_stay_per_met', new FormControl('', Validators.required));
|
control.controls[index].addControl('period_of_stay_per_met', new FormControl('', Validators.required));
|
||||||
control.controls[index].addControl('payment_mode_per_met', new FormControl('', Validators.required));
|
control.controls[index].addControl('payment_mode_per_met', new FormControl('', Validators.required));
|
||||||
control.controls[index].addControl('payment_difference_per_met', new FormControl(''));
|
control.controls[index].addControl('payment_difference_per_met', new FormControl(''));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -786,9 +797,9 @@ calculateFloorRentAmt(values: any, index: number){
|
|||||||
unitcontrol= <FormArray> unitcontrol.controls['floor_unit_details'];
|
unitcontrol= <FormArray> unitcontrol.controls['floor_unit_details'];
|
||||||
if(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){
|
if(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){
|
||||||
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
|
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
|
||||||
// this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,2);
|
this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,2);
|
||||||
control.controls[index].controls['floor_rent_amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
|
control.controls[index].controls['floor_rent_amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor);
|
||||||
// this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,3);
|
this.inWords(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor,index,4);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue('');
|
unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue('');
|
||||||
@ -804,7 +815,7 @@ calculateFloorRentAmt(values: any, index: number){
|
|||||||
let getunitValues = unitcontrol.value.filter(val=>val.rent_per_unit!='');
|
let getunitValues = unitcontrol.value.filter(val=>val.rent_per_unit!='');
|
||||||
if(getunitValues.length>0){
|
if(getunitValues.length>0){
|
||||||
control.controls[index].controls['floor_rent_amount'].setValue(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val), 0));
|
control.controls[index].controls['floor_rent_amount'].setValue(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val), 0));
|
||||||
// this.inWords(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val)),index,3);
|
this.inWords(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val)),index,4);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
control.controls[index].controls['floor_rent_amount'].setValue('');
|
control.controls[index].controls['floor_rent_amount'].setValue('');
|
||||||
@ -872,6 +883,44 @@ compareSingleObjects(o1: any, o2: any) {
|
|||||||
// control.removeAt(i);
|
// control.removeAt(i);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
saveAlert(answerData){
|
||||||
|
let ApplicantRentAmt : any ;
|
||||||
|
let TenantRentAmt : any ;
|
||||||
|
let TempArray1 : any = [];
|
||||||
|
let TempArray2 : any = [];
|
||||||
|
|
||||||
|
if(answerData.property_unit_details.length > 0){
|
||||||
|
|
||||||
|
|
||||||
|
answerData.property_unit_details.forEach((data,index) => {
|
||||||
|
TempArray1[index] = data.monthly_rent_amount;
|
||||||
|
ApplicantRentAmt = TempArray1.reduce((sum, val) => sum + +val, 0);
|
||||||
|
TempArray2[index] = data.paid_monthly_rent_per_met;
|
||||||
|
TenantRentAmt = TempArray2.reduce((sum, val) => sum + +val, 0);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let alert=this.alertCtrl.create({
|
||||||
|
title:'Confirm The Rent Amount',
|
||||||
|
message:'Monthly Rent as Per Loan Applicant =' + ApplicantRentAmt+'<br>'+'Monthly Rent as Per Lease or Tenant Met = '+TenantRentAmt ,
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
text:'Cancel',
|
||||||
|
role:'cancel',
|
||||||
|
handler:()=>{
|
||||||
|
alert.dismiss
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text:'Confirm',
|
||||||
|
handler:()=>{
|
||||||
|
this.saveRentalDetails(answerData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
|
}
|
||||||
saveRentalDetails(answerData) {
|
saveRentalDetails(answerData) {
|
||||||
console.log('answerData',answerData);
|
console.log('answerData',answerData);
|
||||||
answerData.fk_createdby = this.users;
|
answerData.fk_createdby = this.users;
|
||||||
@ -952,9 +1001,28 @@ compareSingleObjects(o1: any, o2: any) {
|
|||||||
control.push(this.createFloorDetails(''));
|
control.push(this.createFloorDetails(''));
|
||||||
let unitControl = control.controls[floorIndex];
|
let unitControl = control.controls[floorIndex];
|
||||||
unitControl= <FormArray> unitControl.controls['floor_unit_details'];
|
unitControl= <FormArray> unitControl.controls['floor_unit_details'];
|
||||||
|
let floor_rent_amount_val;
|
||||||
floorElement.floor_unit_details.forEach((unitElement,unitIndex) => {
|
floorElement.floor_unit_details.forEach((unitElement,unitIndex) => {
|
||||||
floorElement.unit_rent_difference_options=="0" ? unitControl.push(this.createFloorUnitDetails(2)) : unitControl.push(this.createFloorUnitDetails(1));
|
floorElement.unit_rent_difference_options=="0" ? unitControl.push(this.createFloorUnitDetails(2)) : unitControl.push(this.createFloorUnitDetails(1));
|
||||||
|
console.log("rent per unit",unitElement.rent_per_unit);
|
||||||
|
if(floorElement.unit_rent_difference_options == "1"){
|
||||||
|
console.log("check",unitElement.rent_per_unit)
|
||||||
|
if(unitElement.rent_per_unit !=''){
|
||||||
|
this.inWords(unitElement.rent_per_unit,unitIndex,1)
|
||||||
|
}
|
||||||
|
if(unitElement.amount!=''){
|
||||||
|
this.inWords(unitElement.amount,floorIndex,2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(floorElement.unit_rent_difference_options=="0"){
|
||||||
|
if(unitElement.rent_per_unit!=''){
|
||||||
|
this.inWords(unitElement.rent_per_unit,unitIndex,3)
|
||||||
|
//floor_rent_amount_val+=unitElement.rent_per_unit
|
||||||
|
}
|
||||||
|
this.inWords(floorElement.floor_rent_amount,floorIndex,4)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
// this.inWords(floor_rent_amount_val,floorIndex,4)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1007,13 +1075,19 @@ compareSingleObjects(o1: any, o2: any) {
|
|||||||
element.property_owner_other_relation_to_per_met ? control.controls[index].addControl('property_owner_other_relation_to_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('property_owner_other_relation_to_per_met');
|
element.property_owner_other_relation_to_per_met ? control.controls[index].addControl('property_owner_other_relation_to_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('property_owner_other_relation_to_per_met');
|
||||||
|
|
||||||
// tennat payment
|
// tennat payment
|
||||||
|
|
||||||
|
|
||||||
|
// element.payment_difference_per_met=''
|
||||||
|
// control.controls[index].addControl('payment_difference_per_met',new FormControl(''))
|
||||||
|
console.log("payment",element);
|
||||||
element.paid_monthly_rent_per_met ? control.controls[index].addControl('paid_monthly_rent_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('paid_monthly_rent_per_met');
|
element.paid_monthly_rent_per_met ? control.controls[index].addControl('paid_monthly_rent_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('paid_monthly_rent_per_met');
|
||||||
element.period_of_stay_per_met ? control.controls[index].addControl('period_of_stay_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('period_of_stay_per_met');
|
element.period_of_stay_per_met ? control.controls[index].addControl('period_of_stay_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('period_of_stay_per_met');
|
||||||
element.payment_mode_per_met ? control.controls[index].addControl('payment_mode_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_mode_per_met');
|
element.payment_mode_per_met ? control.controls[index].addControl('payment_mode_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_mode_per_met');
|
||||||
element.amount_received_cash_per_met ? control.controls[index].addControl('amount_received_cash_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_cash_per_met');
|
element.amount_received_cash_per_met ? control.controls[index].addControl('amount_received_cash_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_cash_per_met');
|
||||||
element.amount_received_bank_per_met ? control.controls[index].addControl('amount_received_bank_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_bank_per_met');
|
element.amount_received_bank_per_met ? control.controls[index].addControl('amount_received_bank_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_bank_per_met');
|
||||||
element.payment_received_reason_per_met ? control.controls[index].addControl('payment_received_reason_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_received_reason_per_met');
|
element.payment_received_reason_per_met ? control.controls[index].addControl('payment_received_reason_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_received_reason_per_met');
|
||||||
element.payment_difference_per_met ? control.controls[index].addControl('payment_difference_per_met', new FormControl('')) : control.controls[index].removeControl('payment_difference_per_met');
|
if( element.payment_difference_per_met =='' || element.payment_difference_per_met !='') { control.controls[index].addControl('payment_difference_per_met', new FormControl('')) }
|
||||||
|
// control.controls[index].removeControl('payment_difference_per_met');
|
||||||
this.inWords(element.monthly_rent_amount != '' ? +element.monthly_rent_amount : '',index,5);
|
this.inWords(element.monthly_rent_amount != '' ? +element.monthly_rent_amount : '',index,5);
|
||||||
this.inWords(element.amount_received_cash != '' ? +element.amount_received_cash : '',index,6);
|
this.inWords(element.amount_received_cash != '' ? +element.amount_received_cash : '',index,6);
|
||||||
this.inWords(element.amount_received_bank != '' ? +element.amount_received_bank : '',index,7);
|
this.inWords(element.amount_received_bank != '' ? +element.amount_received_bank : '',index,7);
|
||||||
@ -1168,4 +1242,74 @@ compareSingleObjects(o1: any, o2: any) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// generate payment dynamic fields
|
||||||
|
|
||||||
|
ValidatedRentAmount(value:any,index:number,type: number){
|
||||||
|
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
|
||||||
|
console.log("validated",value);
|
||||||
|
if(type==1){
|
||||||
|
if(value && value.payment_mode.id==3){
|
||||||
|
let ChildCtrl : any = control.controls[index];
|
||||||
|
ChildCtrl.controls['amount_received_bank'].clearValidators();
|
||||||
|
ChildCtrl.controls['amount_received_bank'].updateValueAndValidity();
|
||||||
|
ChildCtrl.controls['amount_received_cash'].clearValidators();;
|
||||||
|
ChildCtrl.controls['amount_received_cash'].updateValueAndValidity();
|
||||||
|
let monthlyrentamt : any = value.monthly_rent_amount ;
|
||||||
|
|
||||||
|
|
||||||
|
if(monthlyrentamt != ''){
|
||||||
|
|
||||||
|
let bank_amount = value.amount_received_bank;
|
||||||
|
|
||||||
|
ChildCtrl.controls['amount_received_bank'].setValidators([Validators.required,Validators.max(monthlyrentamt),Validators.min(0)]);
|
||||||
|
ChildCtrl.controls['amount_received_bank'].updateValueAndValidity();
|
||||||
|
let maxamt = monthlyrentamt-bank_amount
|
||||||
|
if(maxamt >= 0 ){
|
||||||
|
ChildCtrl.controls['amount_received_cash'].setValue();
|
||||||
|
ChildCtrl.controls['amount_received_cash'].setValidators([Validators.required,Validators.max(monthlyrentamt-bank_amount),Validators.min(monthlyrentamt-bank_amount)]);
|
||||||
|
this.inWords(maxamt,index,8)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ChildCtrl.controls['amount_received_cash'].setValue(0);
|
||||||
|
ChildCtrl.controls['amount_received_cash'].setValidators([Validators.max(0),Validators.min(0)]);
|
||||||
|
}
|
||||||
|
ChildCtrl.controls['amount_received_cash'].updateValueAndValidity();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type==2){
|
||||||
|
|
||||||
|
if(value && value.payment_mode_per_met.id==3){
|
||||||
|
let ChildCtrl : any = control.controls[index];
|
||||||
|
ChildCtrl.controls['amount_received_bank_per_met'].clearValidators();
|
||||||
|
ChildCtrl.controls['amount_received_bank_per_met'].updateValueAndValidity();
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].clearValidators();;
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].updateValueAndValidity();
|
||||||
|
let paidmonthlyrentamt : any = value.paid_monthly_rent_per_met;
|
||||||
|
|
||||||
|
|
||||||
|
if(paidmonthlyrentamt != ''){
|
||||||
|
|
||||||
|
let bank_amount = value.amount_received_bank_per_met;
|
||||||
|
ChildCtrl.controls['amount_received_bank_per_met'].setValidators([Validators.required,Validators.max(paidmonthlyrentamt),Validators.min(0)]);
|
||||||
|
ChildCtrl.controls['amount_received_bank_per_met'].updateValueAndValidity();
|
||||||
|
let remainingAmt = paidmonthlyrentamt-bank_amount
|
||||||
|
console.log("paid monthly",paidmonthlyrentamt);
|
||||||
|
console.log("remaining",remainingAmt)
|
||||||
|
if(remainingAmt >= 0 ){
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].setValue(remainingAmt);
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].setValidators([Validators.required,Validators.max(paidmonthlyrentamt-bank_amount),Validators.min(paidmonthlyrentamt-bank_amount)]);
|
||||||
|
this.inWords(remainingAmt,index,12)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].setValue(0);
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].setValidators([Validators.max(0),Validators.min(0)]);
|
||||||
|
}
|
||||||
|
ChildCtrl.controls['amount_received_cash_per_met'].updateValueAndValidity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Toast, ToastController } from 'ionic-angular';
|
import { Toast, ToastController,AlertController} from 'ionic-angular';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Generated class for the ToastProvider provider.
|
Generated class for the ToastProvider provider.
|
||||||
@ -11,7 +11,7 @@ import { Toast, ToastController } from 'ionic-angular';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ToastProvider {
|
export class ToastProvider {
|
||||||
|
|
||||||
constructor(public http: HttpClient,public toast:ToastController) {
|
constructor(public http: HttpClient,public toast:ToastController,private alertCtrl:AlertController) {
|
||||||
console.log('Hello ToastProvider Provider');
|
console.log('Hello ToastProvider Provider');
|
||||||
}
|
}
|
||||||
pdTriggerappmessage(mess){
|
pdTriggerappmessage(mess){
|
||||||
@ -24,4 +24,31 @@ export class ToastProvider {
|
|||||||
|
|
||||||
valalert.present();
|
valalert.present();
|
||||||
}
|
}
|
||||||
|
setAlert(title_name,msg){
|
||||||
|
|
||||||
|
|
||||||
|
let alert=this.alertCtrl.create({
|
||||||
|
title:title_name,
|
||||||
|
message:msg,
|
||||||
|
cssClass:'buttoncss',
|
||||||
|
buttons:[{
|
||||||
|
text:'Yes',
|
||||||
|
cssClass:'btnYes',
|
||||||
|
handler:()=>{
|
||||||
|
alert.dismiss(true)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text:'No',
|
||||||
|
cssClass:'btnNo',
|
||||||
|
handler:()=>{
|
||||||
|
alert.dismiss(false)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
//alert.present()
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -178,8 +178,10 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
|
|||||||
// }
|
// }
|
||||||
// return words_string;
|
// return words_string;
|
||||||
}
|
}
|
||||||
searchData(data,val: any) {
|
//FOR SEARCHABLE DROP DOWN
|
||||||
|
searchData(data,val: any,option) {
|
||||||
let DataValue:any
|
let DataValue:any
|
||||||
|
// let nameVal=name.toLowerCase()
|
||||||
console.log("statedata")
|
console.log("statedata")
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return
|
return
|
||||||
@ -187,13 +189,21 @@ searchData(data,val: any) {
|
|||||||
let searchVal = val
|
let searchVal = val
|
||||||
if (!searchVal) {
|
if (!searchVal) {
|
||||||
// this.filteredState.next(this.stateList.slice())
|
// this.filteredState.next(this.stateList.slice())
|
||||||
return DataValue=data.slice()
|
DataValue=data.slice()
|
||||||
|
return DataValue
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
searchVal = searchVal.toLowerCase()
|
searchVal = searchVal.toLowerCase()
|
||||||
}
|
}
|
||||||
return DataValue=data.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
|
if(option == "bank"){
|
||||||
|
DataValue=data.filter(res => res.lender_name.toLowerCase().indexOf(searchVal) > -1)
|
||||||
|
return DataValue
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
DataValue=data.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
|
||||||
|
return DataValue
|
||||||
|
}
|
||||||
// this.filteredState.next(
|
// this.filteredState.next(
|
||||||
// this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
|
// this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
|
||||||
// )
|
// )
|
||||||
|
|||||||
@ -115,6 +115,10 @@ savePDImages(imagesDetails)
|
|||||||
let record = {'records':imagesDetails};
|
let record = {'records':imagesDetails};
|
||||||
return this.http.post(this.apiurl+'savePDPhotos',record);
|
return this.http.post(this.apiurl+'savePDPhotos',record);
|
||||||
}
|
}
|
||||||
|
getPDImages(records){
|
||||||
|
let record={'records':records};
|
||||||
|
return this.http.post(this.apiurl+'getPDImages',record);
|
||||||
|
}
|
||||||
getFamilyDetails(pdid:any){
|
getFamilyDetails(pdid:any){
|
||||||
return this.http.post<any>(this.apiurl+'getFamilyDetails',{"pd_id":pdid})
|
return this.http.post<any>(this.apiurl+'getFamilyDetails',{"pd_id":pdid})
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -28310,6 +28310,39 @@ image-viewer.ion-page img {
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttoncss {
|
||||||
|
color: darkseagreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttoncss button.alert-button:nth-child(1) {
|
||||||
|
color: red;
|
||||||
|
border: 1px solid red;
|
||||||
|
border-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
right: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttoncss button.alert-button:nth-child(2) {
|
||||||
|
color: green;
|
||||||
|
border: 1px solid green;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt_alert {
|
||||||
|
color: darkgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt_alert button.alert-button {
|
||||||
|
color: green;
|
||||||
|
border: 1px solid green;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prompt_alert input.alert-input {
|
||||||
|
border: 1px solid blueviolet;
|
||||||
|
}
|
||||||
|
|
||||||
page-auth .scroll-content {
|
page-auth .scroll-content {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
@ -28557,6 +28590,10 @@ page-input .leaveDays {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page-input ion-icon {
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
page-bounced-reject .scroll-content {
|
page-bounced-reject .scroll-content {
|
||||||
background-color: #eee !important;
|
background-color: #eee !important;
|
||||||
}
|
}
|
||||||
@ -29051,6 +29088,42 @@ page-pd-question-address textarea {
|
|||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page-pd-question-address img {
|
||||||
|
padding: 0 5px 5px 5px;
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-address input {
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-color: gray;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-daily-purchase mat-form-field {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-daily-purchase .scroll-content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-daily-purchase .scroll-content {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-daily-purchase .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-assessed-daily-purchase .mat-card-content {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
page-pd-question-assessed-daily-sales .input-cover {
|
page-pd-question-assessed-daily-sales .input-cover {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
@ -29182,8 +29255,11 @@ page-pd-question-assessed-dash .ribbon.default span::after {
|
|||||||
border-top: 3px solid #f53d3d;
|
border-top: 3px solid #f53d3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
page-pd-question-assessed-info .scroll-content {
|
page-pd-question-assessed-dash .radio {
|
||||||
background-color: none;
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
page-pd-question-assessed-info ion-scroll.scroll-y .scroll-content {
|
page-pd-question-assessed-info ion-scroll.scroll-y .scroll-content {
|
||||||
@ -29204,6 +29280,25 @@ page-pd-question-assessed-info input {
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-info .scroll-content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-info .scroll-content {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assessed-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-assessed-info .mat-card-content {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
page-pd-question-assessed-sales mat-radio-button {
|
page-pd-question-assessed-sales mat-radio-button {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@ -29265,6 +29360,19 @@ page-pd-question-assests .mat-card-content {
|
|||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page-pd-question-assests img {
|
||||||
|
padding: 0 5px 5px 5px;
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
page-pd-question-assests input {
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-color: gray;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
page-pd-question-banking .mat-card {
|
page-pd-question-banking .mat-card {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border-radius: 10px !important;
|
border-radius: 10px !important;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user