- Sales Calculate Item Wise
+ Item-wise Sales Calculation
-->
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
index a6f32ba02..92ad88032 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
@@ -112,7 +112,7 @@
- Please Enter Correct Year
+ Please Enter Correct Year
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
index db012e129..0a9a1a944 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts
@@ -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 = 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+' ';
}
@@ -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+' '+'Monthly Rent amount as Per Lease or Tenant met =' + TenantRentAmt ,
+ html: textMessage,
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
index 6dc922d5a..afbf9659d 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
@@ -96,10 +96,13 @@
Select
- Yes
- No
+
+ {{val.isdisplayvalue}}
+
+
+
- Stock not required to be maintained
+
@@ -345,9 +348,12 @@
Select
- Yes
+
+ {{val.isdisplayvalue}}
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
index 55552ca56..74a982a3b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
@@ -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;