Chnages and Issues fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-05-03 19:56:05 +05:30
parent d797e84a6f
commit 04cc170b41
24 changed files with 2000 additions and 1057 deletions

File diff suppressed because one or more lines are too long

2842
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -71,6 +71,7 @@
},
"devDependencies": {
"@ionic/app-scripts": "3.1.5",
"@ionic/lab": "1.0.24",
"typescript": "2.4.2"
},
"description": "An Ionic project",
@ -104,4 +105,4 @@
"android"
]
}
}
}

View File

@ -62,7 +62,7 @@
<hr>
<ion-row>
<ion-col col-1><ion-icon name="md-cash"></ion-icon></ion-col>
<ion-col class="cardinfo">{{"&#8377;"}} {{pdMaster.loan_amount}}</ion-col>
<ion-col class="cardinfo">{{"&#8377;"}} {{pdMaster.loan_amount}} ( {{inWords(pdMaster.loan_amount)}} ) </ion-col>
</ion-row>
<hr/>
<div *ngFor="let addr of addresses; let i=index">

View File

@ -620,6 +620,11 @@ else{
{
this.navCtrl.push(PdGeneralImagesPage,{'pdDetails':this.applicatentDetails});
}
inWords(e){
return this.constant.convertNumberToWords(+e);
}
inprogress(data,address_child){
// data.pd_id=address_child.pd_id
console.log(address_child)

View File

@ -355,19 +355,14 @@ searchitem:any;
completePDAlert()
{
if(!this.overallqustioncountAccess){// For checking Answered Forms
this.toast.pdTriggerappmessage("Please complete all the Forms");
return;
}
console.log("this.ena",this.enableAddonPD);
this.toast.pdTriggerappmessage("Please complete all the Forms");
return;
}
if(this.enableAddonPD == true){//FOR CHECKING THE ADDRESS COUNT. IF VALUE 1 THIS BLOCK EXECUTED
return new Promise(reject=>{
let alert=this.toast.setAlertForCompletePD()
alert.present();
alert.onDidDismiss(data=>{
console.log('data',data)
if(data == 'yes'){
this.completed('COMPLETED');

View File

@ -4,7 +4,7 @@
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">Business Expense</ion-title>
<ion-title *ngIf="!viewchange">Business Expenses</ion-title>
</ion-navbar>

View File

@ -102,7 +102,7 @@
</span>
</ng-template>
<ion-icon class="ion-icon-custome" name="logo-android"></ion-icon>
<h1 class="htag">BUSINESS EXPENSE</h1>
<h1 class="htag">BUSINESS EXPENSES</h1>
</mat-card>
</ion-col>
<ion-col col-6 text-center>
@ -116,7 +116,7 @@
</span>
</ng-template>
<ion-icon class="ion-icon-custome" name="logo-android"></ion-icon>
<h1 class="htag">HOUSE HOLD</h1>
<h1 class="htag">HOUSEHOLD EXPENSES</h1>
</mat-card>
</ion-col>
<!-- </ion-row>

View File

@ -4,7 +4,7 @@
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">House Hold Expense</ion-title>
<ion-title *ngIf="!viewchange">Household Expenses</ion-title>
</ion-navbar>

View File

@ -374,7 +374,7 @@
<div *ngIf="pageId==3">
<mat-card>
<mat-card-header><h4>Business Expense Items</h4></mat-card-header>
<mat-card-header><h4>Business Expenses</h4></mat-card-header>
<ion-row>
<ion-col col-3 *ngIf="businessExpenses_details!=''"><a (click)="editExpenseAllDetails(businessExpenses_details)"><h2>{{"&#9998;"}}</h2></a></ion-col>
@ -411,7 +411,7 @@
</div>
<div *ngIf="pageId==4">
<mat-card>
<mat-card-header><h4>House Hold Items</h4></mat-card-header>
<mat-card-header><h4>Household Expenses</h4></mat-card-header>
<ion-row>
<ion-col col-3 *ngIf="houseHold_details !=''"><a (click)="editHouseExpenseAllDetails(houseHold_details)"><h2>{{"&#9998;"}}</h2></a></ion-col>

View File

@ -58,11 +58,17 @@
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="item.value.purchase_type=='1'">
<mat-form-field style="width: 100%">
<mat-select placeholder="UOM" name="fk_uom_id" formControlName="fk_uom_id">
<mat-option>Select</mat-option>
<mat-option *ngFor="let uom of UOM" [value]="uom.uom_id">{{uom.name}}</mat-option>
</mat-select>
<mat-select matInput placeholder="UOM" formControlName="fk_uom_id">
<mat-option>
<ngx-mat-select-search formControlName="uomSearch" (keyup)="searchUOM(item,i)"
[placeholderLabel]="'Find UOM'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option [value]="U.uom_id" *ngFor="let U of UOMData">
{{U.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
@ -72,7 +78,7 @@
<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%">
<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>
<input matInput placeholder="Rate / Unit of Purchase" type="number" name="rate_per_unit" 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"> {{"&#8377;"}} {{RateOfPurchase[i]}} Only</mat-hint>
</mat-form-field>
</div>

View File

@ -4,7 +4,9 @@ import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
import { ToastProvider } from '../../../providers/common-provider/toast';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
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 PdQuestionAssessedPurchasePage page.
@ -30,9 +32,12 @@ export class PdQuestionAssessedPurchasePage {
rawMaterialForm:FormGroup;
RateOfPurchase: any=[];
AnnualPurchase: any=[];
productListData:any=[]
productListData:any=[];
UOMData:any=[]
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
complete_status: boolean = false;
protected _onDestroy = new Subject<void>();
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.purchaseDetails = this.navParams.get('purchase');
@ -74,6 +79,7 @@ export class PdQuestionAssessedPurchasePage {
purchase_type:['1'],
purchase_qty:[null,Validators.compose([Validators.required])],
fk_uom_id:[null,Validators.compose([Validators.required])],
uomSearch:[null],
uom_other:[null],
rate_per_unit:[null,Validators.compose([Validators.required])],
fk_frequency_id:[null,Validators.compose([Validators.required])],
@ -97,6 +103,7 @@ export class PdQuestionAssessedPurchasePage {
{
if(res['dataStatus']==true){
this.UOM = res['records'].filter(uom=>uom.isactive==1);
this.UOMData=this.UOM.slice();
}
});
this.qustCat.getcommondrop('BUSINESSEXPENSES').subscribe(res=>
@ -175,8 +182,12 @@ export class PdQuestionAssessedPurchasePage {
purchaseCalculation(indexVal,values)
{
console.log("value",values);
let control:any = <FormArray>this.rawMaterialForm.controls['purchase'];
if(values.rate_per_unit != null){
if(values.rate_per_unit != ''){
this.inWords(values.rate_per_unit,indexVal,1);
}
}
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);
control.controls[indexVal].controls['annual_purchase_value'].setValue((parseFloat(values.purchase_qty) * parseFloat(values.rate_per_unit) * parseFloat(filterFrequencyValue[0].mutiple_factor)).toFixed(2));
@ -243,6 +254,11 @@ console.log("value",values);
savepurchaseData(answerData)
{
if(this.rawMaterialForm.valid){
answerData.purchase.forEach(parVal=>{
delete parVal.uomSearch
})
let records = {'records':answerData.purchase};
console.log('data',records);
this.qustCat.saveassessedForms('saveAssessedIncomePurchaseDetails',records).subscribe(res=>
@ -306,6 +322,7 @@ console.log("value",values);
purchase_type:[data.purchase_type],
purchase_qty:[data.purchase_qty,Validators.compose([Validators.required])],
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
uomSearch:[null],
uom_other:[data.uom_other],
rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])],
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
@ -337,6 +354,28 @@ console.log("value",values);
this.purchaseCalculation(indexVal,control.controls[indexVal].value);
}
}
searchUOM(control:any,i:number){
control.controls['uomSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
let val = control.controls['uomSearch'].value;
if (!this.UOM) {
return
}
let searchVal = val
if (!searchVal) {
this.UOMData=this.UOM.slice()
return
}
else {
searchVal = searchVal.toLowerCase()
}
this.UOMData=this.UOM.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
})
}
inWords(e,c,flag){
switch(flag){
case 1 :

View File

@ -37,10 +37,21 @@
<input type="number" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(i,item.value)" formControlName="sales_qty" name="sales_qty">
</mat-form-field>
<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" >
<mat-option>Select</mat-option>
<mat-option *ngFor="let uom of UOM" [value]="uom.uom_id">{{uom.name}}</mat-option>
</mat-select>
</mat-select> -->
<mat-select matInput placeholder="UOM" formControlName="fk_uom_id">
<mat-option>
<ngx-mat-select-search formControlName="uomSearch" (keyup)="searchUOM(item,i)"
[placeholderLabel]="'Find UOM'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option [value]="U.uom_id" *ngFor="let U of UOMData">
{{U.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="item.controls['fk_uom_id'].value == 1">
<input matInput type="text" autocomplete="off" formControlName="uom_other" placeholder="Other UOM">

View File

@ -4,7 +4,9 @@ import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
import { ToastProvider } from '../../../providers/common-provider/toast';
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 PdQuestionAssessedSalesPage page.
@ -38,6 +40,9 @@ export class PdQuestionAssessedSalesPage {
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
product_and_services: any=[];
complete_status: boolean = false;
UOMData:any=[]
protected _onDestroy = new Subject<void>();
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.FormId = this.navParams.get('FormId');
@ -81,6 +86,7 @@ export class PdQuestionAssessedSalesPage {
{
if(res['dataStatus']==true){
this.UOM = res['records'].filter(uom=>uom.isactive==1);
this.UOMData=this.UOM.slice();
}
});
@ -134,6 +140,7 @@ export class PdQuestionAssessedSalesPage {
sales_qty:[null,Validators.compose([Validators.required])],
sales_type:["1"],
fk_uom_id:[null,Validators.compose([Validators.required])],
uomSearch:[null],
uom_other:[null],
rate_per_unit:[null,Validators.compose([Validators.required])],
fk_frequency_id:[null,Validators.compose([Validators.required])],
@ -385,6 +392,11 @@ export class PdQuestionAssessedSalesPage {
{
if(this.assessedForm.valid){
answerData.salesCalItemwise.forEach(parVal=>{
delete parVal.uomSearch
})
let records = {'records':answerData.salesCalItemwise};
console.log(records);
this.qustCat.saveassessedForms('saveAssessedIncomeSalesCalculatedByItemwise',records).subscribe(res=>
@ -483,6 +495,7 @@ else{
sales_type:[data.sales_type,Validators.compose([Validators.required])],
sales_qty:[data.sales_qty,Validators.compose([Validators.required])],
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
uomSearch:[null],
uom_other:[data.uom_other],
rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])],
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
@ -493,4 +506,26 @@ else{
comments:[data.comments]
});
}
searchUOM(control:any,i:number){
control.controls['uomSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
let val = control.controls['uomSearch'].value;
if (!this.UOM) {
return
}
let searchVal = val
if (!searchVal) {
this.UOMData=this.UOM.slice()
return
}
else {
searchVal = searchVal.toLowerCase()
}
this.UOMData=this.UOM.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
})
}
}

View File

@ -429,6 +429,6 @@
<ion-footer>
<span *ngIf='!complete_status'>
<button ion-button full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
<button ion-button ion-fixed full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
</span>
</ion-footer>

View File

@ -133,11 +133,14 @@
<mat-option>Select</mat-option>
<mat-option value="owned">Owned</mat-option>
<mat-option value="rented">Rented</mat-option>
<!-- <mat-option value="owned">{{ addressType + ' Owned'}}</mat-option>
<mat-option value="rented">{{ addressType + ' Rented' }}</mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="(itemrow.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount"
<input matInput autocomplete="off"
[placeholder]= "'Monthly ' + addressType + ' Rent Amount'"
formControlName="business_monthly_rented_amt" type='numbers' (keyup)="inWords($event,i,9)">
<mat-hint align="end" style="font-size:12px"
*ngIf="itemrow.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}}
@ -161,8 +164,9 @@
</mat-form-field>
<mat-form-field>
<mat-select multiple placeholder="Asset Owned by" formControlName="business_name_of_the_owner"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,8)">
<mat-select multiple formControlName="business_name_of_the_owner"
[placeholder]="addressType + ' Owned by'"
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value,itemrow,8,i)">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
@ -176,7 +180,7 @@
<input matInput placeholder="business_name_of_the_owner" formControlName="business_name_of_the_owner" autocomplete="off">
</mat-form-field> -->
<!-- -->
<mat-form-field style="width:100%" *ngIf="isOtherOwnerForAddress">
<mat-form-field style="width:100%" *ngIf="checkOthers(itemrow.get('business_name_of_the_owner').value) === true">
<input matInput placeholder="Specify Asset Owned Name"
formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field>
@ -430,7 +434,7 @@
<!--END OF FORM SEGMENT-->
</div>
<!--END OF SWITCHCASES-->
<ion-fab bottom right mini>
<ion-fab bottom right mini>
<button mini style="margin-bottom: 10px" ion-fab color="optblue" slot="fixed" (click)="capture()"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button></ion-fab>
</ion-content>
<ion-footer>

View File

@ -67,7 +67,7 @@ export class PdQuestionBusinessAssetsPage {
imageBucket: any=[];
tab: any='0';
complete_status: boolean = false;
addressType:any = '';
constructor(public navCtrl: NavController, public navParams: NavParams,
public aws:AwsServiceProvider,public fb:FormBuilder,public qustcat:QuestionCategoryProvider,
public cons:ConstantsProvider,public toast:ToastProvider,private loading:LoadingProvider,
@ -130,12 +130,13 @@ export class PdQuestionBusinessAssetsPage {
let selectedPincode = this.pinArr.filter(element => element.pincode_id == data.pincode)[0];
console.log(selectedCity)
let addressType
if(selectedAddressType != '' && selectedAddressType != undefined){
addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others;
if(selectedAddressType != '' && selectedAddressType != undefined){
this.addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others;
console.log('this.addressType',this.addressType);
}
else{
addressType=''
this.addressType=''
}
let address = data.address + ' , ' + selectedCity.city_name + ','+selectedState.name +'-' + (data.pincode == 1 ? data.pincode_others : selectedPincode.pincode);
@ -144,9 +145,9 @@ export class PdQuestionBusinessAssetsPage {
// let address = data.address;
// let addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others;
this.placeholderName[inx] = 'Was any business activity seen at the '+addressType+' during PD visit?';
this.placeholderName[inx] = 'Was any business activity seen at the '+this.addressType+' during PD visit?';
//console.log(this.placeholderName)
let addressLabel = " : "+address+' / '+addressType ;
let addressLabel = " : "+address+' / '+this.addressType ;
console.log("dd",addressLabel)
let values={
address_label:addressLabel,
@ -164,6 +165,7 @@ export class PdQuestionBusinessAssetsPage {
business_purchase_year: '',
business_emi: ''
}
console.log('this.addressType',this.addressType);
control.push(this.initBusinessDetailsWithdata(values));
}
})
@ -491,6 +493,7 @@ createBusinessAssetsForAddress(): FormGroup {
if(datas.address_label != null && datas.address_label !=''){
let splitted=datas.address_label.split('/')[1]
this.placeholderName[index]='Was any business activity seen at the '+splitted+' during PD visit?';
this.addressType = splitted;
}
this.RentAmtInwordsForAddress[index] = this.cons.convertNumberToWords(datas.business_monthly_rented_amt);
this.appxMarketAmtInwordsForAddress[index] = this.cons.convertNumberToWords(datas.business_approximate_market_value);
@ -750,8 +753,15 @@ createBusinessAssetsForAddress(): FormGroup {
// // check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
if(values.length > 0) {
// return values.id==0 ? true : false;
let Avaliablity = 1;
values.forEach(option => {
if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id;
}
});
return Avaliablity == 0 ? true : false;
}
else {
return false;

View File

@ -349,6 +349,7 @@ submitDetails(){
if(value['dataStatus']==true){
let retrieveData=value['records'];
if(value['records'].is_financial_statements == 'yes'){
this.isDisplay = true;
let result=Object.keys(value['records'].date_per_financial).map(function(key) {
return value['records'].date_per_financial[key]
})

View File

@ -31,21 +31,21 @@ let alert=this.alertCtrl.create({
title:title_name,
message:msg,
cssClass:'buttoncss',
buttons:[{
buttons:[
{
text:'No',
cssClass:'btnNo',
handler:()=>{
alert.dismiss(false)
return false
}
},{
text:'Yes',
cssClass:'btnYes',
handler:()=>{
alert.dismiss('s')
return false
}
},
{
text:'No',
cssClass:'btnNo',
handler:()=>{
alert.dismiss(false)
return false
}
}]
});
//alert.present()

View File

@ -21,7 +21,7 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
let devapiurl_beta = 'http://ssa.sineedge.com/sparqapi_beta/api/';
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
let localapiurl = 'http://192.168.0.6:9999/AWSEC2/sparqapi/api/';
return testapiurl;
return devapiurl;
}
getcurrentDate()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.