From 5670fe7b9579fb7f25c2bf6f70b5026c54232f77 Mon Sep 17 00:00:00 2001 From: IJ Kim Date: Mon, 22 Aug 2016 21:03:20 -0400 Subject: [PATCH] removed NET+ from the apportunity names --- lib/sf/account.rb | 2 +- lib/sf/opportunity.rb | 12 ++++++------ lib/sf/version.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/sf/account.rb b/lib/sf/account.rb index b0f01dc..4bdaf75 100644 --- a/lib/sf/account.rb +++ b/lib/sf/account.rb @@ -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? diff --git a/lib/sf/opportunity.rb b/lib/sf/opportunity.rb index d440226..7b138b0 100644 --- a/lib/sf/opportunity.rb +++ b/lib/sf/opportunity.rb @@ -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(', ') @@ -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 diff --git a/lib/sf/version.rb b/lib/sf/version.rb index 49091ea..8258351 100644 --- a/lib/sf/version.rb +++ b/lib/sf/version.rb @@ -1,3 +1,3 @@ module Sf - VERSION = "0.1.39" + VERSION = "0.1.40" end