issues fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-04-09 14:53:10 +05:30
parent 13f22d5efb
commit be0f45f2f9
16 changed files with 111 additions and 62 deletions

View File

@ -44,8 +44,8 @@
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" OnlyNumber maxlength="10">
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" OnlyNumber maxlength="10" minlength="10">
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<!--<mat-form-field style="width: 32%">
@ -206,7 +206,8 @@
</mat-form-field>
<mat-form-field style="width: 38%">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" OnlyNumber maxlength="10" required>
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile_no" type="text" OnlyNumber maxlength="10" minlength="10">
<mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile No is Required . </mat-error>
<mat-error *ngIf="pdMain.mobile_no.hasError('maxlength') || pdMain.mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>

View File

@ -89,7 +89,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
loan_amount: [null, Validators.compose([Validators.pattern('^[0-9]*$')])],
applicant_title_name: [''],
applicant_name: [null,Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(10),Validators.required])],
mobile_no: [null, Validators.compose([Validators.maxLength(10), Validators.minLength(10)])],
// landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
// email: [null],
applicant_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
@ -447,6 +447,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else if (formValue.mobile_no.length != 10) {
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
else {
this.disableAfterSubmit = true;
@ -600,21 +604,21 @@ export class AddPdComponent implements OnInit, OnDestroy {
if (formValue.addtional_requirements.length > 0) {
pd_form.append("addtional_requirements", JSON.stringify(formValue.addtional_requirements))
}
this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) {
this.disableAfterSubmit = false;
this.notifier.notify('success', 'PD Saved.');
this.loadPdListCompoent(true);
}
else {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.disableAfterSubmit = false;
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
alert('commanded')
// this._pd.addPdDetails(pd_form).subscribe(result => {
// if (result.status == 200) {
// this.disableAfterSubmit = false;
// this.notifier.notify('success', 'PD Saved.');
// this.loadPdListCompoent(true);
// }
// else {
// this.disableAfterSubmit = false;
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// }
// }, error => {
// this.disableAfterSubmit = false;
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
// });
}
}
}

View File

@ -71,8 +71,8 @@
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" OnlyNumber>
<mat-error *ngIf="coDetails['controls'].coapplicant_mobile_no.hasError('pattern') || coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
<input matInput placeholder="Mobile Number" formControlName="coapplicant_mobile_no" type="text" maxlength="10" minlength="10" OnlyNumber>
<mat-error *ngIf=" coDetails['controls'].coapplicant_mobile_no.hasError('maxlength') || coDetails['controls'].coapplicant_mobile_no.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<!-- <mat-form-field style="width: 40%" >

View File

@ -150,6 +150,10 @@ export class EditPdApplicantComponent implements OnInit {
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else if(formValue.mobile_no.length != 10){
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
else{
let concat_landline1
// if(formValue.stdcode != null && formValue.landline != null){

View File

@ -60,7 +60,7 @@
</div>
<mat-form-field style="width: 92%">
<textarea matInput type="text" placeholder="Remarks" formControlName="comments" [required]="purchase.value.purchase_type=='2' ? true : false"></textarea>
<textarea matInput type="text" placeholder="Remarks" formControlName="comments" required></textarea>
</mat-form-field>
</mat-card-content>

View File

@ -74,8 +74,8 @@ export class ManageDailyPurchaseComponent implements OnInit {
});
control.controls[control.value.length-1].controls['comments'].setValidators([Validators.required]);
control.controls[control.value.length-1].controls['comments'].updateValueAndValidity();
// control.controls[control.value.length-1].controls['comments'].setValidators([Validators.required]);
// control.controls[control.value.length-1].controls['comments'].updateValueAndValidity();
}
else{
this.purchaseItemForm = this._fb.group({
@ -96,7 +96,7 @@ export class ManageDailyPurchaseComponent implements OnInit {
other_purchase_item:[''],
annual_purchase_value: [''],
child: this._fb.array([]),
comments: [''],
comments: ['', Validators.compose([Validators.required])],
isactive:[true],
});
}
@ -122,7 +122,7 @@ createPurchaseItemWithData(values: any) {
other_purchase_item:[values.otherPurchaseItem === null ? '' : values.otherPurchaseItem ],
annual_purchase_value: [values.annualPurchaseValue],
child: this._fb.array([]),
comments: [values.comments],
comments: [values.comments, Validators.compose([Validators.required])],
isactive:[true],
});
}

View File

@ -82,7 +82,7 @@
</mat-form-field>
<mat-form-field style="width: 25%">
<input OnlyNumber type="text" 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(s,item.value)" required>
<input OnlyNumber type="text" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Purchase' : item.value.fk_frequency_id=='2' ? 'Yearly Purchase' : item.value.fk_frequency_id=='3' ? 'Half Yearly Purchase' : item.value.fk_frequency_id=='4' ? 'Fortnightly Purchase' : item.value.fk_frequency_id=='5' ? 'Daily Purchase' : item.value.fk_frequency_id=='6' ? 'Quarterly Purchase' : item.value.fk_frequency_id=='7' ? 'Monthly Purchase' : ''" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"&#8377;"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
</mat-form-field>

View File

@ -2,7 +2,8 @@
<mat-card-content>
<div fxLayout="row nowrap">
<div fxFlex="60" align="left">
<span>Purchase Calculate Daily Wise</span>
<!-- <span>Purchase Calculate Daily Wise</span> -->
<span>Purchase Calculation as per Kutcha Records / Bills</span>
</div>
<div fxFlex="40" align="right">
<button type="button" mat-flat-button (click)="addMoreItem()" matTooltip="Add More" matTooltipPosition="above"

View File

@ -6,7 +6,7 @@
<mat-card-content>
<div fxLayout="row nowrap">
<div fxFlex="60" align="left">
<span>Sales Calculate Daily Wise</span>
<span>Sales Calculation as per Kutcha Records / Bills</span>
</div>
<div fxFlex="40" align="right">
<button type="button" mat-flat-button (click)="addMoreItem()"

View File

@ -2,7 +2,8 @@
<mat-card-content *ngIf="activateMariginCalculation;else notAvilable">
<div fxLayout="row nowrap">
<div fxFlex="60" align="left">
<span>Purchase Item</span>
<!-- <span>Purchase Item</span> -->
<span>Item-wise Purchase Calculation</span>
</div>
<div fxFlex="40" align="right">
<button type="button" mat-flat-button (click)="addMoreItem()"

View File

@ -5,7 +5,7 @@
<mat-card-content>
<div fxLayout="row nowrap">
<div fxFlex="60" align="left">
<span>Sales Calculate Item Wise</span>
<span>Item-wise Sales Calculation</span>
</div>
<div fxFlex="40" align="right">
<button type="button" mat-flat-button (click)="addMoreItem()"

View File

@ -81,7 +81,7 @@
<input matInput placeholder="Pin" formControlName="residence_pin" required>
</mat-form-field> -->
<mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="No of years in current residence" formControlName="residence_No_of_years"
OnlyNumber type="text" required>
</mat-form-field>

View File

@ -112,7 +112,7 @@
<mat-form-field style="width: 20%;">
<input matInput placeholder="Year" formControlName="rental_income_rcv_in_years" autocomplete="off"
OnlyNumber type="text" required>
<mat-error *ngIf="com.controls['rental_income_rcv_in_years'].invalid">Please Enter Correct Year</mat-error>
<mat-error *ngIf="_generalForm.controls['rental_income_rcv_in_years'].invalid">Please Enter Correct Year</mat-error>
<!-- <mat-error>Please Enter Correct Year</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 20%;">

View File

@ -83,7 +83,7 @@ export class RentalVerificationComponent implements OnInit {
}
// set unit type list details
let resiDentialProperty = [{id:2,name:'Independent Flat',group_id:1},{id:3,name:'Independent Floor',group_id:1},
{id:4,name:'Independent Bungalow',group_id:1},{id:5,name:'Independent Row House',group_id:1},{id:6,name:'Multi Storey Building',group_id:1},{id:1,name:'Other (Please Specify)',group_id:1}];
{id:4,name:'Independent House',group_id:1},{id:5,name:'Independent Row House',group_id:1},{id:6,name:'Multi Storey Building',group_id:1},{id:1,name:'Other (Please Specify)',group_id:1}];
let commercialProperty = [{id:2,name:'Independent Office',group_id:2},{id:3,name:'Independent Shop',group_id:2},{id:4,name:'Warehouse/Godown',group_id:2},
{id:5,name:'Workshop',group_id:2},{id:6,name:'Independent Clinic',group_id:2},{id:7,name:'Multi Storey Building',group_id:2},{id:1,name:'Other (Please Specify)',group_id:2}];
@ -434,7 +434,7 @@ addMoreUnitDetails(){
// generate payment dynamic fields
generatePaymentOptions(value:any,index:number,type: number){
// console.log('generatePaymentOptions',value,index,type);
if(type==1){
let control: any = <FormArray>this._rentalForm.controls['property_unit_details'];
let monthlyrentamt : number = value.monthly_rent_amount ;
@ -483,11 +483,11 @@ addMoreUnitDetails(){
control.controls[index].removeControl('amount_received_bank_per_met');
control.controls[index].removeControl('payment_received_reason_per_met');
}
let child = control.controls[index] as FormGroup;
if(control.controls[index].payment_difference_per_met){
console.log('control.controls[index].payment_difference_per_met);',control.controls[index].payment_difference_per_met);
control.controls[index].payment_difference_per_met.setValue('');
control.controls[index].payment_difference_per_met.updateValueAndValidity();
if(child.controls.payment_difference_per_met){
child.controls.payment_difference_per_met.setValue('');
child.controls.payment_difference_per_met.updateValueAndValidity();
}
else{
console.log('There is NO Control');
@ -968,6 +968,7 @@ saveRental(formData: any) {
let TenantRentAmt : any ;
let TempArray1 : any = [];
let TempArray2 : any = [];
let textMessage : any;
if(formData.property_unit_details.length > 0){
@ -977,6 +978,7 @@ saveRental(formData: any) {
TempArray2[index] = data.paid_monthly_rent_per_met;
TenantRentAmt = TempArray2.reduce((sum, val) => sum + +val, 0);
})
textMessage = 'Monthly Rent as Per Loan Applicant = '+ApplicantRentAmt+'<br>';
}
@ -988,6 +990,10 @@ saveRental(formData: any) {
Array[index] = val.floor_rent_amount;
FloorsTotalRentAmt = Array.reduce((sum, val) => sum + +val, 0);
});
textMessage = textMessage +'Rent amount calculated = '+FloorsTotalRentAmt;
}
else{
textMessage = textMessage +'Monthly Rent amount as Per Tenant met = '+TenantRentAmt;
}
@ -1003,7 +1009,7 @@ saveRental(formData: any) {
Swal({
title: 'Confirm The Rent Amount',
type: 'info',
html: 'Monthly Rent as Per Loan Applicant = '+ApplicantRentAmt+'<br>'+'Monthly Rent amount as Per Lease or Tenant met =' + TenantRentAmt ,
html: textMessage,
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',

View File

@ -96,10 +96,13 @@
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations"
formControlName="is_sufficiant_raw">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option *ngFor="let val of RMsufficientList" [value]="val.value" [disabled]="val.disabled">
{{val.isdisplayvalue}}
</mat-option>
<!-- <mat-option value="yes">Yes</mat-option> -->
<!-- <mat-option value="no">No</mat-option> -->
<!-- <mat-option value="not applicable">Not Applicable</mat-option> -->
<mat-option value="not applicable">Stock not required to be maintained</mat-option>
<!-- <mat-option value="not applicable">Stock not required to be maintained</mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 90%" *ngIf="md.get('is_sufficiant_raw').value == 'no'">
@ -345,9 +348,12 @@
<mat-select placeholder="Is the stock of finished / traded goods observed, sufficient considering the size of operations"
formControlName="is_sufficiant_finished_and_traded_goods">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option *ngFor="let val of TGsufficientList" [value]="val.value" [disabled]="val.isdisabled">
{{val.isdisplayvalue}}
</mat-option>
<!-- <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Stock not required to be maintained</mat-option>
<mat-option value="not applicable">Stock not required to be maintained</mat-option> -->
<!-- <mat-option value="not applicable">Not Applicable</mat-option> -->
</mat-select>
</mat-form-field>

View File

@ -51,6 +51,9 @@ export class StockComponent implements OnInit {
suppliers_finished_goods: any = [];
// suppliers_service_product : any = [];
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 TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
/** Constructor */
constructor(notifier: NotifierService,
private fb: FormBuilder,
@ -756,26 +759,40 @@ export class StockComponent implements OnInit {
checkComments(value, flag, index) {
if (flag == 1) {
this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0;
this.not_stock_of_rm[index] = value == "stock not required to be maintained" ? 1 : 0;
this.ManufacturingCounterArray[index] = value != "" ? 1 : 0;
this.not_stock_of_rm[index] = value == "yes" ? 1 : 0;
let RMOverallCount = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0);
this.RMCommentCard = RMOverallCount > 0 ? true : false;
let not_stock1 = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
if(not_stock1 > 0){ this.stockForms.controls['manufacturing_details']['controls'][0].controls['is_sufficiant_raw'].setValue('not applicable') }
// if(not_stock1 > 0){ this.stockForms.controls['manufacturing_details']['controls'][0].controls['is_sufficiant_raw'].setValue('not applicable') }
if(not_stock1 > 0){
console.log('not_stock1',not_stock1);
this.RMsufficientList[0].disabled = false;
this.RMsufficientList[2].disabled = true;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
}
else if(not_stock1 == 0){
console.log('0',not_stock1);
this.RMsufficientList[0].disabled = true;
this.RMsufficientList[2].disabled = false;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('not applicable');
}
console.log('this.RMsufficientList',this.RMsufficientList);
}
if (flag == 2) {
this.FinishedCounterArray[index] = value == "yes" ? 1 : 0
this.not_stock_of_fg[index] = value == "stock not required to be maintained" ? 1 : 0;
if(flag == 2) {
this.FinishedCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_fg[index] = value == "yes" ? 1 : 0;
}
if (flag == 3) {
this.RetailCounterArray[index] = value == "yes" ? 1 : 0
this.not_stock_of_tg[index] = value == "stock not required to be maintained" ? 1 : 0;
this.RetailCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_tg[index] = value == "yes" ? 1 : 0;
}
if (flag == 4) {
this.WholeSaleCounterArray[index] = value == "yes" ? 1 : 0
this.not_stock_of_ws[index] = value == "stock not required to be maintained" ? 1 : 0;
this.WholeSaleCounterArray[index] = value != "" ? 1 : 0
this.not_stock_of_ws[index] = value == "yes" ? 1 : 0;
}
let FGOverallCount = this.FinishedCounterArray.reduce((sum, val) => sum + +val, 0);
let RTGOverallCount = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
@ -783,20 +800,29 @@ export class StockComponent implements OnInit {
let TGOverallCount = FGOverallCount + RTGOverallCount + WTGOverallCount;
this.TGCommentCard = TGOverallCount > 0 ? true : false;
let not_stock_fg = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
let not_stock_rt = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
let not_stock_tg = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
let not_stock2 = not_stock_fg + not_stock_rt + not_stock_tg;
let not_stock_fg = this.not_stock_of_fg.reduce((sum, val) => sum + +val, 0);
let not_stock_ws = this.not_stock_of_ws.reduce((sum, val) => sum + +val, 0);
let not_stock_tg = this.not_stock_of_tg.reduce((sum, val) => sum + +val, 0);
let not_stock2 = not_stock_fg + not_stock_ws + not_stock_tg;
console.log('not_stock2',not_stock2);
if(not_stock2 > 0){
this.stockForms.controls['is_sufficiant_finished_and_traded_goods'].setValue('not applicable');
console.log('not_stock2',not_stock2);
this.TGsufficientList[0].isdisabled = false;
this.TGsufficientList[2].isdisabled = true;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
}
else if(not_stock2 == 0){
console.log('0',not_stock2);
this.TGsufficientList[0].isdisabled = true;
this.TGsufficientList[2].isdisabled = false;
// this.stockForm.controls['is_sufficiant_finished_and_traded_goods'].setValue('not applicable');
}
console.log('Data',this.TGsufficientList);
// else if(not_stock == 0){
// this.stockForms.controls['is_sufficiant_finished_and_traded_goods'].setValue('');
// }
}
// checkComments(e,flag,index){
// if(flag == 1 && e=='no'){
// this.mrmCommentFlag = true;