Skip to content

Sales Receipts

Syncing Sales Receipts

Sales Receipts are another Quickbooks object that represent a customer payment. They signify a payment that has already been collected. We use the opportunity object in Salesforce to signify Sales Receipts.

Required Configuration

Because Sales Receipts are created as opportunities, we need to configure the following:

  • Stage Name
  • Pricebook

This configuration data is stored in the Custom Metadata QIME Parameter

Sales Receipt Stage Name

We can set the stage name opportunities are created with under the Sales Receipt Stage metadata type. The default stage is Closed Won.

Sales Receipt Stage Mapping

Sales Receipt Pricebook

We can set the pricebook opportunities are created with under the Sales Receipt Pricebook metadata type. This must be configured.

Sales Receipt Pricebook

Sales Receipt Lookback

We can set the amount of hours that sales receipts are queried with under the Sales Receipt Hours Lookback metadata type. The deafult is 24 hours.

Sales Receipt Lookback

Sales Receipt Mapping

Opportunity Mapping

QuickBooks FieldSalesforce LabelSalesforce API Name
Transaction DateClose DateCloseDate
Customer IdCustomer Idcustomer_id__c
IdQBO IDqbo_Id__c
Document NumberDocument NumberDocuement_Number__c
NameSR-DocNumberqbo_SyncToken__c
Delivery TimeDelivery TimeDelivery_Time__c
All EmailsAll Emailsall_emails__c
All CC EmailsAll CC Emailsall_cc_emails__c
All BCC EmailsAll BCC Emailsall_bcc_emails__c
Payment MethodPayment Methodpayment_Method__c
Payment StatusPayment StatusPayment_Status__c
BalanceBalanceBalance__c
TaxTaxtax__c
ClassClassclass__c

Opportunity Product Mapping

QuickBooks FieldSalesforce LabelSalesforce API Name
IdQBO IDqbo_Id__c
Document NumberDocument NumberDocuement_Number__c
Line NumberLineNumLineNum__c
AmountSales PriceUnitPrice
DescriptionDescriptionDescription
ItemRef IdItemRef IdItemRef_Id__c
QtyQuantityQuantity
ClassClassClass__c

Syncing Classes

Classes are a way of further categorizing transactions. They can be configured at the top level of the transactrion or the product level. Learn more about classes here

Syncing All Sales Receipts

During an initial setup, it is advised to sync all sales receipts from QuickBooks to Salesforce. To bring all sales receipts from QuickBooks to Salesforce, perform the following:

  1. Open the Developer Console
  2. Run the following code snippet
System.enqueueJob(new qime.QBSalesReceiptQueueable(0, 0, 50, 0));

Scheduling Sales Receipts Sync

Sales Receipts can be brought over hourly. To schedule Sales Receipts syncing, use the scheduled jobs tab in the QIME app. To manually schedule, perform the following:

  1. Open the Developer Console
  2. Run the following code snippet
System.schedule('QB Sales Receipt Sync XX:00', '0 0 * * * ?', new qime.QBSalesReceiptBatch());