Fairoj : issues fixes

This commit is contained in:
venbatechnologies@gmail.com 2019-11-14 11:03:52 +05:30
parent 99a1b48f68
commit ee584bbbed
12 changed files with 147 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.sineedge.pdgenie" version="0.0.17" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.sineedge.pdgenie" version="0.0.19" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>PD Genie Officer </name> <name>PD Genie Officer </name>
<description>info@pdgenie.com</description> <description>info@pdgenie.com</description>
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author> <author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>

View File

@ -87,9 +87,7 @@ this.notificationAccess=false
this.platform.ready().then(() => { this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available. // Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need. // Here you can do any higher level native things you might need.
if(this.curr_environmnet.environment_name == 'production'){
this.checkAppVersion();
}
this.statusBar.styleDefault(); this.statusBar.styleDefault();
if (this.platform.is('android')) { if (this.platform.is('android')) {
this.statusBar.overlaysWebView(false); this.statusBar.overlaysWebView(false);
@ -110,12 +108,18 @@ this.notificationAccess=false
let myObject= localStorage.getItem('camera_imag') let myObject= localStorage.getItem('camera_imag')
// { // {
if (myObject) { if (myObject) {
if(this.curr_environmnet.environment_name == 'production'){
this.checkAppVersion();
}
// Ok we have an URI and something in the storage, we could recover // Ok we have an URI and something in the storage, we could recover
this.getuserDetails(); this.getuserDetails();
this.rootPage = AuthPage this.rootPage = AuthPage
console.log("Crasshed apk",myObject,this.Camerauri); console.log("Crasshed apk",myObject,this.Camerauri);
} else { } else {
if(this.curr_environmnet.environment_name == 'production'){
this.checkAppVersion();
}
// We can't recover we've got nothing in the storage, therefore process as usual. That gonna sucks for the user and you may lost him/her forever // We can't recover we've got nothing in the storage, therefore process as usual. That gonna sucks for the user and you may lost him/her forever
this.getuserDetails(); this.getuserDetails();
this.rootPage = AuthPage this.rootPage = AuthPage
@ -123,6 +127,9 @@ this.notificationAccess=false
// }); // });
} }
else{ else{
if(this.curr_environmnet.environment_name == 'production'){
this.checkAppVersion();
}
this.getuserDetails(); this.getuserDetails();
this.rootPage = AuthPage this.rootPage = AuthPage
} }
@ -342,6 +349,7 @@ let alert=this.alertCtrl.create({
}) })
} }
checkAppVersion(){ checkAppVersion(){
if(this.curr_environmnet.environment_name == 'production'){
this.pdtrigger.checkAppVersion().subscribe(result=>{ this.pdtrigger.checkAppVersion().subscribe(result=>{
if(result['dataStatus']){ if(result['dataStatus']){
console.log("app versions",this.app_version,result); console.log("app versions",this.app_version,result);
@ -367,5 +375,6 @@ let alert=this.alertCtrl.create({
} }
}) })
} }
}
} }

View File

@ -1,5 +1,5 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { NavController, MenuController, Events, Toast } from 'ionic-angular'; import { NavController, MenuController, Events, Toast, Platform } from 'ionic-angular';
// import { AlertController } from 'ionic-angular'; // import { AlertController } from 'ionic-angular';
// import {Validators, FormBuilder, FormGroup } from '@angular/forms'; // import {Validators, FormBuilder, FormGroup } from '@angular/forms';
// import { GridPage } from '../grid/grid'; // import { GridPage } from '../grid/grid';
@ -20,6 +20,9 @@ import { PdListPage } from '../pd-list/pd-list';
import { PasswordPage } from '../password/password'; import { PasswordPage } from '../password/password';
import { ToastProvider } from '../../providers/common-provider/toast'; import { ToastProvider } from '../../providers/common-provider/toast';
import {PdtriggerProvider} from '../../providers/pdtrigger/pdtrigger' import {PdtriggerProvider} from '../../providers/pdtrigger/pdtrigger'
import { ConstantsProvider } from '../../providers/constants/constants';
import { Market } from '@ionic-native/market';
import { AppVersion } from '@ionic-native/app-version';
@Component({ @Component({
selector: 'page-login', selector: 'page-login',
@ -46,14 +49,23 @@ config: MatDialogConfig = {
right: '' right: ''
} }
}; };
curr_environmnet: any;
app_version: string;
constructor( public aws: AwsServiceProvider, public dialog: MatDialog, constructor( public aws: AwsServiceProvider, public dialog: MatDialog,
public shared:CognitoServiceProvider,public navCtrl:NavController,public Menu:MenuController public shared:CognitoServiceProvider,public navCtrl:NavController,public Menu:MenuController
,public toast:ToastProvider,private push:Push,private pdtrigger:PdtriggerProvider,private events:Events) { ,public toast:ToastProvider,private push:Push,private pdtrigger:PdtriggerProvider,private events:Events,
private constantProvider:ConstantsProvider,private platform:Platform, private marketOpener:Market
,private appVersion:AppVersion) {
this.curr_environmnet=this.constantProvider.environment()
} }
ngOnInit(){ ngOnInit(){
//this.loggedInCheck(); //this.loggedInCheck();
this.appVersion.getVersionNumber().then(versionNumber=>{
console.log("Version Number :",versionNumber)
this.app_version=versionNumber;
},err=>{
console.log("Version Error",err);
})
} }
ionViewDidEnter(){ ionViewDidEnter(){
this.Menu.enable(false); this.Menu.enable(false);
@ -81,6 +93,7 @@ login() {
if(this.users.records[0].role_name == "PD Officer" || this.users.records[0].role_name == "PD Executive"){ if(this.users.records[0].role_name == "PD Officer" || this.users.records[0].role_name == "PD Executive"){
this.notification() this.notification()
this.checkAppVersion()
this.navCtrl.setRoot(PdListPage); this.navCtrl.setRoot(PdListPage);
}else }else
@ -196,6 +209,35 @@ notification(){
} }
checkAppVersion(){
if(this.curr_environmnet.environment_name == 'production'){
this.pdtrigger.checkAppVersion().subscribe(result=>{
if(result['dataStatus']){
console.log("app versions",this.app_version,result);
console.log(result['records'][0].version.toString())
if(this.app_version != result['records'][0].version.toString()){
return new Promise((resolve,reject)=>{
let alert= this.toast.setAlertwithOKButton("Update Available","A new version of App is available Please download it..!")
alert.present();
alert.onDidDismiss((data)=>{
if(data == false){
this.platform.exitApp();
reject()
return true;
}
else{
this.marketOpener.open('com.sineedge.pdgenie');
this.platform.exitApp();
}
})
})
}
}
})
}
}
forgotpassword() { forgotpassword() {
let auth = { 'Username': this.email }; let auth = { 'Username': this.email };

View File

@ -352,7 +352,7 @@
<!-- <mat-label>Vintage</mat-label> --> <!-- <mat-label>Vintage</mat-label> -->
<mat-label>Age of Asset in Years</mat-label> <mat-label>Age of Asset in Years</mat-label>
<input type="tel" matInput autocomplete="off" placeholder="eg.99" formControlName="vintage_personal" minlength="1" maxlength="2" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,2)"> <input type="tel" matInput autocomplete="off" placeholder="eg.99" formControlName="vintage_personal" minlength="1" maxlength="2" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> --> <!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field> </mat-form-field>

View File

@ -890,8 +890,37 @@ export class PdQuestionAssestsPage {
} }
} }
else if (type == 3) { else if (type == 3) {
// let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details'];
// control.controls[controlKey].controls['purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : '');
let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details']; let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details'];
control.controls[controlKey].controls['purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : ''); let vintage_personal=control.controls[controlKey].controls['vintage_personal'].value
control.controls[controlKey].controls['purchase_year'].setValue('');
let currentMonth:any=new Date().getMonth()+1
let monthMinus:any=0;
// control.controls[controlKey].controls['vintage_personal'].setValue(vintage_personal)
control.controls[controlKey].controls['purchase_year'].setValue(vintage_personal != '' ? parseInt(this.currentYear) - parseInt(vintage_personal) : '');
if(control.controls[controlKey].controls['asset_months'].value != ''){
if(parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value) < 0){
monthMinus=parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value)
if(monthMinus > -12){
monthMinus=1
}
else{
monthMinus=2
}
}
}
if(control.controls[controlKey].controls['asset_months'].value > 0 && (vintage_personal != '' || vintage_personal != 0)){
// vintage_personal=parseInt(vintage_personal)-1
control.controls[controlKey].controls['purchase_year'].setValue(parseInt( control.controls[controlKey].controls['purchase_year'].value)-monthMinus);
}
else if(control.controls[controlKey].controls['asset_months'].value > 0 && control.controls[controlKey].controls['asset_months'].value <12 && (vintage_personal == '' || vintage_personal == 0)){
control.controls[controlKey].controls['purchase_year'].setValue(parseInt(this.currentYear)-monthMinus);
}
} }
else if (type == 4) { else if (type == 4) {
let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details']; let control: any = <FormArray>this.AssetsDetailsForm.controls['assets_details'];

View File

@ -220,7 +220,7 @@
<mat-label>Age of Asset in Years</mat-label> <mat-label>Age of Asset in Years</mat-label>
<input matInput autocomplete="off" placeholder="eg.99" formControlName="business_vintage" <input matInput autocomplete="off" placeholder="eg.99" formControlName="business_vintage"
minlength="1" maxlength="2" type='tel' minlength="1" maxlength="2" type='tel'
(keyup)="calculateVintagePurchase($event.target.value,i,5)"> (keyup)="calculateVintagePurchase($event.target.value,i,1)">
<!-- <mat-error> Invalid format</mat-error> --> <!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
@ -432,7 +432,7 @@
<input matInput autocomplete="off" type="tel" placeholder="eg.99" <input matInput autocomplete="off" type="tel" placeholder="eg.99"
formControlName="business_vintage" minlength="1" maxlength="2" formControlName="business_vintage" minlength="1" maxlength="2"
(keyup)="calculateVintagePurchase($event.target.value,i,6)"> (keyup)="calculateVintagePurchase($event.target.value,i,3)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-label>Age of Asset in Months</mat-label> <mat-label>Age of Asset in Months</mat-label>

View File

@ -935,18 +935,55 @@ createBusinessAssetsForAddress(): FormGroup {
} }
// calculate vintage and purchase {} // calculate vintage and purchase {}
calculateVintagePurchase(value: any, controlKey: any, type: number) { calculateVintagePurchase(value: any, controlKey: any, type: number) {
if (type == 1) { // if (type == 1) {
let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']; // let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
control.controls[controlKey].controls['business_purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : ''); // control.controls[controlKey].controls['business_purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : '');
} // }
else if (type == 2) { if (type == 2) {
let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']; let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue(''); value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue('');
value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear) - parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('') value != '' && value <= this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear) - parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('')
} }
if (type == 3) { if (type == 3 || type == 1) {
let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address']; // let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
control.controls[controlKey].controls['business_purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : ''); // control.controls[controlKey].controls['business_purchase_year'].setValue(value != '' ? parseInt(this.currentYear) - parseInt(value) : '');
let control: any
if(type == 1){
control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];
}
else if(type == 3){
control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
}
// let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
let vintage_personal=control.controls[controlKey].controls['business_vintage'].value
control.controls[controlKey].controls['business_purchase_year'].setValue('');
let currentMonth:any=new Date().getMonth()+1
let monthMinus:any=0;
// control.controls[controlKey].controls['business_vintage'].setValue(business_vintage)
control.controls[controlKey].controls['business_purchase_year'].setValue(vintage_personal != '' ? parseInt(this.currentYear) - parseInt(vintage_personal) : '');
if(control.controls[controlKey].controls['asset_months'].value != ''){
if(parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value) < 0){
monthMinus=parseInt(currentMonth)-parseInt(control.controls[controlKey].controls['asset_months'].value)
if(monthMinus > -12){
monthMinus=1
}
else{
monthMinus=2
}
}
}
if(control.controls[controlKey].controls['asset_months'].value > 0 && (vintage_personal != '' || vintage_personal != 0)){
// vintage_personal=parseInt(vintage_personal)-1
control.controls[controlKey].controls['business_purchase_year'].setValue(parseInt( control.controls[controlKey].controls['business_purchase_year'].value)-monthMinus);
}
else if(control.controls[controlKey].controls['asset_months'].value > 0 && control.controls[controlKey].controls['asset_months'].value <12 && (vintage_personal == '' || vintage_personal == 0)){
control.controls[controlKey].controls['business_purchase_year'].setValue(parseInt(this.currentYear)-monthMinus);
}
} }
else if (type == 4) { else if (type == 4) {
let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address']; let control: any = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_for_address'];

View File

@ -2222,10 +2222,14 @@ export class PdQuestionBusinessInfoPage {
// }); // });
// } // }
// console.log('records',records); // console.log('records',records);
if(records.hasOwnProperty('documents')){
if(records.documents.length > 0){
if(records.documents.filter(val=>val.document == '').length > 0 ){ if(records.documents.filter(val=>val.document == '').length > 0 ){
this.toast.pdTriggerappmessage("Please Fill the Document Name"); this.toast.pdTriggerappmessage("Please Fill the Document Name");
return; return;
} }
}
}
this.spinner_access=true; this.spinner_access=true;
//FOR REMOVING THE base64 data from json //FOR REMOVING THE base64 data from json
console.log("record params1",records.gst_Regn_cert_pic) console.log("record params1",records.gst_Regn_cert_pic)

View File

@ -272,7 +272,7 @@
<mat-card> <mat-card>
<mat-form-field style="width:100%" class="mt-1"> <mat-form-field style="width:100%" class="mt-1">
<mat-select placeholder="KYC" <mat-select placeholder="Is the applicant name same as per KYC"
formControlName="is_kyc" (selectionChange)="kycchange($event.value)" required> formControlName="is_kyc" (selectionChange)="kycchange($event.value)" required>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let val of KYC" [value]="val.value" > <mat-option *ngFor="let val of KYC" [value]="val.value" >

View File

@ -114,7 +114,7 @@ createview(){
// else{ // else{
// geoCoords=retrieved_data.link // geoCoords=retrieved_data.link
// } // }
if(retrieved_data.docs_to_be_sighted != null){
retrieved_data.docs_to_be_sighted.forEach((doc_value,index)=>{ retrieved_data.docs_to_be_sighted.forEach((doc_value,index)=>{
if(doc_value.hasOwnProperty('img')){ if(doc_value.hasOwnProperty('img')){
this.docs_change_fun(index,'yes') this.docs_change_fun(index,'yes')
@ -128,8 +128,9 @@ createview(){
// data=doc_value.data // data=doc_value.data
// this.docs_change_fun(index,data) // this.docs_change_fun(index,data)
}) })
}
console.log("form123",this.docsCollectedForm.value); console.log("form123",this.docsCollectedForm.value);
this.docsCollectedForm.setValue(retrieved_data) this.docsCollectedForm.patchValue(retrieved_data)
this.loader.dismissLoader() this.loader.dismissLoader()
} }
},err=>{ },err=>{

View File

@ -65,7 +65,7 @@ public commonimage = "http://pdgenie.com/logo/avatar.jpg";
userPoolId:'ap-south-1_qQ85yQZJO', userPoolId:'ap-south-1_qQ85yQZJO',
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
} }
return production; return testing;
} }
getcurrentDate() getcurrentDate()