Workflow: WooCommerce Order (with Business Partner) to SAP Business One Order


First published on: 07/26/2023/10:44 pm

 

Workflow Description 

In this workflow, a scheduled job will call WooCommerce at regular intervals (configurable) to retrieve orders created since the last job run.

 

The import process will create the order, a down payment invoice, and an incoming payment for a specified business partner in SAP Business One. 

 

Workflow Diagram

Diagram

Description automatically generated 

 

 

If a specified or default business partner doesn't meet client requirements, there are two options:

 

  1. The sales order, downpayment invoice, and incoming payment documents can be created for an existing business partner if there's data on the incoming WooCommerce order that can uniquely identify a match in SAP Business One (e.g., an email address).
  2. If the business partner can't be identified in SAP Business One, a new business partner record can be created in the workflow.

 

If guest checkouts are allowed, the workflow can be configured to perform a combination of these two scenarios: create guest orders for one default business partner and other documents for specific business partners. 

 

 

Diagram

Description automatically generated 

 

Field Mappings 

SAP Business One order

 

WooCommerce Order

SAP Business One Field

Comments 

Header 

date_created 

ORDR.DocDate 

 

date_created 

ORDR.DocDueDate 

 

 

ORDR.CardCode 

 

 

ORDR.CardName 

First name + Last name 

number 

ORDR.NumAtCard 

 

 

ORDR.Confirmed 

“tYES” 

Id 

ORDR.U_V33SB_EXTERNALORDERID 

 

 

ORDR.U_V33SB_EXTERNALORDERSRC 

“WooCommerce” 

 

ORDR.HandWritten 

“tNO” 

Addresses 

billingAddress/address_1 

RDR12.StreetB 

 

billingAddress/city 

RDR12.CityB 

 

billingAddress/postcode 

RDR12.ZipCodeB 

 

billingAddress/regionCode 

RDR12.StateB 

 

billingAddress/country 

RDR12.CountryB 

 

shipping/address/address_1 

RDR12.StreetS 

 

shipping/address/city 

RDR12.CityS 

 

shipping/address/postcode 

RDR12.ZipCodeS 

 

shipping/address/regionCode 

RDR12.StateS 

 

shipping/address/country 

RDR12.CountryS 

 

billingAddress/address_2 

RDR12.Address2B 

 

 

RDR12.Address3B 

first_name + last_name 

shipping/address/address_2 

RDR12.Address2S 

 

 

RDR12.Address3S 

first_name + last_name 

LineItems 

sku 

RDR1.ItemCode 

 

quantity 

RDR1.Quantity 

 

price 

RDR1.UnitPrice 

 

total 

RDR1.LineTotal 

 

 

RDR1.TaxCode 

Exempt Tax Code 

 

RDR1.WhsCode 

01 

id 

RDR1.U_V33SB_EXTERNALLINEID 

 

Expenses (Tax and Freight) 

total_tax 

RDR3.ExpnsCode 

 

total_tax 

RDR3.LineTotal 

 

 

RDR3.TaxCode 

Exempt Tax Code 

shipping_total 

RDR3.ExpnsCode 

 

shipping_total 

RDR3.LineTotal 

 

 

RDR3.TaxCode 

Exempt Tax Code 

 

Tax and freight are created as expenses on the order, so no tax code/rate mapping is required.

 

To accommodate the configuration, expense codes called ‘WooCommerceTax’ and ‘WooCommerceFreight’ must be created.

 

 

 

SAP Business One A/R down payment invoice

 

WooCommerce Order

SAP Business One AR Docn Payment Invoice

Comments 

Header 

date_created 

ODPI.DocDate 

 

 

ODPI.DocDueDate 

 

 

ODPI.CardCode 

Order Business Partner Card Code 

total 

ODPI.DocTotal 

 

 

ODPI.Confirmed 

“tYES” 

 

ODPI.DownPaymentType 

“dptInvoice” 

id 

ODPI.U_V33SB_EXTERNALORDERID 

 

 

ODPI.U_V33SB_EXTERNALORDERSRC 

“WooCommerce” 

LineItems 

17 

DPI1.BaseType 

“17” 

items/id 

DPI1.BaseEntry 

Order DocEntry 

line_items/id + items/id 

DPI1.BaseLine 

Order Line Number 

 

 

 

SAP Business One incoming payment

 

WooCommerce Order

SAP Business One Incoming Payment

Comments 

Payments 

date_created 

ORCT.DocDate 

 

 

ORCT.DocType 

“rCustomer” 

 

ORCT.CardCode 

Order Business Partner Card Code 

Id 

ORCT.TrsfAcct 

concatenate id with query result of ”GetAccountCode” 

total 

ORCT.TrsfSum 

 

date_created 

ORCT.TrsfDate 

 

Payment_Invoices 

 

RCT2.InvType 

“it_DownPayment” 

id 

RCT2.DocEntry 

Base Invoice DocEntry 

total 

RCT2.SumApplied 

 

 

 

SAP Business One Business Partner

 

WooCommerce Order

SAP Business One Business Partner 

Hardcoded Values/Comments 

customer_id 

OCRD.U_V33SB_EXTBPID 

 

 

OCRD.CardType 

cCustomer 

 

OCRD.CardCode 

‘WC’ + customer_id 

 

OCRD.CardName 

first_name + last_name 

email 

OCRD.E_mail 

 

 

CRD1.Address 

‘Bill To’ 

billing/address_1 

CRD1.Street 

 

billing/postcode 

CRD1.ZipCode 

 

billing/city 

CRD1.City 

 

billing/country 

CRD1.Country 

 

billing/state 

CRD1.State 

 

 

CRD1.AdresType 

‘B’ 

 

CRD1.Address 

‘Ship To’ 

shipping/address_1 

CRD1.Street 

 

shipping/postcode 

CRD1.ZipCode 

 

shipping/city 

CRD1.City 

 

shipping/country 

CRD1.Country 

 

shipping/state 

CRD1.State 

 

 

CRD1.AdresType 

‘S’ 

 

Assumptions

  • The client must specify the default CardCode (business partner) for WooCommerce orders in SAP Business One. 

  • Create expense codes ‘WooCommerceTax’ and ‘WooCommerceFreight’. 

  • The client must specify the exempt tax code. 

  • The client must supply incoming payment account details for bank transfer payments. 

 

 

 

 

Previous

Next


  

Last modified: 08/30/2024/1:30 pm

-