issues fixes : ps

This commit is contained in:
saravanakumarkandasami 2019-05-20 22:33:11 +05:30
parent e869d8d71e
commit f570685a96
27 changed files with 231 additions and 23 deletions

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

View File

@ -1,4 +1,4 @@
#Sat May 18 21:07:28 IST 2019
#Sun May 19 16:45:58 IST 2019
base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0
path.0=classes.dex
renamed.0=classes.dex

View File

@ -1,5 +1,5 @@
#Internal package file, do not edit.
#Sat May 18 21:07:28 IST 2019
#Sun May 19 16:45:58 IST 2019
60.set=ASSET
52.set=ASSET
53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,11 @@
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>{{pdMaster.lender_full_name}} - {{pdMaster.lender_applicant_id}}</ion-title>
<ion-buttons end>
<a (click)="capture()">
<span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;"><mat-icon>camera_enhance</mat-icon></span>
</a>
</ion-buttons>
</ion-navbar>
</ion-header>
@ -185,6 +190,51 @@
</ion-row>
</mat-card-content>
</mat-card><br/><br/>
<mat-card style="border-radius:10px">
<br/>
<mat-card-header>
<mat-card-title><h5>Common PD Images</h5></mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-label *ngIf="imageDisplay.length ==0 && imageBucket.length ==0 "><strong>No Documents Found. Press the camera button below to capture</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><br/>
<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>
<hr/>
<hr/>
</ion-grid>
<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><br/>
<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><br/><br/>
</ion-content>
<ion-footer *ngIf="address_pd_id != null">
<mat-card style="padding:0px !important;">

View File

@ -27,8 +27,10 @@ import {BouncedRejectPage} from '../../pages/input/bounced-reject/bounced-reject
import {PdQuestionCategoryPage} from '../../pages/pd-question-category/pd-question-category'
import {MapAddressPage} from '../../pages/map-address/map-address'
import {CameraProvider} from '../../providers/common-provider/camera' ;
import {LoadingProvider} from '../../providers/common-provider/loading';
import {StorageProvider} from '../../providers/storage/storage';
import { QuestionCategoryProvider } from '../../providers/question-category/question-category';
/**
* Generated class for the InputPage page.
*
@ -68,6 +70,8 @@ other_applicant:any=[];
loadDetails=false;
mainApplicant:any=[]
pdMaster:any=[]
imageDisplay: any=[];
imageBucket: any=[];
checkOtpAccess:boolean = false;
@ViewChild('focusinp') input_focus ;
@ViewChild('scroll') scrolltop : Content;
@ -80,7 +84,11 @@ checkOtpAccess:boolean = false;
public statusBar:StatusBar,public platform: Platform,public launchNavigator:LaunchNavigator,
public aws:AwsServiceProvider,public pdDetails:PdtriggerProvider,public geolocation:Geolocation,
public alertCtrl:AlertController,public locationAccuracy:LocationAccuracy,public toast:ToastProvider,
public constant:ConstantsProvider,public androidPermissions:AndroidPermissions,public modalCtrl:ModalController) {
public constant:ConstantsProvider,public androidPermissions:AndroidPermissions,public modalCtrl:ModalController,
public qustCat: QuestionCategoryProvider,private cameraProvider:CameraProvider,
private loading:LoadingProvider,public storagedb:StorageProvider) {
this.maxdate = this.pipe.transform(new Date(),'yyyy-MM-ddTHH:mm').toString();
// this.maxdate=new Date().toLocaleString();
@ -135,7 +143,8 @@ checkOtpAccess:boolean = false;
ionViewDidLoad() {
this.setPermission();
console.log('ionViewDidLoad InputPage');
console.log('ionViewDidLoad InputPage' );
this.getPDImages();
}
ionViewCanLeave()
{
@ -645,4 +654,91 @@ else{
inWords(e){
return this.constant.convertNumberToWords(+e)+' Only';
}
/*IMAGE SECTION*/
getPDImages(){
//FOR RETRIEVING PICTURES
this.imageDisplay=[]
let record_for_pic = {'pd_id':this.applicatentDetails.pd_id,'form_id':null,'company_id':null}
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)
}
capture(){
//FOR CAPTURING PICS
this.cameraProvider.getcommonpicture().then(res=>{
if(res != 'error'){
console.log('not an error');
res = this.customfilter(res);
this.imageBucket.push({'image':res,'Name':''});
//FOR GETTING THE DOC NAME FROM ALERT
let alert =this.toast.setAlertForDocName()
alert.present()
alert.onDidDismiss(value=>{
console.log("alert value",value);
if(value){
this.imageBucket[this.imageBucket.length-1].Name=value.Name
}
})
}
},error=>{
console.log("Camera Error ",JSON.stringify(error));
})
}
customfilter(res){
console.log('custome filter');
return res.filter(data=>data.fk_form_id != null);
}
sendImage(){
this.loading.loaderForSendImage()
console.log("ll",JSON.stringify(this.imageBucket));
let records:any={
'pd_id':this.applicatentDetails.pd_id,
'formid':null,
'images':this.imageBucket,
'company_id':null
}
console.log("records",JSON.stringify(records))
this.qustCat.savePDImages(records).subscribe(res=>{
if(res['dataStatus']== true){
this.toast.pdTriggerappmessage("Image Saved Successfully")
this.imageBucket=[]
this.getPDImages();
}
else{
this.toast.pdTriggerappmessage('Fail');
}
})
}
}

View File

@ -9,7 +9,12 @@
<ion-navbar color="optblue">
<ion-title>Images For Assessed Income</ion-title>
</ion-navbar>
<ion-buttons end>
<a (click)="capture()">
<!-- <span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;"><ion-icon name="md-camera"></ion-icon></span> -->
<span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;"><mat-icon>camera_enhance</mat-icon></span>
</a>
</ion-buttons>
</ion-header>
@ -54,6 +59,6 @@
<button secondary *ngIf="imageBucket.length >0" #focusName align="end" ion-button color="primary" (click)="sendImage()">save Images</button>
</mat-card>
<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-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>

View File

@ -124,7 +124,7 @@ step:number
this.qustCat.getcommondrop('BTLENDERLIST').subscribe(
data => {
if(data['dataStatus']==true){
this.m_btLenderList = data['records'].filter(data => data.isactive == 1);
this.m_btLenderList = data['records'].filter(data => data.isactive == 1 && data.lender_type == 1);
this.m_btLenderListValue=this.m_btLenderList.slice();
}
});

View File

@ -389,14 +389,14 @@
<p>Working Capital Facilities availed</p>
</mat-card-subtitle>
<!-- <div class="toggle" fxLayout="row wrap" formArrayName="select_working_capital_facilities_availed">
<div class="toggle" fxLayout="row wrap" formArrayName="select_working_capital_facilities_availed">
<div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25"
*ngFor="let entityType of financialForm.controls.select_working_capital_facilities_availed['controls']; let e = index;"
[formGroupName]="e">
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status"
(click)="changeWorkingCapitalFacilities(entityType)">{{entityType.controls.name.value}}</mat-checkbox>
</div>
</div> -->
</div>
<mat-form-field style="width:100%;" *ngIf="financialForm.controls['other_reason_for_working_capital_facilities_availed']">
<input matInput autocomplete="off" placeholder="Others Working Capital Facilities availed"
@ -438,7 +438,7 @@
<mat-form-field style="width:100%;" *ngIf="financialForm.controls['forfaiting']">
<input matInput autocomplete="off" placeholder="Details of Forfaiting"
formControlName="factoring">
formControlName="forfaiting">
<!-- <mat-error *ngIf="financialForm.controls['forfaiting'].hasError('required')">forfaiting Required</mat-error> -->
</mat-form-field>

View File

@ -81,6 +81,11 @@ export class PdQuestionFinancialInfoPage {
if(data.records.type_of_activity.length == 1){
let bussiness_service_datas = data.records.type_of_activity.filter(data => { if (data.type_of_activity_id == 5) { return data } }).map(data => [...data.prodcuts]);
this.ServiceDataAvailability = bussiness_service_datas.length>0 ? true : false;
if(this.ServiceDataAvailability == true){
this.financialForm.controls['unsold_stock_lies_in_days'].setValue('NA');
}else{
this.financialForm.controls['unsold_stock_lies_in_days'].setValue('');
}
}
else{
this.ServiceDataAvailability = false;
@ -334,6 +339,19 @@ submitDetails(){
}
let records=this.financialForm.value;
records.select_working_capital_facilities_availed = records.select_working_capital_facilities_availed.filter(value => value.exist_status == 1);
if(records.is_there_working_capital_available == "no"){
records.select_working_capital_facilities_availed = [];
if(records.bank_guarantee) delete records.bank_guarantee ;
if(records.cash_credit_limit) delete records.cash_credit_limit;
if(records.factoring) delete records.factoring;
if(records.forfaiting) delete records.forfaiting;
if(records.letter_of_credit) delete records.letter_of_credit;
if(records.od_limit) delete records.od_limit;
if(records.other_reason_for_working_capital_facilities_availed) delete records.other_reason_for_working_capital_facilities_availed ;
if(records.reason_for_working_capital_facilities_availed) delete records.reason_for_working_capital_facilities_availed ;
}
this.qustCat.saveForm(records).subscribe(res=>{
if(res['status']== 200){
this.financialForm.markAsUntouched();
@ -362,6 +380,7 @@ submitDetails(){
params.pd_form_id=this.FormId
params.company_id=this.company_id
this.qustCat.retiverForm(params).subscribe(value=>{
if(value['dataStatus']==true){
let retrieveData=value['records'];
if(value['records'].is_financial_statements == 'yes'){
@ -415,16 +434,18 @@ submitDetails(){
retrieveData.company_id=this.company_id
retrieveData.fk_createdby=this.users
retrieveData.formid=this.FormId
console.log('retrieveData.select_working_capital_facilities_availed',retrieveData.select_working_capital_facilities_availed);
let avData = this.av.map(item => ({ name: item.name, id: item.id }))
let exist_av_data: any = [];
let exist_av_data: any = [];
if (retrieveData.select_working_capital_facilities_availed) {
exist_av_data = Object.keys(retrieveData.select_working_capital_facilities_availed).map(function (key) {
return retrieveData.select_working_capital_facilities_availed[key].id;
});
}
console.log('exist_av_data',exist_av_data);
let actual_av = avData.map(item => item.id);
console.log('actual_av',actual_av);
let check_exist_av = actual_av.map((id, index) => {
if (exist_av_data.indexOf(id) < 0) {
avData[index].exist_status = 0;
@ -435,7 +456,7 @@ submitDetails(){
return avData[index];
}
}).filter(item => item != undefined);
console.log('check_exist_av ',check_exist_av );
if (check_exist_av.length > 0) {
check_exist_av.forEach(val => {
workingCptlControl.push(this.workingCptl(val));
@ -469,6 +490,9 @@ submitDetails(){
}
this.financialForm.setValue(retrieveData)
if(this.ServiceDataAvailability == false && retrieveData.unsold_stock_lies_in_days == 'NA' ){
this.financialForm.controls['unsold_stock_lies_in_days'].setValue('');
}
}
else {
let avData = this.av.map(item => ({ name: item.name, id: item.id }))
@ -505,7 +529,7 @@ submitDetails(){
});
}
changeWorkingCapitalFacilities(event: any) {
changeWorkingCapitalFacilities(event: any) {
console.log('event',event);
if (event.value.exist_status == true && event.value.id == 2) {
console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id)
@ -555,9 +579,18 @@ changeWorkingCapitalFacilities(event: any) {
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl(''));
}
// if(event.value.exist_status==true && event.value.id==1){
// let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
// othersControl.controls = [];
// othersControl.setValue([]);
// }
// else if(event.value.exist_status==false && event.value.id==1){
// let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
// othersControl.push(this.createOthersActivity());
// }
// check activity type for make dosument sighted filed dynamically
}
/**
* New Calculation for Finanical Statement
**/

View File

@ -39,4 +39,28 @@ export class CameraProvider {
});
}
getcommonpicture()
{
const options = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
targetWidth: 500,
targetHeight: 500,
correctOrientation: true
};
// If set to crop, restricts the image to a square of 600 by 600
return this.camera.getPicture(options).then(imageData => {
const base64Image = 'data:image/png;base64,' + imageData.filter(data=>data.fk_form_id == null);
console.log("base 64",base64Image);
return base64Image;
}, error => {
console.log('CAMERA ERROR -> ' + JSON.stringify(error));
return "error"
});
}
}