From 7e6fe3d8d24579aab5eb1b33018adf7dccc95436 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期三, 17 四月 2024 16:41:22 +0800
Subject: [PATCH] 123
---
force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js | 47 +++++++++++++++++++++++++++++++++++++----------
1 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
index 2dbedd3..040f4ec 100644
--- a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
+++ b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
@@ -1300,6 +1300,14 @@
jzdtbt.pageObject.ServicePrice__c = 0;
jzdtbt.warrantyType__c = '';
var NoDiscountTotal = 0;
+ if(jzdtbt.exPrice != 0 && jzdtbt.exPrice != null && jzdtbt.exPrice != undefined ){
+ jzdtbt.exPriceCopy = jzdtbt.exPrice;
+ }
+ if(jzdtbt.Learning_Community != null && jzdtbt.Learning_Community != undefined && jzdtbt.Learning_Community != '0' && jzdtbt.Learning_Community != ''){
+ jzdtbt.Learning_CommunityCopy = jzdtbt.Learning_Community;
+ }
+ jzdtbt.exPrice = 0;
+ jzdtbt.Learning_Community = '0';
if (GuranteeType == '鏈嶅姟') {
multiYearWarranty = true;
jzdtbt.warrantyType__c = '鏈嶅姟澶氬勾淇濅慨';
@@ -1307,6 +1315,8 @@
} else if (GuranteeType == '甯傚満' && contractmultiYearWarranty == false) {
multiYearWarranty = true;
jzdtbt.pageObject.ServicePrice__c = ServicePrice;
+ jzdtbt.exPrice = jzdtbt.exPriceCopy;
+ jzdtbt.Learning_Community = jzdtbt.Learning_CommunityCopy;
jzdtbt.warrantyType__c = '甯傚満澶氬勾淇濅慨';
warrantyType = '甯傚満澶氬勾淇濅慨';
var Quantity =jzdtbt.Quantity__c;
@@ -1317,6 +1327,8 @@
else if (GuranteeType == '甯傚満' && contractmultiYearWarranty && CanNotCancelledGurantee) {
multiYearWarranty = true;
jzdtbt.pageObject.ServicePrice__c = ServicePrice;
+ jzdtbt.exPrice = jzdtbt.exPriceCopy;
+ jzdtbt.Learning_Community = jzdtbt.Learning_CommunityCopy;
jzdtbt.warrantyType__c = '甯傚満澶氬勾淇濅慨';
warrantyType = '甯傚満澶氬勾淇濅慨';
// 鏁伴噺
@@ -1531,7 +1543,9 @@
//no discount price 鍚堣
var noDiscountPriceTotal = hidden_MultiYearWarrantyTotalPrice;
noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
- TotalPrice = TotalPrice - noDiscountPriceTotal;
+ var exPriceTotal = quo.ExtendedWarrantyAmountTotalPrice__c;
+ exPriceTotal = localParseFloat(exPriceTotal);
+ TotalPrice = TotalPrice - noDiscountPriceTotal - exPriceTotal;
jzDataToBeproduct.forEach(jzdtbt=>{
s = jzdtbt.Quantity__c;
s = localParseInt(s);
@@ -1607,6 +1621,8 @@
x = localParseFloat(x);
var y = quo.hidden_Estimation_List;
y = localParseFloat(y);
+ var z = quo.ExtendedWarrantyAmountTotalPrice__c;
+ z = localParseFloat(z);
var noDiscountPriceTotal = hidden_MultiYearWarrantyTotalPrice;
noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
var thirdPartyEstimation_List_Price = 0;
@@ -1627,11 +1643,11 @@
}
});
thirdPartyEstimation_List_Price = localParseFloat(thirdPartyEstimation_List_Price);
- quo.Quote_Adjust_Amount_Page__c = toNumComma(x - noDiscountPriceTotal - y);
+ quo.Quote_Adjust_Amount_Page__c = toNumComma(x - noDiscountPriceTotal - y - z);
if (y - thirdPartyEstimation_List_Price == 0) {
quo.Quote_Adjust_Calculate__c = toNumComma(0);
} else {
- quo.Quote_Adjust_Calculate__c = toNumComma((x - noDiscountPriceTotal - y) / (y - thirdPartyEstimation_List_Price) * 100);
+ quo.Quote_Adjust_Calculate__c = toNumComma((x - noDiscountPriceTotal - y - z) / (y - thirdPartyEstimation_List_Price) * 100);
}
quoExp = quo;
return jzDataToBeproduct;
@@ -1671,7 +1687,9 @@
//no discount price 鍚堣
var noDiscountPriceTotal = hidden_MultiYearWarrantyTotalPrice;
noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
- var t = (y - noDiscountPriceTotal - thirdPartyEstimation_List_Price) / (Estimation_List_Price - thirdPartyEstimation_List_Price) * 100;
+ var exPriceTotal = quo.ExtendedWarrantyAmountTotalPrice__c;
+ exPriceTotal = localParseFloat(exPriceTotal);
+ var t = (y - noDiscountPriceTotal - exPriceTotal - thirdPartyEstimation_List_Price) / (Estimation_List_Price - thirdPartyEstimation_List_Price) * 100;
quo.AgencyDiscount__c = toNumComma(t);
// j$(escapeVfId('Page:mainForm:block:AgencyDiscount')).val(toNumComma(t));
}
@@ -1799,6 +1817,8 @@
//no discount price 鍚堣
var noDiscountPriceTotal = hidden_MultiYearWarrantyTotalPrice;
noDiscountPriceTotal = localParseFloat(noDiscountPriceTotal);
+ var exPriceTotal = quo.ExtendedWarrantyAmountTotalPrice__c;
+ exPriceTotal = localParseFloat(exPriceTotal);
jzDataToBeproduct.forEach(jzdtbt=>{
s = jzdtbt.Quantity__c;
s = localParseInt(s);
@@ -1840,7 +1860,7 @@
VenderName = '';
}
if (VenderName == 'OSH' || VenderName == '') {
- yy = localParseFloat(x * (z - noDiscountPriceTotal) / y);
+ yy = localParseFloat(x * (z - noDiscountPriceTotal - exPriceTotal) / y);
jzdtbt.pageObject.Subtotal__c = toNum(yy + s * noDiscountPrice);
// jzdtbt.Subtotal__c = toNumComma(yy + s * noDiscountPrice);
jzdtbt.Subtotal__c = yy + s * noDiscountPrice;
@@ -1852,7 +1872,7 @@
zz = zz + yy;
}
});
- quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal);
+ quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal + exPriceTotal);
quoExp = quo;
return jzDataToBeproduct;
}
@@ -1982,6 +2002,7 @@
quo.OCM_Agent1_Price_Page__c = '';
}
quo.MultiYearWarrantyTotalPrice__c = toNumComma(quo.MultiYearWarrantyTotalPrice__c);
+ quo.ExtendedWarrantyAmountTotalPrice__c = toNumComma(quo.ExtendedWarrantyAmountTotalPrice__c);
quo.Agency1_Profit__c = toNumComma(quo.Agency1_Profit__c);
quo.Agency2_Profit__c = toNumComma(quo.Agency2_Profit__c);
//棰勬祴閲戦淇敼 fy
@@ -2227,7 +2248,7 @@
jzdtbt.exPrice = item.MultiOneYearWarrantyPrice__c;
}
});
- if(jzdtbt.exPrice == null || jzdtbt.exPrice == '' || jzdtbt.exPrice == undefined){
+ if(jzdtbt.exPrice == null || jzdtbt.exPrice == '' || jzdtbt.exPrice == undefined || jzdtbt.Learning_Community == '0'){
jzdtbt.exPrice = 0;
}
}
@@ -2335,7 +2356,9 @@
x = localParseFloat(x);
y = y + localParseFloat(x);
});
- quo.QuoteTotal_Page__c = toNumComma(y);
+ var e = quo.ExtendedWarrantyAmountTotalPrice__c;
+ e = localParseFloat(e);
+ quo.QuoteTotal_Page__c = toNumComma(y + e);
var z = quo.Estimation_List_Price__c;
var id = quoId;
// if(!id){
@@ -2345,13 +2368,15 @@
mp = localParseFloat(mp);
var num = quo.Quote_Adjust_Calculate__c;
num = localParseFloat(num);
+ var ex = quo.ExtendedWarrantyAmountTotalPrice__c;
+ ex = localParseFloat(ex);
quo.Quote_Adjust_Calculate__c = toNumComma(num);
num = (100 + num) / 100;
z=localParseFloat(z);
var rh = oppInfo.rate_hospital;
var ra = oppInfo.rate_agency1;
quo.Dealer_Final_Price_Page__c = toNumComma(z*rh);
- quo.OCM_Agent1_Price_Page__c = Saleslet ? toNumComma(z*num*ra+mp) : '';
+ quo.OCM_Agent1_Price_Page__c = Saleslet ? toNumComma(z*num*ra+mp+ex) : '';
}
// }
quoExp = quo;
@@ -2667,7 +2692,9 @@
export function Agent1comput(quo,Saleslet,oppInfo){
var z = quo.Estimation_List_Price__c;
var mp =quo.MultiYearWarrantyTotalPrice__c;
+ var ex = quo.ExtendedWarrantyAmountTotalPrice__c;
mp = localParseFloat(mp);
+ ex = localParseFloat(ex);
var num = quo.Quote_Adjust_Calculate__c;
num = localParseFloat(num);
quo.Quote_Adjust_Calculate__c = toNumComma(num);
@@ -2676,6 +2703,6 @@
var rh = oppInfo.rate_hospital;
var ra = oppInfo.rate_agency1;
quo.Dealer_Final_Price_Page__c = toNumComma(z*rh);
- quo.OCM_Agent1_Price_Page__c = Saleslet ? toNumComma(z*num*ra+mp):'';
+ quo.OCM_Agent1_Price_Page__c = Saleslet ? toNumComma(z*num*ra+mp+ex):'';
return quo;
}
\ No newline at end of file
--
Gitblit v1.9.1