From d99542c680e8da1615ba69c4030dbebec8f6e48e Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 12 四月 2024 10:31:15 +0800
Subject: [PATCH] 123

---
 force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
index b568e2f..73427e0 100644
--- a/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
+++ b/force-app/main/default/lwc/lexNewQuoteEntry/lexNexQuoteEntryUtil.js
@@ -607,6 +607,7 @@
     quo.Dealer_Final_Price_Page__c = quoin.Dealer_Final_Price_Page__c!=undefined&&quoin.Dealer_Final_Price_Page__c!=='' ?localParseFloat(quoin.Dealer_Final_Price_Page__c):null;
     quo.OCM_Agent1_Price_Page__c = quoin.OCM_Agent1_Price_Page__c!=undefined &&quoin.OCM_Agent1_Price_Page__c!==''? localParseFloat(quoin.OCM_Agent1_Price_Page__c):null;
     quo.MultiYearWarrantyTotalPrice__c = quoin.MultiYearWarrantyTotalPrice__c!=undefined? localParseFloat(quoin.MultiYearWarrantyTotalPrice__c):null;
+    quo.ExtendedWarrantyAmountTotalPrice__c = quoin.ExtendedWarrantyAmountTotalPrice__c!=undefined? localParseFloat(quoin.ExtendedWarrantyAmountTotalPrice__c):null;
     quo.Estimation_List_Price__c = quoin.Estimation_List_Price__c!=undefined? localParseFloat(quoin.Estimation_List_Price__c):null;
     quo.QuoteTotal_Page__c = quoin.QuoteTotal_Page__c !=undefined?localParseFloat(quoin.QuoteTotal_Page__c):null;
     quo.Agency1_Profit__c = quoin.Agency1_Profit__c !=undefined?localParseFloat(quoin.Agency1_Profit__c):null;
@@ -1530,7 +1531,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);
@@ -1606,6 +1609,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;
@@ -1626,11 +1631,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 - z - y);
     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 - z - y) / (y - thirdPartyEstimation_List_Price) * 100);
     }
     quoExp = quo;
     return jzDataToBeproduct;
@@ -1670,7 +1675,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));
             }
@@ -1798,6 +1805,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);
@@ -1839,7 +1848,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;
@@ -1851,7 +1860,7 @@
             zz = zz + yy;
         }
     });
-    quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal);
+    quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal + exPriceTotal);
     quoExp = quo;
     return jzDataToBeproduct;
 }
@@ -2650,7 +2659,8 @@
             //DB202312560765 you 鍚︽湁EndoRapid璧勮川妫�鏌� start 
             item.IFEndoRapidFlag = jzdtbt.IFEndoRapidFlag;
             //DB202312560765 you 鍚︽湁EndoRapid璧勮川妫�鏌� end
-            if(jzdtbt.PricebookEntry.Product2.ProductCategory__c == 'SP涓绘満'){
+            var qwe = jzdtbt.PricebookEntry ? jzdtbt.PricebookEntry.Product2.ProductCategory__c : jzdtbt.pageObject.PricebookEntry.Product2.ProductCategory__c;
+            if(qwe == 'SP涓绘満'){
                 item.SPAssistantFlag = true;
                 flag = true;
             }

--
Gitblit v1.9.1