Skip to content

Commit

Permalink
removed NET+ from the apportunity names
Browse files Browse the repository at this point in the history
  • Loading branch information
ij committed Aug 23, 2016
1 parent 7e153c4 commit 5670fe7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/sf/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def self.intl_partner?(account_id)
intl_partners.map(&:Id).include?(account_id)
end

# It looks up for the past one year
# Accounts with a closed won opportunity but not yet the "InCommon Control" check box is checked.
def self.inc_parts_to_be
acct_ids = Sf::Opportunity.inc_participations(Date.today.prev_month(2)).map(&:AccountId)
if acct_ids.empty?
Expand Down
12 changes: 6 additions & 6 deletions lib/sf/opportunity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ class Sf::Opportunity
attr_reader :sobject

FIELDS = [
'Id', 'Name', 'AccountId', 'CloseDate', 'IsClosed', 'IsWon', 'StageName',
'Id', 'Name', 'AccountId', 'CloseDate', 'IsClosed', 'IsWon', 'StageName',
'Amount', 'Type', 'Bill_to_Contact__c', 'Priority__c', 'Private__c',
'Program__c', 'Division__c', 'Sold_to_Contact__c', 'Term__c'
'Program__c', 'Division__c', 'Sold_to_Contact__c', 'Term__c'
]
FIELDS_SELECT_STR = FIELDS.join(', ')

Expand All @@ -27,15 +27,15 @@ def respond_to_missing?(method_name, include_private = false)

def self.inc_participations(since_date=nil)
since_date ||=Date.today
since = since_date.to_date.to_s
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from Opportunity where Name='NET+ - InCommon Participation' and IsWon = true and CloseDate >= #{since}")
since = since_date.to_date.to_s
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from Opportunity where Name like '%InCommon Participation%' and IsWon = true and CloseDate >= #{since}")
build_collection sobjects unless sobjects.blank?
end

def self.cert_subscribers(since_date=nil)
since_date ||=Date.today
since = since_date.to_date.to_s
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from Opportunity where Name='NET+ - Certificate Service' and IsWon = true and CloseDate >= #{since}")
since = since_date.to_date.to_s
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from Opportunity where Name like '%Certificate Service%' and IsWon = true and CloseDate >= #{since}")
build_collection sobjects unless sobjects.blank?
end
end
2 changes: 1 addition & 1 deletion lib/sf/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Sf
VERSION = "0.1.39"
VERSION = "0.1.40"
end

0 comments on commit 5670fe7

Please sign in to comment.