Skip to content
Pages · Examples

An invoice when a deal closes

Applies to Invoice

What we will build#

CardSetting
MappingOpportunity → Invoice: customer from the Account name, dates, memo, addresses; one invoice line per Opportunity Product; the QB Invoice stored in a lookup on the Opportunity
OutboundCreated and Updated rules: Stage equals Closed Won

Step 1: Map the invoice header#

  1. Create a lookup field QB Invoice on Opportunity, pointing to the QB Invoice object. It will hold the link to the invoice (see Sales sees who has paid).
  2. On QB Bridge Entities, pick Invoice, open Mapping and choose Opportunity. CustomerRef is added for you; click + Add Header Mapping Row for each other row:
QBO FieldSalesforce Field
CustomerRef (required)Account › Account Name: QB Bridge finds the synced customer by name
TxnDateClose Date
DueDateformula CloseDate + 30
CustomerMemo.valueOpportunity Name
BillAddr.Line1, .City, .CountrySubDivisionCode, .PostalCodeAccount billing street, city, state, postal code
ShipAddr.Line1formula IF(ISBLANK(Account.ShippingStreet), Account.BillingStreet, Account.ShippingStreet) (and the same for the city)

The Invoice header. DueDate and the two ShipAddr rows are formulas.

Step 2: Map the lines#

  1. In 3. Line Item Detail Types, expand SalesItemLineDetail and choose Opportunity Product as Salesforce Object for this Line Type (Child Relationship Mapping).
  2. Map the line fields, pick QB Invoice under 4. QBO ID Storage, and save.
QBO FieldSalesforce Field
Amount (required)Total Price
ItemRef (required)Product › Product Name
QtyQuantity
UnitPriceSales Price
DescriptionLine Description

The invoice lines: one line per Opportunity Product.

Step 3: Send at Closed Won#

  1. Build the Opportunity Flows for create and update.
  2. Click the Invoice Outbound to QuickBooks card. In Invoice Trigger Rules, switch On Salesforce Opportunity Record Create and … Record Update to Enabled; in each, add the row Stage Equals Closed Won with Logic Formula 1. Click Save Trigger.

Prove it#

CheckResult
At Prospecting, nothing is sentNothing queued
Closed Won creates one invoice with three linesQuickBooks invoice 1174 for Bluebird Dental: Standing Desk × 4 at 640, Ergo Chair × 4 at 320, Monitor Arm × 8 at 95; total 4,600
Due 30 days after closeClose Date 2 Dec, Due Date 1 Jan
No shipping address → billing addressShip-to city Denver: the billing address
The Opportunity links to the invoiceIts QB Invoice field points to the QB Invoice record INV-0013 (Payment Status Unpaid, Balance 4,600), with its lines

Invoice 1174 as QuickBooks shows it: one line per Opportunity Product, the shipping address from the billing address, and the due date 30 days after the close date. The customer reads Bluebird Dental Group because finance renamed it in QuickBooks later (next page).

Video: Closed Won to invoice, start to finish.

Where to next#