| | |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | | + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, ' |
| | | + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c,' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,CurrentContract_F__r.Contract_Range__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,' |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 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 + '\' '; |
| | | //HWAG-BDJ43R ---XHL---20190729--- |
| | |
| | | , Skip_DJ__c |
| | | //跳过点检标记 2021/07/28 gzw start |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220419 start |
| | | , Maintenance_Contract__r.Open_RenewalQuotation__c |
| | | , 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 //过去合同结束日 |
| | |
| | | TopProductModel.add('OER-A'); |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 end |
| | | typeresult = null; |
| | | AssetHandler.disabled = true; |
| | | changedAfterPrint = false; |
| | | changedSubmitPrice = false; |
| | | isSaveOrApproval = false; |
| | |
| | | CurrentContract_F__c, CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c, CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c, CurrentContract_F__r.Contract_End_Date__c, CurrentContract_F__r.Estimate_Contract_endDate__c, |
| | | CurrentContract_F_asset__c, CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, CurrentContract_F_asset__r.endDateGurantee_Text__c, CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | CurrentContract_F__r.First_Estimate_Date__c, |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | CurrentContract_F__r.Gurantee_Renew_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | CurrentContract_F__r.Gurantee_Renew_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | CurrentContract_F__r.Contract_Consumption_rate__c, CurrentContract_F__r.First_contract_usage_Rate__c, |
| | | CurrentContract_F__r.Contract_Range__c, AssetMark__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | CurrentContract_F__r.Open_RenewalQuotation__c, |
| | | CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | // 2021-01-29 LJPH-BX9CVX mzy add 合同报价时判断零件风险 |
| | | NoPartRiskDate_F__c, NoPartRiskDate__c, SignableFlag__c, |
| | |
| | | Asset__r.CurrentContract_F__r.Contract_Range__c, |
| | | Asset__r.CurrentContract_F__r.Contract_End_Date__c, |
| | | Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | Asset__r.CurrentContract_F__r.Gurantee_Renew_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | Asset__r.CurrentContract_F__r.Gurantee_Renew_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c,Asset__r.CurrentContract_F__r.VM_Contract_Check__c |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.targetMaintenanceContractId |
| | |
| | | Asset__r.CurrentContract_F__r.Contract_End_Date__c, |
| | | Asset__r.CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c, |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c,Asset__r.CurrentContract_F__r.VM_Contract_Check__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | LastMContract_Price__c, |
| | | Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, |
| | |
| | | // Gzw 20200807 五个去年合同相关,所以报价产品,获取上期合同 eng |
| | | // LJPH-C9GD34 gzw fix start |
| | | ,Estimate_List_Price_Page__c |
| | | // LJPH-C9GD34 gzw fix end |
| | | FROM Maintenance_Contract_Asset_Estimate__c |
| | | WHERE Maintenance_Contract_Estimate__c = :this.targetEstimateId |
| | | ORDER BY |
| | |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c, ' |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | | + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, ' |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c,' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' |
| | | + 'CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,' |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | + '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; |
| | |
| | | sqlStr += 'CurrentContract_End_Date__c,Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,'; |
| | | sqlStr += 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,'; |
| | | sqlStr += 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c,'; |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | sqlStr += 'CurrentContract_F__r.Gurantee_Renew_startDate__c'; |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | sqlStr += 'CurrentContract_F__r.Gurantee_Renew_startDate__c,'; |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | sqlStr += 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,'; |
| | | sqlStr += 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,'; |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | sqlStr += 'CurrentContract_F__r.Open_RenewalQuotation__c,'; |
| | | sqlStr += 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,'; |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | 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 + '\''; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | |
| | | /** |
| | | * 保存メソッド |
| | | */ |
| | | |
| | | |
| | | public PageReference save() { |
| | | System.debug('save start'); |
| | | Oly_TriggerHandler.bypass('Maintenance_Contract_Asset__c'); |
| | | Oly_TriggerHandler.bypass('AssetHandler'); |
| | | // Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | Oly_TriggerHandler.bypass('AssetHandlerCheck'); |
| | | Oly_TriggerHandler.bypass('SetContractEstimatePriceHandler'); |
| | | StaticParameter.EscapeVMCTrigger = true; |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ start |
| | | if (estimate.Contract_Range__c == null) { |
| | | this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | return null; |
| | | } |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | |
| | | NextMaintenanceContract(); |
| | | |
| | | Id vmMaintenance_Contract = Schema.SObjectType.Maintenance_Contract_Estimate__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Quote').getRecordTypeId(); |
| | | estimate.recordtypeid = vmMaintenance_Contract; |
| | |
| | | priceChangeReset(); |
| | | return null; |
| | | } |
| | | AssetHandler.disabled = true; |
| | | if (syncEstimate(false, false)) { |
| | | |
| | | ComputeLTYRepair(); |
| | | //return null; |
| | | return new PageReference('/' + this.targetEstimateId + '/e?completion=5'); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public PageReference dosomething() { |
| | | System.debug('dosomething start'); |
| | | NextMaintenanceContract(); |
| | | return null; |
| | | } |
| | | public void NextMaintenanceContract() { |
| | | // 20220810 询价2期开发 |
| | | List<String> asslocalList = new List<String>(); |
| | | List<String> mcalocalList = new List<String>(); |
| | | Map<Id, Maintenance_Contract__c> map3 = new Map<Id, Maintenance_Contract__c>(); |
| | | |
| | | List<Maintenance_Contract_Asset__c> mcaupdateList = new List<Maintenance_Contract_Asset__c>(); |
| | | for (AssetInfo ass : this.checkedAssets) { |
| | | if (!ass.isManual) { |
| | | asslocalList.add(ass.rec.Id); |
| | | map3.put(ass.rec.Id,this.contract); |
| | | } |
| | | } |
| | | // System.debug('asslocalList====%%%' +asslocalList); |
| | | List<Maintenance_Contract_Asset__c> mcalist1 = [select id,Asset__c,Next_Maintenance_Contract__c,Maintenance_Contract__c |
| | | from Maintenance_Contract_Asset__c |
| | | where id in (select CurrentContract_F_asset__c |
| | | from asset |
| | | where id in :asslocalList and CurrentContract_F_asset__c!=null)]; |
| | | // System.debug('mcalist1====%%%' +mcalist1); |
| | | // System.debug('map3====%%%' +map3); |
| | | for (Maintenance_Contract_Asset__c mca : mcalist1) { |
| | | Maintenance_Contract_Asset__c mca3 = new Maintenance_Contract_Asset__c(); |
| | | if (map3.containsKey(mca.Asset__c)) { |
| | | mca3.id = mca.id; |
| | | mca3.Next_Maintenance_Contract__c = map3.get(mca.Asset__c).id; |
| | | // System.debug('mca3.id====%%%' +mca3.id); |
| | | if (mca3.id!=null&&!mcaupdateList.contains(mca3)) { |
| | | mcaupdateList.add(mca3); |
| | | } |
| | | } |
| | | } |
| | | // System.debug('mcaupdateList====%%%' +mcaupdateList); |
| | | if (mcaupdateList!=null&&!mcaupdateList.isEmpty()) { |
| | | update mcaupdateList; |
| | | } |
| | | System.debug('更新完成mcaupdateList'); |
| | | } |
| | | /** |
| | | * 決定メソッド |
| | | */ |
| | | public PageReference decide() { |
| | | System.debug('decide start'); |
| | | NextMaintenanceContract(); |
| | | inDicideFlag = true; |
| | | // TODO check decide 资格 |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | setApprovalManager(); |
| | | System.debug('Process_Status__c=' + this.estimate.Process_Status__c); |
| | | insert this.estimate; |
| | | System.debug(LoggingLevel.INFO, '*** insertthis.estimate: '); |
| | | this.targetEstimateId = this.estimate.Id; |
| | | setThisEstimate(); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | // 本当に保存した納入機器があれば削除 |
| | | // AssetHandler.disabled = true; |
| | | List<Maintenance_Contract_Asset_Estimate__c> selectedAsset = [SELECT Id, Name, Maintenance_Contract_Estimate__c, Asset__c, IsNew__c FROM Maintenance_Contract_Asset_Estimate__c WHERE Maintenance_Contract_Estimate__c = :this.targetEstimateId]; |
| | | if (selectedAsset.size() > 0) { |
| | | ControllerUtil.deleteMaintenance_Contract_Asset_Estimate(selectedAsset); |
| | |
| | | if (insertTarget.size() > 0) { |
| | | ControllerUtil.insertMaintenance_Contract_Asset_Estimate(insertTarget); |
| | | } |
| | | |
| | | // ① start |
| | | for (List<Maintenance_Contract_Asset__c> oldList : [select Id from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.estimate.Maintenance_Contract__c]) { |
| | |
| | | |
| | | /** 保存返回 **/ |
| | | public PageReference saveAndCancel () { |
| | | AssetHandler.disabled = true; |
| | | Oly_TriggerHandler.bypass('Maintenance_Contract_Asset__c'); |
| | | Oly_TriggerHandler.bypass('AssetHandler'); |
| | | Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ start |
| | | if (estimate.Contract_Range__c == null) { |
| | | this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | return null; |
| | | } |
| | | NextMaintenanceContract(); |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | if (syncEstimate(false, false)) { |
| | | PageReference ret = null; |
| | |
| | | this.contract = [SELECT Id, Name, Status__c, Decided_Estimation__c, Service_Contract_Staff__c, |
| | | Estimate_Num__c, Management_Code__c, Hospital__c, |
| | | Hospital__r.MaintenanceContractUserType__c, |
| | | Contract_Start_Date__c, Contract_End_Date__c |
| | | Contract_Start_Date__c, Contract_End_Date__c, VM_Contract_Check__c,Open_RenewalQuotation__c |
| | | FROM Maintenance_Contract__c WHERE Id = :id]; |
| | | if (this.estimate.Process_Status__c == '草案中' || String.IsBlank(this.estimate.Process_Status__c)) { |
| | | |
| | |
| | | //2021-01-18 mzy add LJPH-BWY5QB 客户上的 维修合同用户类型 为true /false,报价 用户类型为 既有用户 / 新用户 |
| | | // Hospital__r.MaintenanceContractUserType__c, |
| | | //2021-01-18 mzy add LJPH-BWY5QB 客户上的 维修合同用户类型 为true /false,报价 用户类型为 既有用户 / 新用户 |
| | | Contract_Start_Date__c, Contract_End_Date__c |
| | | Contract_Start_Date__c, Contract_End_Date__c, VM_Contract_Check__c,Open_RenewalQuotation__c |
| | | FROM Maintenance_Contract__c WHERE Id = :id]; |
| | | this.targetHospitalId = this.contract.Hospital__c; |
| | | // 2021-01-18 mzy add LJPH-BWY5QB 客户上的 维修合同用户类型 为true /false,报价 用户类型为 既有用户 / 新用户 |
| | |
| | | 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') { |
| | | |
| | | //Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c); |
| | | //Decimal monthCon = (Decimal)noOfDays/365*12; |
| | | // 可开始报价的月数限制 |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | // if (input.rec.CurrentContract_F__r.Gurantee_Estimate_startDate__c > Date.today()) { |
| | | // input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 合同结束前6个月开始可以制作报价。'); |
| | | // 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; |
| | | } |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // 多年保判断 |
| | | 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') { |
| | | |
| | | // modify by lc 20220607 多年保续签和实绩连动状态对应 start |
| | | Integer noOfDays = today.daysBetween(input.rec.CurrentContract_F_asset__r.endDateGurantee_Text__c); |
| | | Decimal monthCon = (Decimal)noOfDays/365*12; |
| | | // 可开始报价的月数限制 |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | //if (input.rec.CurrentContract_F__r.Gurantee_Estimate_startDate__c > Date.today()) { |
| | | // 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 + ') -- 没有续签报价权限,或者还没到续签时间。'); |
| | | } |
| | | //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; |
| | | }*/ |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // modify by lc 20220607 多年保续签和实绩连动状态对应 end |
| | | |
| | | } |
| | | } |
| | | //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '---' + input.rec.CurrentContract_F__r.Contract_End_Date__c)); |
| | | if (inDicideFlag && String.isNotBlank(input.rec.CurrentContract_F__c) && estimate.Skip_DJ__c == false ) { |
| | | //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, '+++' + input.rec.CurrentContract_F__r.Contract_End_Date__c)); |
| | | //多年保结束日到续签开始日之间的空白期大于30日,且在合同开始日前三个月内没有点检记录,报错 20220429 thh start |
| | | if(input.rec.CurrentContract_F__r.RecordType_DeveloperName__c == 'VM_Contract' && |
| | | input.rec.CurrentContract_F__r.Contract_End_Date__c > input.rec.CurrentContract_F__r.Gurantee_Renew_startDate__c.addDays(30) |
| | | && (input.rec.Final_Examination_Date__c == null |
| | | || input.rec.Final_Examination_Date__c < estimate.Contract_Start_Date__c.addMonths(-3))){ |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 没有最新的点检记录'); |
| | | rtn = false; |
| | | } |
| | | //多年保结束日到续签开始日之间的空白期大于30日,且在合同开始日前三个月内没有点检记录,报错 20220429 thh end |
| | | |
| | | // 合同开始日大于上期合同结束日加一个月,且没有点检日期或者最近一次点检日期是3个月前 报错 |
| | | if (estimate.Contract_Start_Date__c > input.rec.CurrentContract_F__r.Contract_End_Date__c.addMonths(1) |
| | | && (input.rec.Final_Examination_Date__c == null |