| | |
| | | public Boolean printAgent { get; private set; } |
| | | public boolean inDicideFlag {get; set;} //作为补充,对应报价决定之后,却未能讲合同起止日期传递给合同的问题 |
| | | public String isPaymentSet {get; set;} |
| | | // 报价规则改善 20230309 start |
| | | // public Boolean Is_Blank_period {get; set;} |
| | | // public String Cost_rate_ForecastF{get;set;} |
| | | // public String PastContractendday{get;set;} |
| | | // 报价规则改善 20230309 end |
| | | //public String PaymentSet {get;set;} |
| | | // 引数のサービス契約の情報を格納する。 |
| | | public Maintenance_Contract__c contract { get; private set; } |
| | |
| | | public Decimal Denominator {get; set; } |
| | | public Decimal Accrued {get; set; } |
| | | public String ProductModel{get;set;} |
| | | // public String Category{get;set;} |
| | | public String Category{get;set;} |
| | | public Decimal Consumption_rate_Gurante{get;set;} |
| | | |
| | | |
| | |
| | | //URF限次合同2期 LY 20220811 end |
| | | |
| | | //多年保设备续签计算逻辑调整 2022/12/14 start 消费率 |
| | | +'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,Product2.Category4__c,Product2.Asset_Model_No__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,' |
| | | +'CurrentContract_F_asset__r.IS_VMContract_Asset__c,' |
| | | +'CurrentContract_F__r.endDateGurantee__c,' |
| | | // +'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,Product2.Category4__c,Product2.Asset_Model_No__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,' |
| | | // +'CurrentContract_F_asset__r.IS_VMContract_Asset__c,' |
| | | // +'CurrentContract_F__r.endDateGurantee__c,' |
| | | //多年保设备续签计算逻辑调整 2022/12/14 end |
| | | |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c,NoPartRiskDate_F__c,NoPartRiskDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' '; |
| | |
| | | , Maintenance_Contract__r.Open_RenewalQuotation__c,Maintenance_Contract__r.VM_Contract_Check__c |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220419 end' |
| | | //LJPH-C9SCX7 【委托】合同无空白期的提醒 lt 20211221 start |
| | | //, Maintenance_Contract__r.Past_Contract_end_day__c //过去合同结束日 |
| | | // 报价规则改善20230314 start |
| | | // , Maintenance_Contract__r.Past_Contract_end_day__c //过去合同结束日 |
| | | // ,renewTen_OFF__c |
| | | // 报价规则改善20230314 end |
| | | //LJPH-C9SCX7 【委托】合同无空白期的提醒 lt 20211221 end |
| | | // URF限次合同2期 LY 20220811 start |
| | | ,URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c |
| | |
| | | , URF_Maintenance_Contract__r.Management_Code__c |
| | | , URF_Maintenance_Contract__r.Contract_End_Date__c |
| | | //URF限次合同2期 LY 20220811 end |
| | | |
| | | // 报价规则改善 20230315 start |
| | | // ,IS_StandardPricing__c |
| | | // 报价规则改善 20230315 end |
| | | //多年保设备续签计算逻辑调整 2023/1/17 start |
| | | ,CurrentContract_F_asset__r.Asset_Consumption_Rate__c |
| | | ,CurrentContract_F_asset__r.Maintenance_Price_Year__c |
| | | ,CurrentContract_F_asset__r.IS_VMContract_Asset__c |
| | | ,Product2.Asset_Model_No__c |
| | | ,Product2.Category4__c |
| | | ,CurrentContract_F__r.endDateGurantee__c |
| | | // ,CurrentContract_F_asset__r.Asset_Consumption_Rate__c |
| | | // ,CurrentContract_F_asset__r.Maintenance_Price_Year__c |
| | | // ,CurrentContract_F_asset__r.IS_VMContract_Asset__c |
| | | // ,Product2.Asset_Model_No__c |
| | | // ,Product2.Category4__c |
| | | // ,CurrentContract_F__r.endDateGurantee__c |
| | | //添加是否服务多年保修,多年保维修期至 |
| | | // ,IS_Extend_Gurantee__c,Extend_Gurantee_DateTo__c |
| | | //多年保设备续签计算逻辑调整 2023/1/17 end |
| | | FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty_Service__c asc]; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | |
| | | }else{ |
| | | this.isLimitPrice = false; |
| | | } |
| | | // 上限合同 hql 20230216 start |
| | | // 上限合同 hql 20230216 end |
| | | // 报价规则改善 20230309 start |
| | | // Maintenance_Contract__c mc1 = [SELECT id,Is_Blank_period__c,Cost_rate_ForecastF__c FROM Maintenance_Contract__c WHERE Id =: this.targetMaintenanceContractId]; |
| | | // Boolean IsBlankperiod = mc1.Is_Blank_period__c; |
| | | // this.Cost_rate_ForecastF = mc1.Cost_rate_ForecastF__c; |
| | | // if(IsBlankperiod){ |
| | | // this.Is_Blank_period = true; |
| | | // }else{ |
| | | // this.Is_Blank_period = false; |
| | | // } |
| | | // 报价规则改善 20230309 end |
| | | // 選択済みの納入機器情報を取得 |
| | | Map<Id, Integer> selectedAssetIds = new Map<Id, Integer>(); |
| | | List<Maintenance_Contract_Asset_Estimate__c> selectedMcaes = new List<Maintenance_Contract_Asset_Estimate__c>(); |
| | |
| | | Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, |
| | | Asset__r.CurrentContract_F_asset__r.endDateGurantee_Text__c, |
| | | //多年保设备续签计算逻辑调整 2023/1/18 start 设备消费率 |
| | | Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c, |
| | | Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c, |
| | | Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c, |
| | | Asset__r.Product2.Asset_Model_No__c, |
| | | Asset__r.Product2.Category4__c, |
| | | Asset__r.CurrentContract_F__r.endDateGurantee__c, |
| | | // Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c, |
| | | // Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c, |
| | | // Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c, |
| | | // Asset__r.Product2.Asset_Model_No__c, |
| | | // Asset__r.Product2.Category4__c, |
| | | // Asset__r.CurrentContract_F__r.endDateGurantee__c, |
| | | //多年保设备续签计算逻辑调整 2022/1/18 end |
| | | Asset__r.CurrentContract_F__r.First_Estimate_Date__c, |
| | | Asset__r.CurrentContract_F__r.Contract_Consumption_rate__c, |
| | |
| | | Asset__r.EquipmentGuaranteeFlg__c, |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start |
| | | Asset__r.OwnershipMachine_No__c, |
| | | Product_Manual__r.Category4__c, |
| | | // Product_Manual__r.Category4__c, |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | Asset_Consumption_rate__c, |
| | | Asset__r.CurrentContract_F__c, |
| | |
| | | Adjustment_Lower_price__c, |
| | | Adjustment_Upper_price__c, |
| | | // 服务合同报价规则改善 20230227 start |
| | | IS_StandardPricing__c, |
| | | // IS_StandardPricing__c, |
| | | // 服务合同报价规则改善 20230227 end |
| | | Last_inspection_day__c, |
| | | Check_Result__c, |
| | |
| | | Repair_Price_Auto__c, |
| | | Third_Party_Return__c, |
| | | // (2022年12月上线)故障品加费 end |
| | | // 报价规则改善 20230308 start |
| | | // Blank_period__c, |
| | | // 报价规则改善 20230308 end |
| | | Comment__c, |
| | | Asset__r.Posting_Date__c, |
| | | EquipmentGuaranteeFlgTxt__c, |
| | |
| | | // Gzw 20200807 五个去年合同相关,所以报价产品,获取上期合同 eng |
| | | // LJPH-C9GD34 gzw fix start |
| | | //市场多年保修价格开发 2023/01/28 start |
| | | ,Asset__r.Product2.Asset_Model_No__c |
| | | ,Asset__r.Product2.Category4__c |
| | | ,Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c |
| | | ,Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c |
| | | ,Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c |
| | | ,Asset__r.CurrentContract_F__r.endDateGurantee__c |
| | | // ,Asset__r.Product2.Asset_Model_No__c |
| | | // ,Asset__r.Product2.Category4__c |
| | | // ,Asset__r.CurrentContract_F_asset__r.Asset_Consumption_Rate__c |
| | | // ,Asset__r.CurrentContract_F_asset__r.Maintenance_Price_Year__c |
| | | // ,Asset__r.CurrentContract_F_asset__r.IS_VMContract_Asset__c |
| | | // ,Asset__r.CurrentContract_F__r.endDateGurantee__c |
| | | //市场多年保修价格开发 2023/01/28 end |
| | | |
| | | ,Estimate_List_Price_Page__c |
| | |
| | | // Map<String,repair__c> assNewRepMap = new Map<String,repair__c>(); |
| | | // assNewRepMap = getNewrep(this.assetRecords); |
| | | datatemp = getChartData(); |
| | | // System.debug(LoggingLevel.INFO, '*** this.assetRecords: ' + this.assetRecords); |
| | | for (Asset ast : this.assetRecords) { |
| | | Boolean isNew = false; |
| | | Decimal listPrice = ast.Maintenance_Price_Month__c; |
| | |
| | | // |
| | | // |
| | | // |
| | | // ast.CurrentContract_End_Date__c = ast.CurrentContract_F_asset__r.IS_VMContract_Asset__c ? ast.Extend_Gurantee_DateTo__c : ast.CurrentContract_End_Date__c; |
| | | checkedAssets.add(new AssetInfo(checkedAssets.size(), ast, isNew, listPrice, selectedLocal,estimate)); |
| | | |
| | | } else { |
| | | //update by rentongxiao 2020-09-23 start |
| | | if (ast.AssetMark__c == '主机') { |
| | |
| | | } |
| | | */ |
| | | } |
| | | |
| | | // System.debug(LoggingLevel.INFO, '*** checkedAssets: ' + checkedAssets); |
| | | totalPage = (totalRecords / selctRecordNum) + (Math.mod(totalRecords, selctRecordNum) > 0 ? 1 : 0); |
| | | |
| | | system.debug('顺序检测' + checkedAssets); |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start |
| | | List<AssetInfo> topAsset =new List<AssetInfo>(); |
| | | List<AssetInfo> otherAsset =new List<AssetInfo>(); |
| | | |
| | | // System.debug(LoggingLevel.INFO, '*** 顺序: ' + checkedAssets); |
| | | for(AssetInfo ched : checkedAssets){ |
| | | system.debug('顺序检测2' + ched.ProductModelNoc); |
| | | system.debug('顺序检测3' + ched.AssetModelNoc); |
| | |
| | | } |
| | | checkedAssets=NumberSort; |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | // System.debug(LoggingLevel.INFO, '*** checkedAssetsEND: ' + checkedAssets); |
| | | } |
| | | |
| | | // |
| | |
| | | + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,' |
| | | //URF限次合同2期 LY 20220811 end |
| | | //市场多年保价格开发 start DC 2023/01/17 设备消费率 产品型号 第四分类 是否为多年保设备 |
| | | + 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,' |
| | | + 'CurrentContract_F_asset__r.Maintenance_Price_Year__c,' |
| | | + 'CurrentContract_F_asset__r.IS_VMContract_Asset__c,' |
| | | + 'Product2.Asset_Model_No__c,' |
| | | + 'Product2.Category4__c,' |
| | | + 'CurrentContract_F__r.endDateGurantee__c,' |
| | | // + 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,' |
| | | // + 'CurrentContract_F_asset__r.Maintenance_Price_Year__c,' |
| | | // + 'CurrentContract_F_asset__r.IS_VMContract_Asset__c,' |
| | | // + 'Product2.Asset_Model_No__c,' |
| | | // + 'Product2.Category4__c,' |
| | | // + 'CurrentContract_F__r.endDateGurantee__c,' |
| | | //市场多年保价格开发 end DC 2023/01/17 |
| | | + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' ' |
| | | + 'AND Id NOT IN ' + notInId; |
| | |
| | | //URF限次合同2期 LY 20220811 end |
| | | |
| | | //市场多年保价格开发 start DC 2023/01/17 设备消费率 |
| | | sqlStr += 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,CurrentContract_F_asset__r.IS_VMContract_Asset__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,Product2.Asset_Model_No__c,Product2.Category4__c,CurrentContract_F__r.endDateGurantee__c,'; |
| | | // sqlStr += 'CurrentContract_F_asset__r.Asset_Consumption_Rate__c,CurrentContract_F_asset__r.IS_VMContract_Asset__c,CurrentContract_F_asset__r.Maintenance_Price_Year__c,Product2.Asset_Model_No__c,Product2.Category4__c,CurrentContract_F__r.endDateGurantee__c,'; |
| | | //市场多年保价格开发 start DC 2023/01/17 |
| | | |
| | | sqlStr += ' CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\''; |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c > :LastYearDate |
| | | and Agreed_Date__c <= :today |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | List<AggregateResult> SecRepairList = [ |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :LastYearDate |
| | | and Agreed_Date__c > :LastSecondYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | // 过去3年间修理实绩 |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :LastSecondYearDate |
| | | and Agreed_Date__c > :LastThirdYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | // 过去3年修理实绩 |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :today |
| | | and Agreed_Date__c > :LastThirdYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c > :LastYearDate |
| | | and Agreed_Date__c <= :today |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | List<AggregateResult> SecRepairList = [ |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :LastYearDate |
| | | and Agreed_Date__c > :LastSecondYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | // 过去3年间修理实绩 |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :LastSecondYearDate |
| | | and Agreed_Date__c > :LastThirdYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | // 过去3年修理实绩 |
| | |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :today |
| | | and Agreed_Date__c > :LastThirdYearDate |
| | | // DB202302544421 LHJ add |
| | | and Status2__c !='00.删除' |
| | | and Status2__c !='00.取消' |
| | | group by Delivered_Product__c |
| | | ]; |
| | | // 过去1年间 |
| | |
| | | if (newValue.size() > 0) insert newValue; |
| | | } |
| | | // ④ start |
| | | // 报价规则改善 20230309 start |
| | | // this.contract.Is_Blank_period__c = this.Is_Blank_period; |
| | | // 报价规则改善 20230309 end |
| | | this.contract.Estimation_Id__c = this.targetEstimateId; |
| | | this.contract.Contract_Esti_Start_Date__c = this.estimate.Contract_Esti_Start_Date__c; |
| | | this.contract.Contract_Range__c = this.estimate.Contract_Range__c; |
| | |
| | | //2.一年以上的合同,在结束前6个月开始可以开放续签报价。 |
| | | //3.管理员跳过, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220413 |
| | | // if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && |
| | | // String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') { |
| | | if (input.rec.CurrentContract_F__r.Open_RenewalQuotation__c == false && UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && |
| | | String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c != 'VM_Contract') { |
| | | |
| | | // Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F__r.Contract_End_Date__c); |
| | | // Decimal monthCon = (Decimal)noOfDays / 365 * 12; |
| | | // // 可开始报价的月数限制 |
| | | // if (input.rec.CurrentContract_F__r.Contract_Range__c >= 12 && monthCon > 6) { |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 合同结束前6个月开始可以制作报价。'); |
| | | // rtn = false; |
| | | // } |
| | | // //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + monthCon + ' +++ ' + Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c/2))); |
| | | // //rtn = false; |
| | | // if (input.rec.CurrentContract_F__r.Contract_Range__c < 12 && monthCon > Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c / 2)) { |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 经历月数过半方可制作报价'); |
| | | // rtn = false; |
| | | // } |
| | | // } |
| | | Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F__r.Contract_End_Date__c); |
| | | Decimal monthCon = (Decimal)noOfDays / 365 * 12; |
| | | // 可开始报价的月数限制 |
| | | if (input.rec.CurrentContract_F__r.Contract_Range__c >= 12 && monthCon > 6) { |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 合同结束前6个月开始可以制作报价。'); |
| | | rtn = false; |
| | | } |
| | | //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + monthCon + ' +++ ' + Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c/2))); |
| | | //rtn = false; |
| | | if (input.rec.CurrentContract_F__r.Contract_Range__c < 12 && monthCon > Math.floor(input.rec.CurrentContract_F__r.Contract_Range__c / 2)) { |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 经历月数过半方可制作报价'); |
| | | rtn = false; |
| | | } |
| | | } |
| | | // 多年保判断 |
| | | if ( String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { |
| | | //if (UserInfo.getProfileId() != System.Label.ProfileId_SystemAdmin && String.isNotBlank(input.rec.CurrentContract_F__c) && input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract') { |
| | |
| | | |
| | | //市场多年保修价格开发 DC 2023/02/02 Start 结束日空白期大于6个月 报错提示 |
| | | |
| | | Date endDate6Month = input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c.addMonths(6); |
| | | Date cotractEndDay = input.rec.CurrentContract_F__r.endDateGurantee__c; |
| | | // Date endDate6Month = input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c.addMonths(6); |
| | | // Date cotractEndDay = input.rec.CurrentContract_F__r.endDateGurantee__c; |
| | | |
| | | |
| | | if(today>endDate6Month && cotractEndDay <today){ |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 建议空白期控制在1个月以内,如不得己空白期在6个月以上,请先联络服务管理部评估。'); |
| | | // if(today>endDate6Month && cotractEndDay <today){ |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 市场多年保结束已超过6个月,由于空白期过长,请先联系服务管理部评估。'); |
| | | |
| | | } |
| | | // } |
| | | |
| | | //市场多年保修价格开发 DC 2023/02/02 end |
| | | |
| | |
| | | // gzw 20220630 开通续签报价权限后,超过6个月也可以续签 |
| | | // 续签情况 ① 上期合同 Open_RenewalQuotation__c & 6个月以内 ② VM_Contract_Check__c Open_RenewalQuotation__c 2个都打钩 |
| | | // ① 2个开关都打开 ②VM_Contract_Check__c打开 小于6个月 |
| | | // if (!((this.contract.Open_RenewalQuotation__c && input.rec.CurrentContract_F__r.VM_Contract_Check__c) || (input.rec.CurrentContract_F__r.VM_Contract_Check__c && monthCon < 6))) { |
| | | // if(monthCon < 6){ |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 可以加入服务合同,加入价格请联系服务管理部。'); |
| | | // }else{ |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。'); |
| | | // } |
| | | // System.debug(LoggingLevel.INFO, '*** this.contract.Open_RenewalQuotation__c: ' + this.contract.Open_RenewalQuotation__c); |
| | | // System.debug(LoggingLevel.INFO, '*** : input.rec.CurrentContract_F__r.VM_Contract_Check__c' + input.rec.CurrentContract_F__r.VM_Contract_Check__c); |
| | | // System.debug(LoggingLevel.INFO, '*** monthCon: ' + monthCon); |
| | | // //input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。'); |
| | | // rtn = false; |
| | | // } |
| | | if (!((this.contract.Open_RenewalQuotation__c && input.rec.CurrentContract_F__r.VM_Contract_Check__c) || (input.rec.CurrentContract_F__r.VM_Contract_Check__c && monthCon < 6))) { |
| | | if(monthCon < 6){ |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 可以加入服务合同,加入价格请联系服务管理部。'); |
| | | }else{ |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。'); |
| | | } |
| | | // System.debug(LoggingLevel.INFO, '*** this.contract.Open_RenewalQuotation__c: ' + this.contract.Open_RenewalQuotation__c); |
| | | // System.debug(LoggingLevel.INFO, '*** : input.rec.CurrentContract_F__r.VM_Contract_Check__c' + input.rec.CurrentContract_F__r.VM_Contract_Check__c); |
| | | // System.debug(LoggingLevel.INFO, '*** monthCon: ' + monthCon); |
| | | //input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有续签报价权限,或者还没到续签时间。'); |
| | | rtn = false; |
| | | } |
| | | /*if (input.rec.CurrentContract_F__r.Gurantee_Renew_startDate__c > Date.today()) { |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 第一个设备结束后可以制作报价。'); |
| | | rtn = false; |
| | |
| | | public class AssetInfo { |
| | | // 新合同备品确保提供 当前标记 |
| | | public Boolean etGFlg {get; set;} |
| | | public String ISStandardPricing{get; set;} |
| | | // public String ISStandardPricing{get; set;} |
| | | public Integer lineNo {get; private set;} |
| | | public Decimal Repair_Price_Auto {get; set;} |
| | | public String Agreed_Date{get; set;} |
| | |
| | | public Maintenance_Contract_Estimate__c estimate {get; set;} |
| | | public Transient Decimal orgPrice {get; private set;} |
| | | public Transient Decimal orgPrice12 {get; private set;} |
| | | // public String Blank_period {get; set;} |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 Star |
| | | public Boolean CheckRows {get; private set;} |
| | | // add by fxk 2021/9/9 控制点检对象是否可选 End |
| | |
| | | public String MDMModelNoc; |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | //市场多年保 价格开发 start 2023/01/17 |
| | | public String Category; |
| | | // public String Category; |
| | | //市场多年保 价格开发 end 2023/01/17 |
| | | public Id getRecId() { |
| | | Id rtn = null; |
| | |
| | | public AssetInfo(Integer lineNo, Asset record, Boolean isNew, Decimal listPrice, Maintenance_Contract_Asset_Estimate__c mcae,Maintenance_Contract_Estimate__c estimate) { |
| | | this.lineNo = lineNo; |
| | | this.rec = record; |
| | | this.ISStandardPricing = mcae.IS_StandardPricing__c; |
| | | // this.rec.CurrentContract_End_Date__c = record.CurrentContract_End_Date__c; |
| | | // this.rec.CurrentContract_End_Date__c = record.IS_Extend_Gurantee__c ? record.Extend_Gurantee_DateTo__c : record.CurrentContract_End_Date__c; |
| | | // this.ISStandardPricing = record.IS_StandardPricing__c; |
| | | this.estimate = new Maintenance_Contract_Estimate__c(); |
| | | this.estimate.IS_Reduced_price_approval__c = estimate.IS_Reduced_price_approval__c; |
| | | // 报价规则改善 20230308 start |
| | | // this.estimate.Contract_Esti_Start_Date__c = estimate.Contract_Esti_Start_Date__c; |
| | | // this.estimate.renewTen_OFF__c = estimate.renewTen_OFF__c; |
| | | // 报价规则改善 20230308 end |
| | | |
| | | // (2022年12月上线)故障品加费 start |
| | | // if (record.Asset_situation__c == '修理中' && record.Return_Without_Repair__r.Agreed_Date__c!=null) { |
| | | // this.Agreed_Date = '不为空'; |
| | |
| | | Check_Result__c = mcae.Check_Result__c, |
| | | Repair_Price__c = mcae.Repair_Price__c, |
| | | Repair_Price_pass__c = mcae.Repair_Price_pass__c, |
| | | // 报价规则改善 20230308 start |
| | | // Blank_period__c = mcae.Blank_period__c, |
| | | // 报价规则改善 20230308 end |
| | | Comment__c = mcae.Comment__c, |
| | | EquipmentGuaranteeFlgTxt__c = mcae.EquipmentGuaranteeFlgTxt__c, |
| | | Estimate_Cost__c = mcae.Estimate_Cost__c, |
| | |
| | | this.mcae.Repair_Price_pass__c = this.mcae.Repair_Price__c; |
| | | } |
| | | } |
| | | // 报价规则改善 20230308 start |
| | | // if (this.estimate.Contract_Esti_Start_Date__c!=null && this.rec.CurrentContract_End_Date__c != null) { |
| | | // this.mcae.Blank_period__c = String.valueof(this.rec.CurrentContract_End_Date__c.daysbetween(this.estimate.Contract_Esti_Start_Date__c)); |
| | | // } |
| | | // if (this.estimate.Contract_Esti_Start_Date__c==null && this.rec.CurrentContract_End_Date__c != null) { |
| | | // this.mcae.Blank_period__c = String.valueof(this.rec.CurrentContract_End_Date__c.daysbetween(system.today())); |
| | | // } |
| | | // if (this.mcae.Blank_period__c!=null&&integer.valueOf(this.mcae.Blank_period__c)<15 ) { |
| | | // this.mcae.Blank_period__c = '无缝续签'; |
| | | // } |
| | | // 报价规则改善 20230308 end |
| | | this.isManual = false; |
| | | this.rec_checkBox_c = true; |
| | | this.orgPrice = record.Maintenance_Price_Month__c; |
| | |
| | | //add by rentx 2020-11-12 LJPH-BV93RZ end |
| | | |
| | | //市场多年保 价格开发 start 2023/01/17 |
| | | this.Category = mcae.Product_Manual__r.Category4__c; |
| | | // this.Category = mcae.Product_Manual__r.Category4__c; |
| | | //市场多年保 价格开发 end 2023/01/17 |
| | | |
| | | //add by mzy 2021-02-07 start |
| | |
| | | public AssetInfo(Integer lineNo, Maintenance_Contract_Asset_Estimate__c mcae) { |
| | | this.lineNo = lineNo; |
| | | this.rec = null; |
| | | this.ISStandardPricing = mcae.IS_StandardPricing__c; |
| | | this.mcae = new Maintenance_Contract_Asset_Estimate__c( |
| | | // id = mcae.Id, // 本当にいらないの? セットしたら、新規権限がなくでも、更新できます。後藤さんに確認した、なくでもいいです。 |
| | | isNew__c = mcae.IsNew__c, |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | |
| | | //市场多年保 价格开发 start 2023/01/17 |
| | | this.Category = mcae.Product_Manual__r.Category4__c; |
| | | // this.Category = mcae.Product_Manual__r.Category4__c; |
| | | //市场多年保 价格开发 end 2023/01/17 |
| | | } |
| | | |