| | |
| | | private class AssetUseInfoBatchTest { |
| | | |
| | | private static void init() { |
| | | Oly_TriggerHandler.bypass('NFM010UpsertStatuAchievements'); |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | if (rectHp.size() == 0) { |
| | | return; |
| | |
| | | ); |
| | | insert opp; |
| | | |
| | | Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | name = 'zhucan_one', |
| | | Opportunity__c = opp.id, |
| | | DeliveryDate__c = Date.today(), |
| | | FirstApproveDate__c = Date.valueOf('2016-08-10') |
| | | ); |
| | | insert Sac; |
| | | // Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | // name = 'zhucan_one', |
| | | // Opportunity__c = opp.id, |
| | | // DeliveryDate__c = Date.today(), |
| | | // FirstApproveDate__c = Date.valueOf('2016-08-10') |
| | | // ); |
| | | // insert Sac; |
| | | |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI',Asset_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',ProductCode_Ext__c='pc01',Manual_Entry__c=false); |
| | | pro1.Extend_new_product_gurantee__c = true; |
| | | pro1.Entend_gurantee_period__c = '两年'; |
| | | pro1.Extend_Gurantee_Start__c = Date.valueOf('2015-01-01'); |
| | | pro1.Extend_Gurantee_End__c = Date.valueOf('2017-01-04'); |
| | | pro1.Category2__c ='本体'; |
| | | insert pro1; |
| | | // 納入機器を作成する |
| | | Asset asset = new Asset(); |
| | |
| | | asset.Hospital__c = hp.Id; |
| | | asset.SerialNumber = 'testserial'; |
| | | asset.Product2Id = pro1.Id; |
| | | asset.Backorder__c = Sac.Id; |
| | | // asset.Backorder__c = Sac.Id; |
| | | asset.InstallDate = Date.valueOf('2017-05-10'); |
| | | asset.Guarantee_period_for_products__c = Date.valueOf('2018-05-10'); |
| | | |
| | | insert asset; |
| | | } |
| | | |