Tutorial 34 - Sales Order, Generated Transactions as a Process

In this Tutorial you will configure a Process Procedure* that will retrieve "Orders" from the SalesPO table and generate three basic accounting transactions applicable to each Revenue item plus a final offsetting total transaction for the Order/Invoice itself:
the three basic "revenue" transactions:
credit Revenue
debit Cost of Sales
credit Inventory
if an Order/Invoice contains more than one item, the three basic "revenue" transactions will be repeated for each item;
and a final offsetting transaction:
debit Accounts Receivable

On completing a balanced record, the SalesPO record is updated by changing the Status from "Order" to "Invoice" and updating the TX Number from "0" to the Tx Number assigned to the generated Document in the Tx Detail table.

The Process Procedure which you will complete in this Tutorial can be beneficial for situations where you wish to finalize Orders on a Batch Basis e.g. you will specify a Parameter input that allows you provide Invoice and Date ranges.

Exercise 34 - 1, Configure the "FinalizeOrder" Process Procedure
Launch the Process Procedures editor.

Follow the example shown. Objects with Search Inspector settings (i.e. Retrieval and Update) have been numbered (1-6) and their settings are listed below the Procedure's image (Retrieval objects which do not have the More rows found? Condition object are single row retrievals).

There are four Make TX objects (numbered Tx1 - Tx4) which require Inspector settings in a format which you have not yet encountered in prior Tutorials, we have included all four Inspector images to show you how to do it.

Please Note:
The GL Account data type is interpreted as a Text type. In order to generate the transactions you have to know the GL Accounts which apply to each of the entries:

you do know that the Accounts Receivable is 112 and
Inventory is 120, so these are "hard-coded" in the Inspector settings for the Make Tx objects.
When you created the Invent table, you included a Cost GL field (Text type) to know which Cost of Sales GL Account applies to a given inventory item. However, you did not record the Revenue account. There are several options that could have been followed, for example:
create a Global table to hold both the Revenue and its corresponding Cost of Sales account, and then include them in the Inventory table (Invent) records as linked fields; or,
have each inventory item in the Invent table carry both the Revenue and its corresponding Cost of Sales account as local fields; etc., etc.
In Tutorial 11 you created the Invent template with a local field Cost GL to hold the Cost of Sales GL Account number. In Tutorial 13 we asked you to establish the inventory of accounts - when you did that, you may have noticed that there is a deliberate relationship between the Revenue account and its corresponding Cost of Sales account (Revenue account 510 has 610 as its Cost of Sales account). We instructed you in that manner in order to be able to have you "derive" the Revenue GL Account in this Tutorial. Here is how you will do it when you configure the FinalizeOrder Process Procedure:
Retrieve the Cost GL from the Invent table
convert Cost GL of Text type to GL Cost of Integer type (using the TextToInteger Function);
derive GL Rev by subtracting 100 from GL Cost;
convert GL Rev of Integer type to Rev GL of Text type (using the IntegerToText Function).


Retrieval and Update Inspector Settings:


1. Retrieval: Multiple rows (distinct only)
Search: Status = Order (hard-coded)
Date Search Key Document Date
Invoice # Search Key Invoice #
Sort: Invoice # ASC
2. Search: Terms Code = SalesPO.[Terms Code]
3. Search: Invoice # = SalesPO.[Invoice #]
4. Search: Product Code = SalesPO.[Product Code]
5. Search: Document Date = SalesPO.Date
Reference # = Ref#
Document Name = SINV
6. Search: Invoice # = SalesPO.[Invoice #]









Make TX Inspector Settings:
For a detailed explanation of the Make TX object and its Inspector settings please go to the on-line Help (look for Make TX Object in the Index).



Setting for Make TX Tx1

Setting for Make TX Tx2

Setting for Make TX Tx3

Setting for Make TX Tx4

Please Note:
The Inspector view of the last Make TX in the transaction series has the TX doc done switch checked. This causes the generated accounting Document to be finalized.

Exercise 34 - 2, Run the "FinalizeOrder" Process Procedure


1. Launch the Run Process function, select the Process > Select... menu item, and select FinalizeOrder from the Select Process panel:

2. Specify the Search Key and press the Run button.
When you created the Process Procedure, you specified in the Inspector that both Parameters be subject to SEARCH KEY i.e. the Operator selection is deferred to run-time. The Run process FinalizeOrder panel gives you that opportunity. At this point you should have the four "Order" documents in the SalesPO table that you created as part of Tutorial 33. By setting the Operators of both Parameters to != (not equal), the Process will act on all SalesPO records subject to any Search restrictions. In the FinalizeOrder Process Procedure one such restriction is that the Search is limited to records with the Status of Order.

3. Launch the Transaction Data Entry function and click on the Find button. Set your Search Criteria in the Find records panel e.g. where the Date changed = current date and Time changed > the time just before you ran the Process. Set the Sort Order to TX number ASC. Press the OK button.
This should load the four Documents that you just generated into the browser with the Document Name of SINV.

4. Select the first Document and the first Document line. The Transaction Data Entry window should now look like this (the Preferences for the Change field were not set to display it):

Compare the data with the Sales Order Invoice #1 in Tutorial 33. They match and, in addition, you will note the generated transactions for GL Accounts 6xx and 120 for Cost of Sales and Inventory reduction.

5. Select the last row in the Document lines browser.
This will load the the Accounts Receivable transaction into the Transaction Data Entry windows template area - note that the Due Date is the same as the Document Date. This Customer's terms calls for credit card (MasterCard) payment, hence the Due Date is equal to the Document Date.

6. Select the Tools > Open items... menu item.
This will display the Open Item window for that specific customer.

Go To
  Tutorial 35 - Sales Order, Generated Transactions as a Procedure