| | |
| | | if(ConId != null && ConId.size() > 0) { |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c where Id in :ConId]); |
| | | } else { |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c]); |
| | | // 20221117 ljh DB202211258553 start |
| | | // return Database.getQueryLocator([select Id from Maintenance_Contract__c]); |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c where Status__c = '契約' OR (Status__c = '契約満了' and Contract_End_Date__c >= :Date.today().addMonths(-6))]); |
| | | // 20221117 ljh DB202211258553 end |
| | | } |
| | | |
| | | |
| | |
| | | Maintenance_Contract__r.RecordType_DeveloperName__c, |
| | | VM_Maintenance_Contract__r.startDateGurantee__c, |
| | | VM_Maintenance_Contract__r.endDateGurantee__c |
| | | ,Agreed_Date__c //用户同意日 上限合同 LY 20230210 add |
| | | ,Limit_Price__c //上限修理 上限合同 LY 20230210 add |
| | | from Repair__c |
| | | where (Maintenance_Contract__c != null or VM_Maintenance_Contract__c != null) |
| | | and (Maintenance_Contract__c in: mcList or VM_Maintenance_Contract__c in: mcList) |
| | |
| | | if (mc.Sum_repair_price_new__c == null) { |
| | | mc.Sum_repair_price_new__c = 0.00; |
| | | } |
| | | if (dTDate >= dSDate && dTDate <= dEDate) { |
| | | mc.Sum_repair_price_new__c += rc.Usage_Ratio_Price__c == null ? 0 : rc.Usage_Ratio_Price__c; |
| | | if (dTDate >= dSDate && dTDate <= dEDate) { |
| | | //上限合同 LY 20230210 start |
| | | if (rc.Limit_Price__c == true) { |
| | | if (rc.Agreed_Date__c!=null) {//报价同意后 修理的【计入合同消费率的修理金额】记入到维修合同的合同期间修理金额】 上限合同 LY add 20230210 |
| | | mc.Sum_repair_price_new__c += rc.Usage_Ratio_Price__c == null ? 0 : rc.Usage_Ratio_Price__c; |
| | | } |
| | | }else{ |
| | | mc.Sum_repair_price_new__c += rc.Usage_Ratio_Price__c == null ? 0 : rc.Usage_Ratio_Price__c; |
| | | } |
| | | //上限合同 LY 20230210 end |
| | | } |
| | | System.debug('修理金额结束'+mc.Sum_repair_price_new__c); |
| | | updateMC.put(rc.Maintenance_Contract__c, mc); |
| | | } |
| | | //20210106 zh LJPH-BWM5HM 多年保修【合同期间修理金额】逻辑修改 start |