| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | product.Asset_Model_No__c = '11111'; |
| | | product.ProductCode = 'OTV-SP1H-NA-12E'; |
| | | product.MDM_Model_No__c = 'test'; |
| | | product.CanNotCancelledGurantee__c=true; |
| | | insert product; |
| | | |
| | | Product_Register__c prc = new Product_Register__c(Name = '国械注进20162220210', |
| | | MedPrdClass__c = '3', |
| | | ValidFrom__c = date.newinstance(2018, 07, 22), |
| | | ValidTo__c = date.newinstance(2028, 07, 22), |
| | | RegisterNoClass_Old__c = '6815', |
| | | RegisterNoClass_New__c = '6815', |
| | | RegisterNoStatus__c = '有效' |
| | | ); |
| | | insert prc; |
| | | |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = product.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | |
| | | PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=product.Id); |
| | | entry.UnitPrice = 0; |
| | |
| | | opp.AccountId = depart.Id; |
| | | opp.Department_Class__c = section.Id; |
| | | opp.Hospital__c = company.Id; |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.Name = 'GZ-SP-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | // opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.today(); |
| | | opp.Agency1__c = company1.Id; |
| | | opp.Authorized_DB_No__c = 'Test20180522'; |
| | | opp.Contract_DB_SalesDept_complite_day__c = date.newinstance(2019, 05, 22); |
| | | opp.NotesApprovedNo__c = 'Test20180622'; |
| | | opp.Estimation_Id__c = ''; |
| | | opp.multiYearWarranty__c =true; |
| | | insert opp; |
| | | |
| | | Quote quo = new Quote(); |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | |
| | | System.Test.startTest(); |
| | | |
| | | //QuoteLineItem qli = new QuoteLineItem(); |
| | | //qli.QuoteId = quo.Id; |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | // opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.today(); |
| | | opp.Agency1__c = company1.Id; |
| | | opp.Authorized_DB_No__c = 'Test20180522'; |
| | | opp.Contract_DB_SalesDept_complite_day__c = date.newinstance(2019, 05, 22); |
| | | opp.NotesApprovedNo__c = 'Test20180622'; |
| | | opp.Estimation_Id__c = ''; |
| | | opp.multiYearWarranty__c =true; |
| | | insert opp; |
| | | |
| | | Quote quo = new Quote(); |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | product3.Asset_Model_No__c = '11111'; |
| | | product3.MDM_Model_No__c = '123'; |
| | | product3.ProductCode = 'OTV-SP1H-NA-12E'; |
| | | |
| | | product3.CanNotCancelledGurantee__c=true; |
| | | insert product3; |
| | | |
| | | PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=product3.Id); |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.oldData_flg__c = true; |
| | | // opp.oldData_flg__c = true; //20221229 lt DB202211430986 询价历史不使用字段 |
| | | opp.Estimation_Decision__c = true; |
| | | update opp; |
| | | //Test.stopTest(); |
| | | } |
| | | |
| | | //static testMethod void testUpdateHospital() { |
| | | //static testMethod void testUpdateHospital() { |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | // opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.today(); |
| | | opp.Agency1__c = company1.Id; |
| | | opp.Authorized_DB_No__c = 'Test20180522'; |
| | | opp.Contract_DB_SalesDept_complite_day__c = date.newinstance(2019, 05, 22); |
| | | opp.NotesApprovedNo__c = 'Test20180622'; |
| | | opp.Estimation_Id__c = ''; |
| | | opp.multiYearWarranty__c =true; |
| | | insert opp; |
| | | |
| | | Quote quo = new Quote(); |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | product3.Asset_Model_No__c = '11111'; |
| | | product3.MDM_Model_No__c = '123'; |
| | | product3.ProductCode = 'OTV-SP1H-NA-12E'; |
| | | |
| | | product3.CanNotCancelledGurantee__c=true; |
| | | insert product3; |
| | | |
| | | PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=product3.Id); |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.oldData_flg__c = true; |
| | | // opp.oldData_flg__c = true; //20221229 lt DB202211430986 询价历史不使用字段 |
| | | opp.Estimation_Decision__c = true; |
| | | // opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.Agency1__c = company1.Id; |
| | | // opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.today(); |
| | | opp.Authorized_DB_No__c = 'Test20180522'; |
| | | opp.Contract_DB_SalesDept_complite_day__c = date.newinstance(2019, 05, 22); |
| | | opp.NotesApprovedNo__c = 'Test20180622'; |
| | | opp.Estimation_Id__c = ''; |
| | | opp.multiYearWarranty__c =true; |
| | | insert opp; |
| | | |
| | | Quote quo = new Quote(); |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | product3.Asset_Model_No__c = '11111'; |
| | | product3.MDM_Model_No__c = '123'; |
| | | product3.ProductCode = 'OTV-SP1H-NA-12E'; |
| | | product3.CanNotCancelledGurantee__c=true; |
| | | |
| | | insert product3; |
| | | |
| | |
| | | insert oppli; |
| | | |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.oldData_flg__c = true; |
| | | // opp.oldData_flg__c = true; //20221229 lt DB202211430986 询价历史不使用字段 |
| | | opp.Estimation_Decision__c = true; |
| | | update opp; |
| | | //Test.stopTest(); |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | opp.Trade__c = '外貿'; |
| | | opp.StageName = '引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | // opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.today(); |
| | | opp.Agency1__c = company1.Id; |
| | | opp.Authorized_DB_No__c = 'Test20180522'; |
| | | opp.Contract_DB_SalesDept_complite_day__c = date.newinstance(2019, 05, 22); |
| | | opp.NotesApprovedNo__c = 'Test20180622'; |
| | | opp.Estimation_Id__c = ''; |
| | | opp.multiYearWarranty__c =true; |
| | | opp.CurrencyIsoCode = 'USD'; |
| | | insert opp; |
| | | |
| | | Quote quo = new Quote(); |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | product3.Asset_Model_No__c = '11111'; |
| | | product3.MDM_Model_No__c = '123'; |
| | | product3.ProductCode = 'OTV-SP1H-NA-12E'; |
| | | product3.CanNotCancelledGurantee__c=true; |
| | | |
| | | insert product3; |
| | | |
| | |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.oldData_flg__c = true; |
| | | // opp.oldData_flg__c = true; //20221229 lt DB202211430986 询价历史不使用字段 |
| | | opp.Estimation_Decision__c = true; |
| | | update opp; |
| | | //Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void test_00() { |
| | | NFM007Controller controller = new NFM007Controller(); |
| | | controller.test(); |
| | | } |
| | | } |