| | |
| | | |
| | | @AuraEnabled |
| | | public static ReturnData print(Maintenance_Contract__c MCEElement) { |
| | | System.debug('print start'); |
| | | // save(); |
| | | save(MCEElement); |
| | | ReturnData returnData = new ReturnData(); |
| | | System.debug('save start'); |
| | | // save(); |
| | | ReturnData res = save(MCEElement); |
| | | if (res.statusSave != 'Fin') { |
| | | returnData.status = res.status; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | System.debug('save end'); |
| | | |
| | | returnData.statusSave = 'Fin'; |
| | | returnData.agreeUpperLimit = MCEElement.URF_Contract__c; |
| | | if (PageMCEElement.Decided_Estimation__c == null) { |
| | |
| | | // statusSave = 'Denied'; |
| | | returnData.status = '报价单没有决定之前不能打印合同文本!'; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | |
| | | if (MCEElement.Estimate_Target__c == null) { |
| | |
| | | // statusSave = 'Denied'; |
| | | returnData.status = '请确定提交对象!'; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | |
| | | |
| | |
| | | // statusSave = 'Denied'; |
| | | returnData.status = '非标合同不需要打印合同文本!'; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | |
| | | |
| | |
| | | //return; |
| | | returnData.status = '付款总金额与合同金额不符。'; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | |
| | | // HWAG-BHT7XX 2019-12-09 by vivek start |
| | |
| | | // statusSave = 'Denied'; |
| | | returnData.status = '付款期数和付款计划数目不符。'; |
| | | returnData.statusSave = 'Denied'; |
| | | return returnData; |
| | | } |
| | | } |
| | | |
| | |
| | | *多次付款至少输入付款计划1和付款计划1金额 |
| | | *一次性付款需要输入一次性付款约定期限 |
| | | */ |
| | | |
| | | PageMCEElement = MCEElement; |
| | | PageMCEElement.id = MCEElement.id; |
| | | system.debug('*************PageMCEElement='+PageMCEElement); |
| | | system.debug('*************MCEElement='+MCEElement); |
| | | if (PageMCEElement.Is_Standard_Contract__c == null ) { |
| | | Maintenance_Contract__c MCE1 = [select |
| | | id, |
| | | Service_Contract_Staff__r.Salesdepartment__c |
| | | from |
| | | Maintenance_Contract__c |
| | | where |
| | | id = :MCEElement.id limit 1]; |
| | | |
| | | if (PageMCEElement.Is_Standard_Contract__c == null || PageMCEElement.Is_Standard_Contract__c == '' ) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, '请选择是否标准合同!')); |
| | | // statusSave = 'Denied'; |
| | | returnData.status = '请选择是否标准合同!'; |
| | |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '1.华北') { |
| | | system.debug('*************PageMCEElement='+MCE1.Service_Contract_Staff__r.Salesdepartment__c); |
| | | if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '1.华北') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_HB; |
| | | PageMCEElement.User_Salesdepartment_Sec__c = System.Label.Payment_Block_Leader_SD; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '2.东北') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '2.东北') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_DB; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '3.西北') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '3.西北') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_XB; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '4.西南') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '4.西南') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_XN; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '5.华东') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '5.华东') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_HD; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '6.华南') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '6.华南') { |
| | | PageMCEElement.User_Salesdepartment__c = System.Label.Payment_Block_Leader_HN; |
| | | PageMCEElement.User_Salesdepartment_Sec__c = System.Label.Payment_Block_Leader_HNVice; |
| | | } else if (PageMCEElement.Service_Contract_Staff__r.Salesdepartment__c == '7.能量') { |
| | | } else if (MCE1.Service_Contract_Staff__r.Salesdepartment__c == '7.能量') { |
| | | |
| | | } |
| | | // 对于标准合同进行验证必填项 |