This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
State,ZipCode,TaxRegionName,StateRate,EstimatedCombinedRate,EstimatedCountyRate,EstimatedCityRate,EstimatedSpecialRate,RiskLevel | |
CA,90001,"LOS ANGELES COUNTY",0.060000,0.095000,0.002500,0,0.032500,2 | |
CA,90002,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,2 | |
CA,90003,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,1 | |
CA,90004,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,2 | |
CA,90005,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,2 | |
CA,90006,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,2 | |
CA,90007,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,2 | |
CA,90008,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,5 | |
CA,90009,"LOS ANGELES CO",0.060000,0.095000,0.002500,0.000000,0.032500,1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"public_id"=>["portraits_eg2ut5_rxijma"], | |
"version"=>["1585070106"], | |
"signature"=>["f5e8896f0f8a56414e070fd5fcc720fa96c835e4"], | |
"width"=>["2835"], | |
"height"=>["2835"], | |
"format"=>["jpg"], | |
"resource_type"=>["image"], | |
"created_at"=>["2020-03-24T17:15:06Z"], | |
"pages"=>["1"], | |
"bytes"=>["701652"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The actual string of the start date and end date in the two lines below need to be adjusted to reflect the date range of the inquiries you want to update. | |
# This script is safe to run even on inquiries that successfully sync'd to Salesforce. Therefore, you dont need to find the exact Inquiries that didnt sync, | |
# you can just run this for the entire day where the problem occured. | |
start_date = Time.strptime('06-10-2020', '%m-%d-%Y').beginning_of_day.in_time_zone | |
end_date = Time.strptime('06-10-2020', '%m-%d-%Y').end_of_day.in_time_zone | |
errors = [] | |
Inquiry.where('created_at >= ? AND created_at < ?', start_date, end_date).each do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******NOTE: Keep in mind this was a raw query but it should at least give a pretty accurate picture. | |
****** The numbers are in integers, so the total you see in #1 is $17,740,905 | |
1. | |
Paid Orders from '2020-06-01 00:00:00' till '2021-06-01 00:00:00' | |
It was 121786 orders | |
TOTAL: 17740905 | |
by payment_method: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. change has_existing_website? method on Inquiry.rb | |
### current method | |
def has_existing_website? | |
dynamic_fields.present? && dynamic_fields['has_website'] == 'Yes' | |
end | |
#### should be changed to: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
charges.id, | |
charges.description, | |
charges.captured_at, | |
(amount / 100) as amount, | |
refunded, | |
(charges.amount_refunded / 100) as amount_refunded, | |
subscriptions.plan_id, | |
subscriptions.created, | |
customers.email, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### OLD | |
def passes_budget? | |
if cbt_is_photographer? | |
if budget_okup? | |
true | |
else | |
false | |
end | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The actual string of the start date and end date in the two lines below need to be adjusted to reflect the date range of the inquiries you want to update. | |
# This script is safe to run even on inquiries that successfully sync'd to Salesforce. Therefore, you dont need to find the exact Inquiries that didnt sync, | |
# you can just run this for the entire day where the problem occured. | |
start_date = Time.strptime('10-15-2021', '%m-%d-%Y').beginning_of_day.in_time_zone | |
end_date = Time.strptime('10-15-2021', '%m-%d-%Y').end_of_day.in_time_zone | |
errors = [] | |
Inquiry.where('created_at >= ? AND created_at < ?', start_date, end_date).each do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The actual string of the start date and end date in the two lines below need to be adjusted to reflect the date range of the inquiries you want to update. | |
# This script is safe to run even on inquiries that successfully sync'd to Salesforce. Therefore, you dont need to find the exact Inquiries that didnt sync, | |
# you can just run this for the entire day where the problem occured. | |
start_date = Time.strptime('05-11-2021', '%m-%d-%Y').beginning_of_day.in_time_zone | |
end_date = Time.strptime('05-12-2021', '%m-%d-%Y').end_of_day.in_time_zone | |
errors = [] | |
Inquiry.where('created_at >= ? AND created_at < ?', start_date, end_date).each do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@client.update!( | |
"Lead", | |
id: lead_id, | |
FirstName: (inquiry.name.present? ? inquiry.first_name : sf_lead.FirstName), | |
LastName: (inquiry.name.present? ? inquiry.last_name : sf_lead.LastName), | |
Email: inquiry.email.delete(" "), | |
Phone: (inquiry.phone.present? && inquiry.phone != "n/a") ? inquiry.phone.try(:first, 15) : sf_lead.phone, | |
City__c: (inquiry.incoming_params["city"] if inquiry.incoming_params.present?), | |
State__c: (inquiry.incoming_params["state"] if inquiry.incoming_params.present?), | |
Country__c: (inquiry.incoming_params["country"] if inquiry.incoming_params.present?), |