Planned Scenario and Configuration Changes:
Assumptions
Online Store scenario
Customer always pays in advance and products shipped afterwards
Advance payment is shown posted to 213500 Customer Deposit Accounts
Sales Invoice (Tax Invoice) creation triggers sales transaction
Accounts Setup to be modified
Accounting / General Ledger / Setup (for Company)
Select Chart of GL Accounts defaults tab
GL Account Type Defaults
Change 'Accounts Receivable' entry to point to '213500 Customer Deposits Accounts' instead of '120000 Accounts Receivable'
Why is this a liability account instead of an asset account?
The customer has paid you for something he hasn't yet received
Legally until the Sales Invoice is generated that specifies the sale and tax components then they cannot be logged in those accounts yet.
When you fulfill your obligation to the customer then you can reclassify the money received as sales and tax.
Sales Invoice
No change – as it is when invoice is generated that we record the sale and expense the cost to sales.
Payment Type / GL Account Id
Look at 'Customer Payment' entry as this currently points to transaction type 'Accounts Receivable'. This should be OK to leave as it is because we have already set any Accounts Receivable Transactions to use '213500' instead of '120000' in the GL Account Type defaults.
Payment Method ID / GL Account
I would look at changing either changing 'Electronic Funds Transfer' and 'Company Account' to point to 'Undeposited Receipts' or remove these as options for simplicity as they post to the company's GL bank account.
Sample Scenario
Customer creates a Sales Order via the Online Store
No accounting transactions created.
Company approves the Sales Order
No accounting transactions created.
Company receives the payment from the Customer for the Sales Order (via any means)
Incoming Payment transaction is generated that is based on the GL Account defaults
Debit account is based on the GL Account defaults for Payment Method Id/GL Account Id (eg Cash is setup as '112000 Undeposited Receipts'.
Credit account is based on the 'Accounts Receivable GL Account Type Defaults' mapping so should be our '213500 Customer Deposit Account'
Do a Quick Ship Entire Order
This creates 3 main accounting transactions:
Sales Shipment transaction created.
This transaction removes stock from the inventory warehouse and updates the Cost of Goods Sold.
Debits account is based on the Inventory GL Account Type defaults (140000 Inventory)
Credit account is based on the Cost of Goods Sold GL Account Type defaults (500000 Cost of Goods Sold)
Sales Invoice transaction created
This transaction should record the sale. It should remove the money from the liability account and split it into the the sales, tax and other expenses.
Debit account is based on the 'Accounts Receivable GL Type Account Type Defaults' which should now be our '213500 Customer Deposit Account'
Credit Sales / Revenue (this is based on Accounting / GL Account Defaults / Sales Invoice mappings)
Credit Tax (if applicable )
Credit Shipping Expense (if applicable)
Credit Discounts (if applicable)
Payment Applied
This transaction shows that the money received has been logged against an invoice. For this business process I think the generation of the Sales invoice has already associated the money with an invoice.
At the moment OFBiz does a Debit and Credit to the same account. I think this is the one pointed to by the GL Type Account Defaults for 'Accounts Receivable' – so I would still expect a transaction here (using maybe 215300 instead) but I don't think it is of any use for this scenario.
The only other transaction required I can see is that the money at some point should be moved from '112000 Undeposited Receipts' into the '111100 Company bank account' – but not sure if this should be the 'Confirm Payment' transaction instead.
I'd expect a transaction such as:
Debit '111100 Company bank account'
Credit '112000 Undeposited Receipts'