Skip to content

Add billing account information for Work Manager #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/routes/billingAccounts/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = [
}
const { accessToken, instanceUrl } = await SalesforceService.authenticate();
// eslint-disable-next-line
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c, Active__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c, Active__c, Start_Date__c, End_Date__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
req.log.debug(sql);
const billingAccount = await SalesforceService.queryBillingAccount(sql, accessToken, instanceUrl, req.log);
const isMachineToken = _.get(req, 'authUser.isMachine', false);
Expand Down
2 changes: 2 additions & 0 deletions src/services/salesforceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class SalesforceService {
),
markup: _.get(o, config.get('sfdcBillingAccountMarkupField')),
active: _.get(o, config.get('sfdcBillingAccountActiveField')),
startDate: _.get(o, 'Start_Date__c'),
endDate: _.get(o, 'End_Date__c'),
}));
return billingAccounts.length > 0 ? billingAccounts[0] : {};
});
Expand Down