| | |
| | | sptc.dataBeans[1].amount[0].Amount = 200; |
| | | sptc.dataBeans[1].isChanged = '1'; |
| | | sptc.saveBtn(); |
| | | |
| | | |
| | | sptc.UpdateBtn(); |
| | | List<Opportunity> opps = [select Id,SAP_Province__c,Amount,Owner_System__c from Opportunity where RecordTypeId = :rt[0].Id order by ownerId]; |
| | | System.assertEquals(24, opps.size()); |
| | | System.assertEquals('北京市', opps[0].SAP_Province__c); |
| | | System.debug('opps======+++'+opps); |
| | | // sptc.isDelete(sptc.dataBeans); |
| | | // System.assertEquals(24, opps.size()); |
| | | // System.assertEquals('北京市', opps[0].SAP_Province__c); |
| | | //System.assertEquals(u1.Id, opps[0].Owner_System__c); |
| | | System.assertEquals(100, opps[0].Amount); |
| | | System.assertEquals('天津市', opps[12].SAP_Province__c); |
| | | // System.assertEquals(100, opps[0].Amount); |
| | | // System.assertEquals('天津市', opps[12].SAP_Province__c); |
| | | //System.assertEquals(u2.Id, opps[12].Owner_System__c); |
| | | System.assertEquals(200, opps[12].Amount); |
| | | // System.assertEquals(200, opps[12].Amount); |
| | | |
| | | // 上年度 |
| | | sptc.previous(); |
| | |
| | | insert opp1; |
| | | |
| | | SetProvinceTargetController sptc = new SetProvinceTargetController(); |
| | | |
| | | sptc.getSalesDptOpts(); |
| | | // 初期表示 |
| | | sptc.init(); |
| | | |
| | | System.assertEquals('北京市', sptc.dataBeans[0].opportunity.SAP_Province__c); |
| | | // System.assertEquals('北京市', sptc.dataBeans[0].opportunity.SAP_Province__c); |
| | | //System.assertEquals(u1.Id, sptc.dataBeans[0].opportunity.Owner_System__c); |
| | | System.assertEquals(150, sptc.dataBeans[0].amount[0].Amount); |
| | | // System.assertEquals(150, sptc.dataBeans[0].amount[0].Amount); |
| | | |
| | | // 保存,上年度 |
| | | sptc.dataBeans[0].amount[0].Amount = 100; |
| | |
| | | opp2.OCM_Target_period__c = currentPeriod(-2); |
| | | opp2.Target_Source__c = 'SetProvinceTarget'; |
| | | insert opp2; |
| | | |
| | | OCM_Management_Province__c aaa = new OCM_Management_Province__c(); |
| | | aaa.Province__c='上海市'; |
| | | aaa.GI_assistant__c=u2.Id; |
| | | aaa.SP_assistant__c=u2.Id; |
| | | aaa.Name='上海'; |
| | | insert aaa; |
| | | SetProvinceTargetController sptc = new SetProvinceTargetController(); |
| | | |
| | | // 初期表示 |
| | |
| | | sptc.searchByDpt(); |
| | | //导出 |
| | | sptc.exportBycsv(); |
| | | sptc.csvAsString = '销售本部,省,担当,GI,ET,BF,GS,URO,GYN,ENT,ENG\n5.华东,上海市,张四洋,2000,2345,123,1200,400,500,40,55'; |
| | | sptc.csvAsString = '销售本部,省,GDP,GI,ET,BF,GS,URO,GYN,ENT,ENG\n5.华东,上海市,100,2000,2345,123,1200,400,500,40,55'; |
| | | //test read csv file |
| | | sptc.importCSVFile(); |
| | | |