| | |
| | | Quote_Adjust_Amount__c, Quote_Adjust_Calculate__c, Discount_Amount__c, Discount_Amount_Calculate__c, Installation_location__c, |
| | | QuoteTotal_Page__c, Dealer_Final_Price_Page__c, Quote_Adjust_Amount_Page__c, OCM_Agent1_Price_Page__c, Agent1_Agent2_Price_Page__c |
| | | , AgencyDiscount__c,OCM_Sales_Forecast__c//预测金额修改 fy |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c, |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c,ExtendedWarrantyAmountTotalPrice__c, |
| | | Preferential_Gurantee_Period__c,LineItemCount |
| | | ,IsQuoteTrial__c,OpportunityId,Opportunity.RecordType.DeveloperName |
| | | FROM Quote Where Id = :quoId]; |
| | |
| | | Agency1__c, Agency2__c, Stocking_Price__c, Purchasing_Cost__c, Opportunity_No__c, StageName, |
| | | Agency1__r.Special__c, Agency2__r.Special__c, Account.Parent.Special__c |
| | | , Authorized_DB_No__c, Authorized_Finish_Sales__c, If_Need_Authorize__c |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c,ExtendedWarrantyAmountTotalPrice__c |
| | | , Hospital__c, Department_Class__c |
| | | ,Is_Corrosion__c, |
| | | If_Need_PriceApply__c |
| | |
| | | |
| | | // } |
| | | @AuraEnabled |
| | | public static Map<String,Map<String,List<OptionTemplete>>> addOptions(List<String> idList){ |
| | | Map<String,Integer> intList = new Map<String,Integer>(); |
| | | for(AggregateResult objAgr: [select ProductName__c,COUNT(Id) total from MultiYearWarranty__c where ProductName__c in:idList group by ProductName__c]){ |
| | | intList.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total')); |
| | | } |
| | | public static Map<String,Object> addOptions(List<String> idList){ |
| | | // Map<String,Integer> intList = new Map<String,Integer>(); |
| | | // for(AggregateResult objAgr: [select ProductName__c,COUNT(Id) total from MultiYearWarranty__c where ProductName__c in:idList group by ProductName__c]){ |
| | | // intList.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total')); |
| | | // } |
| | | // Map<String,List<OptionTemplete>> optionMap = new Map<String,List<OptionTemplete>>(); |
| | | // Map<String,Object> allMap = new Map<String,Object>(); |
| | | // Map<String,List<MultiYearWarranty__c>> priceMap = new Map<String,List<MultiYearWarranty__c>>(); |
| | | // for(String id: idList){ |
| | | // List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | // optionTempleteList.add(new OptionTemplete('0年','0')); |
| | | // if(intList.containsKey(id)){ |
| | | // for(Integer j = 0;j < intList.get(id);j++){ |
| | | // optionTempleteList.add(new OptionTemplete((j + 1) + '年',(j + 1) + '')); |
| | | // } |
| | | // optionMap.put(id,optionTempleteList); |
| | | // }else { |
| | | // optionMap.put(id,optionTempleteList); |
| | | // } |
| | | // } |
| | | // allMap.put('optionMap',optionMap); |
| | | Map<String,Object> allMap = new Map<String,Object>(); |
| | | Map<String,List<MultiYearWarranty__c>> priceMap = new Map<String,List<MultiYearWarranty__c>>(); |
| | | Map<String,List<OptionTemplete>> optionMap = new Map<String,List<OptionTemplete>>(); |
| | | List<MultiYearWarranty__c> muList = [select Id,ProductName__c,MultiOneYearWarrantyPrice__c,AmountWithheld__c,AgeLimit__c from MultiYearWarranty__c where ProductName__c in:idList order by AgeLimit__c]; |
| | | for(String id: idList){ |
| | | List<MultiYearWarranty__c> muList1 = new List<MultiYearWarranty__c>(); |
| | | for(MultiYearWarranty__c mu : muList){ |
| | | if(mu.ProductName__c == id){ |
| | | muList1.add(mu); |
| | | } |
| | | } |
| | | priceMap.put(id,muList1); |
| | | } |
| | | allMap.put('priceMap',priceMap); |
| | | for(String id: idList){ |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','')); |
| | | if(intList.containsKey(id)){ |
| | | for(Integer j = 0;j < intList.get(id);j++){ |
| | | optionTempleteList.add(new OptionTemplete((j + 1) + '年',(j + 1) + '')); |
| | | } |
| | | optionMap.put(id,optionTempleteList); |
| | | }else { |
| | | optionMap.put(id,optionTempleteList); |
| | | optionTempleteList.add(new OptionTemplete('0年','0')); |
| | | for(MultiYearWarranty__c mu: priceMap.get(id)){ |
| | | optionTempleteList.add(new OptionTemplete(mu.AgeLimit__c + '年',mu.AgeLimit__c + '')); |
| | | } |
| | | optionMap.put(id,optionTempleteList); |
| | | } |
| | | return optionMap; |
| | | allMap.put('optionMap',optionMap); |
| | | return allMap; |
| | | } |
| | | // chenjingwu 20240409 end |
| | | // DB202311242191 【报价单】报价单合同金额更新和生成新报价单规则确认和修改 fy start |
| | |
| | | if(quo.MultiYearWarrantyTotalPrice__c==null){ |
| | | quo.MultiYearWarrantyTotalPrice__c=0; |
| | | } |
| | | sumContractAmount = AccrualTotal+quo.MultiYearWarrantyTotalPrice__c; |
| | | if(quo.ExtendedWarrantyAmountTotalPrice__c==null){ |
| | | quo.ExtendedWarrantyAmountTotalPrice__c=0; |
| | | } |
| | | |
| | | sumContractAmount = AccrualTotal+quo.MultiYearWarrantyTotalPrice__c+quo.ExtendedWarrantyAmountTotalPrice__c; |
| | | if(quo.OCM_Agent1_Price_Page__c<=sumContractAmount){ |
| | | error = true; |
| | | errorflg = true; |
| | |
| | | Agency2__c, Agent1_Agent2_Price__c, Agency2_Profit__c, Agency2_Profit_Rate__c, |
| | | Preferential_Trading_Price__c, Discount__c, Pricing__c, Unit_Price__c, Offer_Amount__c, TOTAL__c, |
| | | Contract__c, Print_HP_Name__c, Quote_Expiration_Date__c, Quote_Comment__c, OCM_Sales_Forecast__c, Installation_location__c, HasType3Machine__c |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c |
| | | , Gurantee_Period__c , multiYearWarranty__c, MultiYearWarrantyTotalPrice__c,ExtendedWarrantyAmountTotalPrice__c |
| | | , Preferential_Gurantee_Period__c |
| | | ,IsQuoteTrial__c |
| | | From Quote Where Id = :quoId]; |
| | |
| | | q.Gurantee_Period__c = quo.Gurantee_Period__c; |
| | | q.multiYearWarranty__c = quo.multiYearWarranty__c; |
| | | q.MultiYearWarrantyTotalPrice__c = quo.MultiYearWarrantyTotalPrice__c; |
| | | q.ExtendedWarrantyAmountTotalPrice__c = quo.ExtendedWarrantyAmountTotalPrice__c; |
| | | q.quoteSavedDate__c = Date.today(); |
| | | q.Agency1_Profit_Rate__c = quo.Agency1_Profit_Rate__c; |
| | | q.Agency2__c = opp.Agency2__c; |
| | |
| | | ql.UnitPrice__c = ql.UnitPrice_Page__c; |
| | | ql.UnitPrice_Page__c = 0; |
| | | ql.ListPrice__c = s.ListPrice_Page; |
| | | ql.ExtendedWarrantyAmount__c = s.exPrice; |
| | | ql.GuranteePrice__c = s.GuranteePrice; |
| | | ql.ProductGuranteePrice__c = s.ProductGuranteePrice; |
| | | ql.Maintenance_Price_Year__c = s.Maintenance_Price_Year; |
| | |
| | | o.Gurantee_Period__c = quo.Gurantee_Period__c ; |
| | | o.multiYearWarranty__c = quo.multiYearWarranty__c ; |
| | | o.MultiYearWarrantyTotalPrice__c = quo.MultiYearWarrantyTotalPrice__c ; |
| | | o.ExtendedWarrantyAmountTotalPrice__c = quo.ExtendedWarrantyAmountTotalPrice__c; |
| | | o.quoteSavedDate__c = Date.today(); |
| | | o.OlyNumberHosts__c = 0; |
| | | List<String> oppIds = New List<String>(); |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | ,Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | ,ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | ,Estimated_ConsumptionDueDate__c |
| | | //DB202312560765 you 否有EndoRapid资质检查 start |
| | | ,IFEndoRapidFlag__c |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | , prd.Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | , 0 |
| | | ,prd.ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | //fy DB202312538864 2024.02.02 start |
| | | ,prd.LastbuyProductFLG__c |
| | | ,prd.whetherOldCode_PrePro__c |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | , prd.Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | , 0 |
| | | ,prd.ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | //fy DB202312538864 2024.02.02 start |
| | | ,prd.LastbuyProductFLG__c |
| | | ,prd.whetherOldCode_PrePro__c |
| | |
| | | List<string> xlslist = New list<string>(); |
| | | List<string> codelist = New List<string>(); |
| | | List<Integer> Quantitylist = New List<Integer>(); |
| | | // chenjingwu 20240411 start |
| | | List<Integer> exYearList = New List<Integer>(); |
| | | Integer xlsExYear; |
| | | // chenjingwu 20240411 end |
| | | //String str ; |
| | | |
| | | Map<String, Integer> mp = new Map<String, Integer>(); |
| | |
| | | system.debug('xlslist+++'+xlslist); |
| | | for (String s : xlslist) { |
| | | //odd number or even number |
| | | if (math.mod(i, 2) != 0) { |
| | | // chenjingwu 20240411 start |
| | | if (math.mod(i, 3) == 1) { |
| | | system.debug('xlslist1+++'+s); |
| | | //odd number |
| | | if (s == '' || s == null) { |
| | |
| | | xlsQuantity = Integer.valueOf(s); |
| | | Quantitylist.add(xlsQuantity); |
| | | } |
| | | } else { |
| | | } else if(math.mod(i, 3) == 0){ |
| | | system.debug('xlslist2+++'+s); |
| | | //even number |
| | | if (s == '' || s == null) { |
| | |
| | | codelist.add(s); |
| | | xlscode = s; |
| | | } |
| | | }else if(math.mod(i, 3) == 2){ |
| | | //even number |
| | | if (s == '' || s == null) { |
| | | errorflg = true; |
| | | errormessage = System.Label.Error_Message31; |
| | | activities = tmpactivities; |
| | | // pageArrange(); |
| | | return errormessage+'---'+JSON.serialize(activities); |
| | | } else { |
| | | s = s.trim(); |
| | | xlsExYear = Integer.valueOf(s); |
| | | exYearList.add(xlsExYear); |
| | | } |
| | | // chenjingwu 20240411 end |
| | | } |
| | | i++; |
| | | } |
| | |
| | | |
| | | system.debug(j); |
| | | system.debug('xlscnt:::::' + xlscnt); |
| | | |
| | | if (codelist.size() == 0 || Quantitylist.size() == 0) { |
| | | // chenjingwu 20240411 start |
| | | if (codelist.size() == 0 || Quantitylist.size() == 0 || exYearList.size() == 0) { |
| | | // chenjingwu 20240411 end |
| | | activities = tmpactivities; |
| | | errorflg = true; |
| | | system.debug('codelist+++'+codelist); |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | ,Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | ,ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | ,Estimated_ConsumptionDueDate__c |
| | | //DB202312560765 you 否有EndoRapid资质检查 start |
| | | ,IFEndoRapidFlag__c |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | , prd.Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | , exYearList[l] |
| | | ,prd.ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | //fy DB202312538864 2024.02.02 start |
| | | ,prd.LastbuyProductFLG__c |
| | | ,prd.whetherOldCode_PrePro__c |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | , prd.Category5__c |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | , exYearList[l] |
| | | , prd.ProductCategory__c |
| | | //chenjingwu 20240411 end |
| | | //fy DB202312538864 2024.02.02 start |
| | | ,prd.LastbuyProductFLG__c |
| | | ,prd.whetherOldCode_PrePro__c |
| | |
| | | // chenjingwu sp主机类型 20240318 start |
| | | public String SPAssistant; |
| | | public Boolean SPAssistantFlag; |
| | | public String ProductCategory; |
| | | // chenjingwu sp主机类型 20240318 end |
| | | // chenjingwu 3+2多年保 20240401 start |
| | | public String Learning_Community; |
| | | public String Learning_CommunityCopy; |
| | | public Decimal exPrice; |
| | | public Decimal exPriceCopy; |
| | | // public List<Map<String, String>> Learning_CommunityOptions = new List<Map<String, String>>(); |
| | | public List<OptionTemplete> Learning_CommunityOptions; |
| | | public List<MultiYearWarranty__c> multiYearWarrantyList; |
| | |
| | | Category5 = qli.PricebookEntry.Product2.Category5__c; |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | // chenjingwu SP主机类型 20240318 start |
| | | this.ProductCategory = qli.PricebookEntry.Product2.ProductCategory__c; |
| | | if(qli.PricebookEntry.Product2.ProductCategory__c == 'SP主机'){ |
| | | this.SPAssistantFlag = true; |
| | | } |
| | |
| | | if(qli.ExtendedWarrantyPeriod__c != null && qli.ExtendedWarrantyPeriod__c != 0){ |
| | | this.Learning_Community = String.valueof(qli.ExtendedWarrantyPeriod__c); |
| | | } |
| | | this.multiYearWarrantyList = [select Id,MultiOneYearWarrantyPrice__c,AmountWithheld__c from MultiYearWarranty__c where ProductName__c =: qli.PricebookEntry.Product2Id]; |
| | | this.multiYearWarrantyList = [select Id,MultiOneYearWarrantyPrice__c,AmountWithheld__c,AgeLimit__c from MultiYearWarranty__c where ProductName__c =: qli.PricebookEntry.Product2Id order by AgeLimit__c]; |
| | | Integer period = this.multiYearWarrantyList.size(); |
| | | if(period > 0){ |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','')); |
| | | for(Integer j = 0;j < period;j++){ |
| | | optionTempleteList.add(new OptionTemplete((j + 1) + '年',(j + 1) + '')); |
| | | if(qli.ExtendedWarrantyPeriod__c != null && qli.ExtendedWarrantyPeriod__c != 0){ |
| | | for(MultiYearWarranty__c mu: this.multiYearWarrantyList){ |
| | | if(mu.AgeLimit__c == qli.ExtendedWarrantyPeriod__c){ |
| | | this.exPrice = mu.MultiOneYearWarrantyPrice__c; |
| | | } |
| | | } |
| | | this.Learning_CommunityOptions = optionTempleteList; |
| | | }else{ |
| | | this.Learning_Community = 0 + ''; |
| | | this.exPrice = 0; |
| | | } |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','0')); |
| | | if(period > 0){ |
| | | for(MultiYearWarranty__c mu: this.multiYearWarrantyList){ |
| | | optionTempleteList.add(new OptionTemplete(mu.AgeLimit__c + '年',mu.AgeLimit__c + '')); |
| | | } |
| | | // for(Integer j = 0;j < period;j++){ |
| | | // optionTempleteList.add(new OptionTemplete((j + 1) + '年',(j + 1) + '')); |
| | | // } |
| | | } |
| | | this.Learning_CommunityOptions = optionTempleteList; |
| | | if(qli.ExtendedWarrantyPeriod__c == null && this.Learning_CommunityOptions.size() > 1){ |
| | | this.Learning_Community = this.multiYearWarrantyList.get(this.multiYearWarrantyList.size() - 1).AgeLimit__c + ''; |
| | | this.exPrice = this.multiYearWarrantyList.get(this.multiYearWarrantyList.size() - 1).MultiOneYearWarrantyPrice__c; |
| | | } |
| | | |
| | | // this.ExtendedWarrantyPeriod = new WarrantyPeriod(optionTempleteList,''); |
| | |
| | | //chenjingwu DB202308355043 2023.8.25 start |
| | | ,String Category5 |
| | | //chenjingwu DB202308355043 2023.8.25 end |
| | | //chenjingwu 20240411 start |
| | | , Integer exYear |
| | | ,String ProductCategory |
| | | //chenjingwu 20240411 end |
| | | //fy DB202312538864 2024.02.02 start |
| | | ,Boolean lastbuyProductFLG |
| | | ,Boolean whetherOldCode_PrePro |
| | |
| | | ) { |
| | | pageObject = New QuoteLineItem(); |
| | | pageObject.Quantity__c = Quantity; |
| | | //chenjingwu 20240411 start |
| | | this.Learning_Community = String.valueof(exYear); |
| | | this.ProductCategory = ProductCategory; |
| | | //chenjingwu 20240411 end |
| | | this.lineNo = i; |
| | | this.Asset_Model = Asset_Model; |
| | | this.Sales_Possibility = Sales_Possibility_c; |