Inventory Transactions


Last Edit: January 30, 2018 the alpha360 team

What we mean with the term Inventory Transactions are the records created in the following table:

  • iInventoryTransaction

when a Business Document - from the Sales, Purchase or Inventory area - is posted.

The iInventoryTransaction table

This is the main table for the Inventory transactions.

Business Documents "create these transactions" when they are posted - for this they use data from the bBusinessDocument_ProductLine table.

To speed up queries this table is not 100% relational.

Depending on the Business Document, a iInventoryTransaction record may "create records" or/and "update" SUM data in the iInventoryPeriodSUM and gCrossInventoryTransaction tables.

When a Business Document is unposted (or canceled) these record(s) are deleted from the Inventory transaction table and everything they have "done" to the iInventoryPeriodSUM and gCrossInventoryTransaction tables is undone.

The gCrossInventoryTransaction table is used in the Workflow functionality of the alpha360 erp and will be covered in the Sales and Purchase areas.

Structure of the iInventoryTransaction table

The iInventoryTransaction table has a structure, quite similar to the bBusinessDocument_ProductLine.

But it has a few special fields, that have information about Sales Quantity, Amount, COGS etc .. that depend on the Business Document that "created/posted" the inventory transaction.

The Inventory Behavior BPs

Every Business Document in the alpha360 is of a specific object type - this is called the nBusinessObjectRole.

This is "inherited by" the Business Document from its related BusinessObject record and it "inherits it to'" every iInventoryTransaction record it creates.

You can find the full list of the Business Object Roles, at the project code area, in the WX implementation.

Now, before any iInventoryTransaction record is created, the SP_BP_Behavior BP is called - this BP controls which special fields are "filled with data" and with what data.

The iInventoryPeriodSUM table

This table has Inventory SUM data, for every Product, Period, Warehouse, SerialNumber and PartNumber and is "updated" automatically when an Inventory Transaction is Created or Deleted. Note here that the alpha360 does not allow any type of editing on an Inventory Transaction.

The alpha360 uses this table to calculate product availability, average cost etc .. instead of "running through" the Inventory Transaction table, although a developer can bypass it and directly query the transactions.

Basic Business Processes for the iInventoryTransaction table

alpha360_add(iInventoryTransaction ,p_sErrorMessage)

This BP adds a record in the iInventoryTransaction table, using the current record buffer, AND updates the iInventoryPeriodSUM table.


alpha360_delete(iInventoryTransaction ,p_sErrorMessage)

This BP deletes the current record from the iInventoryTransaction table, AND updates the iInventoryPeriodSUM table.


BP_Product_SUM_INFO (LOCAL p_sProductPK is string, LOCAL p_sCompanyInventoryPeriodFK is string, LOCAL p_sWarehouseFK is string, p_sErrorMessage is string)

This BP calculates and returns various Product information, in one pass - like available quantity, average cost etc .. for one or all the warehouses and upto an Inventory Period.


Inventory Business Documents

As we said at the begining of this chapter, Inventory Transactions are mainly created by the Sales and the Purchase functionality of the erp.

There are also specific Business Documents, belonging to the Inventory area, that also create inventory transactions - here is the list:

Inventory Census

This Business Document creates entries for the quantities and costs for every product available at our warehouses at the begining of each fiscal year.

Every Fiscal Year, must have these entries - at the begining of each year - since the erp does not calculate this info from previous years.

There is a small exception to this - documented in the alpha360 project - that allows us, for a limited time period, to carry over this info from the previous year.

We went with this approach, mainly because we wanted to be able to handle efficiently, industries, with hundreds of thousands of products ...

On the contrary, this was not needed in the other areas of the erp, so everything there is online and calculated on the fly.

Inventory Plus

This Business Document increments the quantities of products, at a warehouse, at a specific date.

Inventory Minus

This Business Document decrements the quantities of products, at a warehouse, at a specific date.

Inventory Movements

This Business Document moves product quantities from one internal warehouse to another internal warehouse, at a specific date.

It cannot be used to distribute products to customers or return goods to a supplier.

next -> Accounting

Copyright 2017 /18- computerplus