| | |
| | | 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; |
| | |
| | | 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 = '服务多年保修'; |
| | |
| | | } 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; |
| | |
| | | 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 = '市场多年保修'; |
| | | // 数量 |
| | | var Quantity = jzdtbt.Quantity__c; |
| | | MultiYearWarrantyTotalPrice__c = MultiYearWarrantyTotalPrice__c + localParseFloat(ServicePrice) * localParseFloat(Quantity); |
| | | ExtendedWarrantyAmountTotalPrice__c = ExtendedWarrantyAmountTotalPrice__c + localParseFloat(jzdtbt.exPrice) * localParseFloat(Quantity); |
| | | // MultiYearWarrantyTotalPrice__c = MultiYearWarrantyTotalPrice__c + localParseFloat(ServicePrice) * localParseFloat(Quantity); |
| | | // ExtendedWarrantyAmountTotalPrice__c = ExtendedWarrantyAmountTotalPrice__c + localParseFloat(jzdtbt.exPrice) * localParseFloat(Quantity); |
| | | NoDiscountTotal = localParseFloat(ServicePrice) * localParseFloat(Quantity); |
| | | } |
| | | else if (GuranteeType == '市场') { |
| | |
| | | //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); |
| | |
| | | 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; |
| | |
| | | } |
| | | }); |
| | | 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; |
| | |
| | | //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)); |
| | | } |
| | |
| | | //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); |
| | |
| | | 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; |
| | |
| | | zz = zz + yy; |
| | | } |
| | | }); |
| | | quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal); |
| | | quo.QuoteTotal_Page__c = toNumComma(zz + noDiscountPriceTotal + exPriceTotal); |
| | | quoExp = quo; |
| | | return jzDataToBeproduct; |
| | | } |
| | |
| | | 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 |
| | |
| | | quoc:quoCan}; |
| | | } |
| | | export function onsaveToBeproductLoc(data,jzDataToBeproduct){ |
| | | debugger |
| | | var dataMap = new Map(); |
| | | var fag = false; |
| | | data.forEach(item=>{ |
| | |
| | | dataMap.set(key,value); |
| | | }); |
| | | jzDataToBeproduct.forEach(jzdtbt=>{ |
| | | var x, y, z, c; |
| | | var x, y, z, c ,e; |
| | | if(dataMap.has(jzdtbt.lineNo)){ |
| | | var datavaue = dataMap.get(jzdtbt.lineNo); |
| | | if(datavaue.Quantity__c){ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | console.log("saf"); |
| | | x = localParseInt(jzdtbt.Quantity__c); |
| | | y = localParseFloat(jzdtbt.UnitPrice_Page__c); |
| | | c = localParseFloat(jzdtbt.Cost_c); |
| | |
| | | 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){ |
| | |
| | | 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; |
| | |
| | | //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; |
| | | } |
| | |
| | | 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); |
| | |
| | | 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; |
| | | } |