| | |
| | | } else { |
| | | // 已经存在报价 |
| | | if (String.isNotBlank(oppquoid)) { |
| | | //DB202302464682【报价委托】报价委托改善224 fy start |
| | | Quote quo2 = new Quote(); |
| | | List<Quote> quote = [select Id,Agency1__c,Agency2__c From Quote Where Id =:oppquoid]; |
| | | if(quote.size()>0){ |
| | | quo2=quote[0]; |
| | | } |
| | | quo.Agency1_entrust__c = quo2.Agency1__c; |
| | | quo.Agency2_entrust__c = quo2.Agency2__c; |
| | | //DB202302464682【报价委托】报价委托改善224 fy end |
| | | // 报价商品取得 |
| | | // CHAN-BHNBX6 2019/11/20 START//fy lastbuy 20220310 PricebookEntry.Product2.LastbuyProductFLG__c |
| | | List<QuoteLineItem> qlis = [select id,PricebookEntry.Product2Id,PricebookEntry.Product2.LastbuyProductFLG__c,Quantity__c,CurrencyIsoCode,GuaranteePeriod__c from QuoteLineItem where QuoteId = :oppquoid]; |
| | |
| | | [ SELECT Id,Name,Cancel_Decide__c,Agency_Hospital_Link__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,Agency1_entrust__c,cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Noteplus__c,Lead__c,Opportunity__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Agency2_entrust__c,//DB202302464682【报价委托】报价委托改善224 fy |
| | | Print_HP_Name__c,Account__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | , urgent__c //20230104 lt DB202212427301 |
| | | FROM QuoteIrai__c Where Id =:quoId]; |
| | |
| | | } |
| | | } |
| | | } |
| | | System.debug('---lt123---descriptions---'+descriptions); |
| | | // System.debug('---lt123---descriptions---'+descriptions); |
| | | if (descriptions.size() <= 0) { |
| | | errorflg = true; |
| | | errorMessage = '没有要委托的产品。'; |
| | |
| | | } |
| | | i += 1; |
| | | } |
| | | System.debug('---lt123---description---'+description); |
| | | // System.debug('---lt123---description---'+description); |
| | | //obsap 新增经销商1字段 fy start |
| | | if (!String.isBlank(quo.Agency1_entrust__c)) { |
| | | Account quoteAeName = [select Id,Name from Account where Id =:quo.Agency1_entrust__c]; |
| | |
| | | descriptionsendEmailbody += '\r\n' + '第一经销商名称' + ':' + quoteAeName.Name; |
| | | //20230116 fy end |
| | | } |
| | | //DB202302464682【报价委托】报价委托改善224 fy start |
| | | if (!String.isBlank(quo.Agency2_entrust__c)) { |
| | | Account quoteAeName2 = [select Id,Name from Account where Id =:quo.Agency2_entrust__c]; |
| | | description += '\r\n' + '第二经销商名称' + ':' + quoteAeName2.Name; |
| | | descriptionsendEmailbody += '\r\n' + '第二经销商名称' + ':' + quoteAeName2.Name; |
| | | } |
| | | //DB202302464682【报价委托】报价委托改善224 fy end |
| | | if (quo.QuoteProportion__c!=null) { |
| | | description += '\r\n' + '报价比例' + ':' + quo.QuoteProportion__c; |
| | | //20230116 fy start |
| | |
| | | descriptionsendEmailbody += '\r\n' + '第一经销商' + ':' + baseUrl + '/' + quo.Agency1_entrust__c; |
| | | //20230116 fy end |
| | | } |
| | | //DB202302464682【报价委托】报价委托改善224 fy start |
| | | if (!String.isBlank(quo.Agency2_entrust__c)) { |
| | | description += '\r\n' + '第二经销商' + ':' + baseUrl + '/' + quo.Agency2_entrust__c; |
| | | descriptionsendEmailbody += '\r\n' + '第二经销商' + ':' + baseUrl + '/' + quo.Agency2_entrust__c; |
| | | } |
| | | //DB202302464682【报价委托】报价委托改善224 fy end |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | if (!String.isBlank(tenderid)&&!description.contains('招标项目') ) { |
| | | description += '\r\n' + '招标项目' + ':' + baseUrl + '/' + tenderid; |
| | |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c,Agency2_entrust__c,//DB202302464682【报价委托】报价委托改善224 fy |
| | | Print_HP_Name__c,Account__c,Agency_Hospital_Link__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | , urgent__c //20230104 lt DB202212427301 |
| | | FROM QuoteIrai__c Where Id =:quoId]; |
| | |
| | | if(String.isNotBlank(leadid)){ |
| | | lea.Id = leadid; |
| | | lea.OfferToEntrust__c = 1; |
| | | |
| | | //20230227 lt DB202302251962 start |
| | | Map<Date,String> lm = new Map<Date,String>(); |
| | | for(OlympusCalendar__c oc:[SELECT Id,Date__c FROM OlympusCalendar__c WHERE Date__c =: Date.today()]){ |
| | | lm.put(oc.Date__c,oc.Id); |
| | | } |
| | | String datestr =String.valueOf(Date.today()); |
| | | String dt = lm.get(Date.valueOf(datestr.substring(0,10))); |
| | | |
| | | List<Lead> leadlist = [select Id,FirstDate_Quote_Irai__c from Lead where Id = :leadid]; |
| | | // System.debug('lt123日期1'+ leadlist[0].FirstDate_Quote_Irai__c); |
| | | // System.debug('lt123日期2'+ lea.FirstDate_Quote_Irai__c); |
| | | if(leadlist.size() > 0){ |
| | | if(leadlist[0].FirstDate_Quote_Irai__c == null){ |
| | | lea.FirstDate_Quote_Irai__c = dt; |
| | | } |
| | | } |
| | | //20230227 lt DB202302251962 end |
| | | |
| | | update lea; |
| | | } |
| | | //XLIU-CHY4KW 20220907 lt end |
| | |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | qs = [select Id,Account__c,Agency_Hospital_Link__c,Name,IraiUser__c,IraiSubject__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c, |
| | | Preferential_Trading_Price__c,Discount__c,Pricing__c,Unit_Price__c,Offer_Amount__c,TOTAL__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Preferential_Trading_Price__c,Discount__c,Pricing__c,Unit_Price__c,Offer_Amount__c,TOTAL__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c,Agency2_entrust__c,//DB202302464682【报价委托】报价委托改善224 fy |
| | | Contract__c,Print_HP_Name__c,Quote_Expiration_Date__c,Quote_Comment__c,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | , urgent__c //20230104 lt DB202212427301 |
| | | From QuoteIrai__c Where Id =:quoId]; |
| | |
| | | //obsap 新增经销商1字段 fy staty |
| | | q.Agency1_entrust__c = quo.Agency1_entrust__c; |
| | | //obsap 新增经销商1字段 fy staty |
| | | //DB202302464682【报价委托】报价委托改善224 fy start |
| | | q.Agency2_entrust__c = quo.Agency2_entrust__c; |
| | | //DB202302464682【报价委托】报价委托改善224 fy end |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | q.cancelMultiyearInsurance__c = quo.cancelMultiyearInsurance__c; |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c,Headquarters__c,//DB202301106714 【报价委托改善】OBSAP通知邮件发送邮箱修改 fy Headquarters__c |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c,Agency2_entrust__c,//DB202302464682【报价委托】报价委托改善224 fy |
| | | Print_HP_Name__c,Account__c,Agency_Hospital_Link__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | , urgent__c //20230104 lt DB202212427301 |
| | | FROM QuoteIrai__c Where Id =:q.Id]; |