| | |
| | | conTest2.dataEntry(); |
| | | } |
| | | |
| | | @isTest |
| | | private static void TestMeth3(){ |
| | | //@isTest |
| | | // private static void TestMeth3(){ |
| | | |
| | | // recode type を取得 |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | throw new ControllerUtil.myException('not found 病院 recodetype'); |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | if (rectDpt.size() == 0) { |
| | | throw new ControllerUtil.myException('not found 診療科 recodetype'); |
| | | } |
| | | // // recode type を取得 |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // if (rectCo.size() == 0) { |
| | | // throw new ControllerUtil.myException('not found 病院 recodetype'); |
| | | // } |
| | | // List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | // if (rectDpt.size() == 0) { |
| | | // throw new ControllerUtil.myException('not found 診療科 recodetype'); |
| | | // } |
| | | |
| | | // insert |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | insert company1; |
| | | // // insert |
| | | // Account company1 = new Account(); |
| | | // company1.RecordTypeId = rectCo[0].Id; |
| | | // company1.Name = '病院テスト1'; |
| | | // insert company1; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = : company1.Id order by Department_Class_Label__c]; |
| | | // List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = : company1.Id order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = '診療科1'; |
| | | depart1.ParentId= dc1s[0].Id; |
| | | depart1.Department_Class__c = dc1s[0].Id; |
| | | depart1.Hospital__c= company1.Id; |
| | | insert depart1; |
| | | // Account depart1 = new Account(); |
| | | // depart1.RecordTypeId = rectDpt[0].Id; |
| | | // depart1.Name = '*'; |
| | | // depart1.Department_Name__c = '診療科1'; |
| | | // depart1.ParentId= dc1s[0].Id; |
| | | // depart1.Department_Class__c = dc1s[0].Id; |
| | | // depart1.Hospital__c= company1.Id; |
| | | // insert depart1; |
| | | |
| | | PCLLostReportController conTest2 = EditLoad(); |
| | | Set<Id> IdSet=new Set<Id> {depart1.Id}; |
| | | conTest2.deleteBrandIDSet=IdSet; |
| | | conTest2.LostReport.LostReport.LostType__c = '部分失单'; |
| | | conTest2.LostReport.LostBrands[0].lostBrand.LostPrice__c = 12; |
| | | conTest2.LostReport.LostBrands[0].lostBrand.Lost_reason_main__c = '价格'; |
| | | conTest2.LostReport.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =0; |
| | | conTest2.LostReport.LostBrands[0].lostBrand.Agency__c = depart1.Id; |
| | | conTest2.LostReport.LostBrands[0].lostBrand.Lost_By_Company__c = 'STORZ'; |
| | | conTest2.LostReport.LostBrands[0].LostProducts[0].lineNo2 = 0; |
| | | conTest2.LostReport.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 0); |
| | | // conTest2.setBrand(); |
| | | conTest2.dataEntry(); |
| | | } |
| | | // PCLLostReportController conTest2 = EditLoad(); |
| | | // Set<Id> IdSet=new Set<Id> {depart1.Id}; |
| | | // conTest2.deleteBrandIDSet=IdSet; |
| | | // conTest2.LostReport.LostReport.LostType__c = '部分失单'; |
| | | // conTest2.LostReport.LostBrands[0].lostBrand.LostPrice__c = 12; |
| | | // conTest2.LostReport.LostBrands[0].lostBrand.Lost_reason_main__c = '价格'; |
| | | // conTest2.LostReport.LostBrands[0].LostProducts[0].LostProductss.Quantity__c =0; |
| | | // conTest2.LostReport.LostBrands[0].lostBrand.Agency__c = depart1.Id; |
| | | // conTest2.LostReport.LostBrands[0].lostBrand.Lost_By_Company__c = 'STORZ'; |
| | | // conTest2.LostReport.LostBrands[0].LostProducts[0].lineNo2 = 0; |
| | | // conTest2.LostReport.LostBrands[0].LostProducts[0].LostProductss = new PCLLostProduct__c(Quantity__c = 0); |
| | | // // conTest2.setBrand(); |
| | | // conTest2.dataEntry(); |
| | | // } |
| | | |
| | | |
| | | |