Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<BarData> getOpportunityTarget(){
- Integer CurrentMonth = Date.Today().Month();
- Decimal total = 0.0;
- TargetList = new List<BarData>();
- if(MonthlyTargetMap.get(currentMonth) != null){
- if(OpportunityList.size()>0){
- for(Opportunity objOpportunity : OpportunityList){
- if(objOpportunity.StageName == 'Approved' && objOpportunity.Amount != null && objOpportunity.closeDate.Month() == CurrentMonth){
- total += objOpportunity.Amount;
- }
- }
- TargetList.add(new BarData('Closed',total.setScale(0)));
- TargetList.add(new BarData('Target',MonthlyTargetMap.get(currentMonth).setScale(0)));
- }else{
- TargetList.add(new BarData('Closed',0));
- TargetList.add(new BarData('Target',MonthlyTargetMap.get(currentMonth).setScale(0)));
- }
- }
- return TargetList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement