| | |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET Email)' |
| | | ]; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | |
| | | myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount2.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200311', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 5, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200312', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 5, |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | JANCODE__c = '04953170200313', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03 }; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02,prod03}; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod03.Id); |
| | | insert new List<Product2__c>{ pro1, pro2, pro3 }; |
| | | insert new Product2__c[] {pro1, pro2,pro3}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>(); |
| | | |
| | | |
| | | //daoku |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | |
| | | conList.add(Orderdet3); |
| | | // insert Orderdet3; |
| | | |
| | | |
| | | |
| | | //sale |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | |
| | | Orderdet4.Used_date__c = Date.today(); |
| | | // insert Orderdet4; |
| | | conList.add(Orderdet4); |
| | | |
| | | |
| | | //ProductPacking_list_manual__c=1 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | |
| | | insert conList; |
| | | // insert Orderdet8; |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.init(); |
| | | // LexCancelRemoveBoxController.getinventorysize(); |
| | |
| | | LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList), '捷尔医疗(海南)有限公司', '深圳', 'ENG'); |
| | | |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET Email)' |
| | | ]; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | |
| | | myAccount2 = new Account( |
| | | name = 'Testaccount002', |
| | | Dealer_discount__c = 20, |
| | | RecordTypeId = rectCo[0].Id, |
| | | AgentCode_Ext__c = '9999900' |
| | | ); |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | |
| | | Contact core = new Contact( |
| | | email = 'jplumber@salesforce.com', |
| | | firstname = 'Joe', |
| | | lastname = 'Plumber', |
| | | accountid = myAccount2.id |
| | | ); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c ='重庆'); |
| | | insert MyUser_Test; |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | User myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET Email)' |
| | | ]; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2'); |
| | | insert myAccount2; |
| | | Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id); |
| | | insert core; |
| | | myUser_test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email = 'newuser@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUser', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUser@testorg.com', |
| | | UserPro_Type__c = 'ENG', |
| | | Work_Location__c = '北京' |
| | | ); |
| | | myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | System.debug('MyUser_Test' + MyUser_Test); |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | | //产品信息 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test01', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test02', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test03', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod04 = new Product2( |
| | | Name = 'Test04', |
| | | ProductCode = 'Test04', |
| | | Asset_Model_No__c = 'Test04', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 2, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test04', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod05 = new Product2( |
| | | Name = 'Test05', |
| | | ProductCode = 'Test05', |
| | | Asset_Model_No__c = 'Test05', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test05', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod06 = new Product2( |
| | | Name = 'Test06', |
| | | ProductCode = 'Test06', |
| | | Asset_Model_No__c = 'Test06', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test06', |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 }; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false); |
| | | Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false); |
| | | Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06}; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id); |
| | | Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id); |
| | | insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 }; |
| | | insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01'; |
| | |
| | | |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.barcode = '1004\n1003\n1002\n1001'; |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails( |
| | | '10061\n10051\n10041\n10031\n10021\n10011', |
| | | 'Testaccount003', |
| | | '重庆', |
| | | 'ET' |
| | | ); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','重庆','ET'); |
| | | String str = '该商品存在盘点履历'; |
| | | String errorReason = ''; |
| | | LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo( |
| | | con, |
| | | str |
| | | ); |
| | | LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con,str); |
| | | c2.esd = con; |
| | | c2.Prod = con.Consumable_product__r; |
| | | c2.oldConsumableCount = con.name; |
| | |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | User myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | | WHERE Name = '901_经销商社区普通权限_2重验证(ET Email)' |
| | | ]; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | myAccount2 = new Account(name = 'Testaccount003', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2'); |
| | | insert myAccount2; |
| | | Contact core = new Contact(email = 'wan@salesforce.com', firstname = 'wan', lastname = 'Plumbers', accountid = myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = new User( |
| | | ContactId = core.id, |
| | | Alias = 'newWang', |
| | | Email = 'newWang@testorg.com', |
| | | EmailEncodingKey = 'UTF-8', |
| | | LastName = 'TestUserWang', |
| | | LanguageLocaleKey = 'zh_CN', |
| | | LocaleSidKey = 'zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey = 'Asia/Shanghai', |
| | | UserName = 'testUserWang@testorg.com', |
| | | Work_Location__c = '重庆' |
| | | ); |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newWang',Email='newWang@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUserWang', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUserWang@testorg.com',Work_Location__c ='重庆'); |
| | | insert MyUser_Test; |
| | | System.debug('MyUser_Test' + MyUser_Test); |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | | //产品信息 |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | | ProductCode = 'Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test01', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod02 = new Product2( |
| | | Name = 'Test02', |
| | | ProductCode = 'Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test02', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod03 = new Product2( |
| | | Name = 'Test03', |
| | | ProductCode = 'Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test03', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod04 = new Product2( |
| | | Name = 'Test04', |
| | | ProductCode = 'Test04', |
| | | Asset_Model_No__c = 'Test04', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 2, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test04', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod05 = new Product2( |
| | | Name = 'Test05', |
| | | ProductCode = 'Test05', |
| | | Asset_Model_No__c = 'Test05', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test05', |
| | | Manual_Entry__c = false |
| | | ); |
| | | Product2 prod06 = new Product2( |
| | | Name = 'Test06', |
| | | ProductCode = 'Test06', |
| | | Asset_Model_No__c = 'Test06', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c = Date.today(), |
| | | Category5__c = 'test06', |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 }; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false); |
| | | Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false); |
| | | Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06}; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id); |
| | | Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id); |
| | | insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 }; |
| | | insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3}; |
| | | List<Consumable_order__c> orderList = new List<Consumable_order__c>(); |
| | | //销售 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | |
| | | conList3.add(con3); |
| | | insert conList3; |
| | | |
| | | |
| | | //reset |
| | | // Consumable_order_details2__c con1 = new Consumable_order_details2__c(); |
| | | // con1.Intra_Trade_List_RMB__c = 1000; |
| | |
| | | // conList3.add(con9); |
| | | // LexCancelRemoveBoxController.searchConsumableorderdetails('100112','Testaccount003','重庆','ET'); |
| | | |
| | | |
| | | |
| | | //orderDetails2 |
| | | // Consumable_order_details2__c con00 = new Consumable_order_details2__c(); |
| | | // con00.Box_Piece__c = '个'; |
| | |
| | | // insert conList3; |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController CancelRemoveBoxController = new LexCancelRemoveBoxController(); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails( |
| | | '100611\n10078\n10099\n1009999\n100999', |
| | | 'Testaccount003', |
| | | '重庆', |
| | | 'ET' |
| | | ); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails( |
| | | '100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011', |
| | | 'Testaccount003', |
| | | '北京', |
| | | 'ET' |
| | | ); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails( |
| | | '100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011', |
| | | 'Testaccount003', |
| | | '重庆', |
| | | 'ET' |
| | | ); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10099\n1009999\n100999','Testaccount003','重庆','ET'); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','北京','ET'); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','重庆','ET'); |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |