The management of stocks in Sage X3 is structured around a group of tables:
The stock itself. This stock is identified in the database by the records in the STOCK table. Each of these records corresponds to a line of stock. The management rules for these lines are detailed in a technical annex. A group of stock lines characterized by various attributes (lot, status, location...) correspond to a given product, in a given warehouse. Each line of stock carries a global quantity (the value, which serves as the basis of the calculation for the financial value of the stock is stored in other tables).
The stock movement journal. Identified as entries in the STOJOU and STOJOUVAL tables in the database, it is used to recover in a chronological fashion, the movements carried out, whether in quantity (receipt, issue or internal movement) or for value only (depreciations, miscellaneous adjustments : it should be noted that the quantity field is entered even if the movement does not change the quantity in stock, because in the case of valued movements, it is important to know on which quantity the value change has an impact). Each record in this journal carries the characteristics of the stock line moved without formally pointing to it and it also identifies the original movement that justifies it (document and document line at the origin of the movement: packing slip, material tracking, receipt note...). Each movement carries two values: the movement value, determined from the set up rules, which impacts on the global value of the stock carried by the lines and the value arising from the original document. If the valuation method includes two methods then these values are displayed for both methods.
The lots table. Identified in the database by the records in the STOLOT table, it associated with a lot and a given product, the default characteristics (for all warehouses) and contains a total for the quantities and an indicative value (expressed in reporting currency).
A table of the product/warehouse totals, called ITMMVT, which contains a total for the quantities by status (A,Q,R), by status (internal, dock, loaned, allocated, in subcontract...) as well as the totals (base, quantity) that are used to carry out the calculation of the moving average price. It also carries the values such as the last purchase price, the last receipt price, the date of the last receipt and the last document. The information contained is redundant: it can be reconstructed, for a given product at a given warehouse, by taking the last stock count values and by using the stock journal.
A table containing the product/warehouse total per month, called ITMMVTHIS, which contains the totals by period and by fiscal year. This table is updated based on the allocation date of each movement.
A table containing the elements necessary for the management of the FIFO or LIFO stack, called STOCOST, containing, for each product and warehouse, a group of lines characterized by a quantity and a global value. It should be noted that this table is used in the FIFO or LIFO valuation, but it has no links with the physical locations or specific lots.
A table identifying allocated stock, named STOALL, which is used to justify the allocated quantities and the shortages for each product and warehouse.
The rest of this document details the way in which the movements are registered in the database, focusing mainly on the fashion in which the valuation bases used for the moving average price and the FIFO/LIFO are updated. The calculations that are carried out depend on the valuation method used. This method is defined by a group of rules attached to an identifying code. This code is associated with the product-site, the valued being initialized from the product category.
A stock movement is justified by a given line in a source document (that can be for example, production reporting, delivery advice note, receipt note, physical stock count note...). Its entry will create at least one line in the stock journal (there can be several if the line in question involves the movement of several lots or several units or serial numbers....).
This source document in principle carries a quantity and a value (sometimes only one of the two). The following two values are found in the stock journal: the value carried by the source document and the movement value, determined according to the rules that have been set up (amongst which figures the possibility to pick up the value from the source document).
In financial terms, the stock valuation method used can be Standard price, Revised standard, Moving average price, FIFO or LIFO. According to the country and conditions, certain methods can be or not be allowed, these choices must therefore be confirmed by an accounting expert. This valuation rule can vary as a function of the product and even the product-site pair. This can be admissible in exceptional cases (for example different companies), but as a general rule, the most financially appropriate rules will be chosen.
By default, once this financial valuation rule has been chosen, the variation in the value of the stock as a result of a movement follows the simple rule shown below (that exists in the same way for the quantities) :
final value = initial value+ movement value
The movement value is of course supposed to be signed, that is negative for an issue and positive for a receipt. When this rule is followed and the movement values are stored in the journal, there will always be available a true image of the financial value of the stocks in accounting if the stock movements are posted from the stock journal. It should also be noted that this posting can be carried out each time a movement is made or in a more global fashion (end of day, period or on request).
The rule for the calculation of this value is simple to apply in the case of an issue and is applied without exception: the stock valuation method is used to associate a value with the issue quantity and decreases the residual stock value by the same amount. This value is obtained either from the moving average price for the site (the global value of stock is decreased pro rata with the issue quantity), or by decreasing in steps the site price stack according to the order used (FIFO or LIFO), or by using the Standard price or the Revised standard price associated with the site. In order to manage the exceptional cases where a zero price arises from this calculation a Receipt value is planned.
On receipt, the basic principle consists in increasing the stock quantity and value (are updated the FIFO/LIFO stack and the quantity and value of the product-site used in the calculation of the Average Cost from the order amount). The receipt value of the movement is determined as a function of a rule (defined by product-site) that can be Standard cost, Revised standard cost (the receipt values are thus fixed during a given period), or Order price (in this case the value coming from the source document). Here also, a receipt value is planned if the value obtained is blank. But the specific rules for the calculation of the stock value straight after a receipt are a little more complex and for two reasons :
firstly because the movement value cannot be perfectly identified at the time when the movement is recorded. The movement will nevertheless be passed with an estimated value, but it is possible once the actual value of the movement is known to carryout an adjustment at a later date (described later in this document). These adjustments are converted into additional lines in the stock journal. These lines will also be posted if the accounting stock interface is used.
then, because it can happen for certain exceptional movements, that a valuation rule is required that is not used by default for the issues. It is possible to set up this thanks to the exceptions table (this rule will then be associated with an issue type, even a sub-type, identified by a code carried by the stock transaction). This exceptional receipt type can have impact on the accounting, in particular if the original movement has a different value to the receipt value retained. Since these two values are stored in the stock journal, it is possible to set up their use in accounting.
The STOJOUVAL table contains all the valuation information of stock movement. It is used, among others, to stock cost breakdown. This is a detail of the various fields that are available:
The value totals existing in the tables are of two types: on one hand the FIFO/LIFO stack, on the other hand the total in value from the ITMMVT table, which is used to calculate the moving average price. In both cases, the totals are up to date site by site. The global valuation for a company is obtained by a total of the values in the different sites and the global Moving Average Price for a company by moving average for the different moving average prices at each site.
On each site, the basis of the moving average price calculation is updated in a very simple fashion :
on receipt, the receipt value is added to the value of the current stock value (it is the same for the quantities)
on issue, the quantities are decreased and the stock value is updated pro rata with the issue quantity.
The update of the FIFO/LIFO stack is made for each site in the following fashion :
on receipt, a entry in the stack is created for each receipt movement, with the accumulated quantities and corresponding prices.
on issue, the last or first entry in the stack is decreased according to the context.
It is important to note that this management of the stock value is made in a fashion that is disconnected from the physical management. In other words, even if a product is perfectly identified (by its serial number for example) and is not the first receipt when working with FIFO, the issue value is never taken from the original value, but by following the issue valuation rule.
However, in the case of a receipt for the return of goods, the fact of reversing the original movement is used, according to the setup, to pick up the original moving average price ; if the setup of the receipt values is linked to the order price, it will be perfectly coherent. In the same way, a transfer from one site to another creates two identical movements (one an issue and the other a receipt). If the receipts are made based on Order price, then the transfer will be made with a price that is identical on both sides.
Certain movements can be canceled after having been passed. This type of case is processed as follows :
the deletion of a receipt is only possible if the stock whose characteristics correspond to the receipt is still available. From the point of view of the valuation, the deletion is processed as a negative receipt, that is to say the movement is carried out in the wrong direction. In addition, the entries in the stock journal corresponding to the original movement and its cancellation are marked (a flag named REGFLG is set to 2).
the deletion of an issue is only possible if there is still space available in the location from where the products were issued. From the point of view of the FIFO stack, it is not necessarily possible to re-establish the exact situation, because the empty stack entries are deleted as when they appear. In the worst case, a FIFO stack entry is recreated taking the value of the issue (that can in addition be a moving average of two stages of the entry having been purged between times).
The modification of a movement (whether this is a quantity or value change) is processed by the cancellation and deletion, taking into account the controls previously defined.
The adjustment of a movement corresponds to the case where a movement, entered as a given value at a given moment, has its value changed by the entry of another document (and not by the modification of the source document).
Below are several concrete examples:
a supplier receipt has been entered at a given price, the invoice arrives with a different price.
the supplier invoice is entered, a supplemental invoice (customs charges, carrier charges) to be distributed over the products booked to stock is received (this can occur more than once for the same products).
A production reporting entry that has created receipts at a price calculated based on technical data; a production cost calculation establishes the final receipt price, which is different.
In the particular case of over-invoicing (the invoiced quantity is higher than the received quantity), it is considered that other receipts are still expected and that they will absorb the additional amount linked to the additional invoiced quantity. In that case, only the price difference by quantity and the invoicing elements are integrated in the first receipt.
Example:
In all the cases, these adjustments are made by creating additional entries in the stock journals. It should be noted that it is possible to prevent price adjustments for certain products( Adjustment (yes/no) flag is defined in the valuation methods setup). If this adjustment is made, it is carried out as follows:
For instance:
Adjusting receipt movements: when breaking down the average cost by cost group, the potential negative values in the calculation are distributed over other cost groups as follows:
When such an adjustment is performed, the data recorded in the next fields of the STOJOUVAL table are irrelevant. This data is related to the second valuation method, for which no average cost breakdown is required:
· DV2*: Delta amount of second valuation method
· DEV*2: Non absorbed amount of the valuation second method
Stock adjustment in case of purchase credit memo on invoices: credit memos in value and in quantity.
Credit memo in value | Credit memo in quantity |
Credit memo quantity equal to the invoice and different price | Credit memo quantity equal to the invoice and same price |
Quantity different from the invoice (price equal or different) |
| Units | Unit price | Amount | Stock value |
Administrative | 10 | 10 | 100: | 100: |
Invoice | 10 | 9 | 90 | 90 |
Credit memo | 0 | 6 | 6 | 84 |
| Units | Unit price | Amount | Stock value |
Administrative | 10 | 10 | 100: | 100: |
Invoice | 10 | 9 | 90 | 90 |
Credit memo | 10 | 1 | 10 | 80 |
| Units | Unit price | Amount | Stock value |
Administrative | 10 | 10 | 100: | 100: |
Invoice | 10 | 9 | 90 | 90 |
Credit memo | 1 | 12 | 12 | 88 (1) |
| Units | Unit price | Amount | Stock value |
Administrative | 10 | 10 | 100: | 100: |
Invoice | 10 | 9 | 90 | 90 |
Credit memo | 1 | 6 | 6 | 94 (2) |
| Units | Unit price | Amount | Stock value |
Administrative | 10 | 10 | 100: | 100: |
Invoice | 10 | 9 | 90 | 90 |
Credit memo | 1 | 9 | 9 | 91 (3) |
A positive physical stock count variance is processed like a receipt, with a negative physical stock count variance being processed like an issue. In addition to the update of the quantities in the stock and their adjustment in the stock line detail and lot totals, this variance has an impact on the valuation basis. The valuation methods setup is used to define the positive and negative physical stock count variance values in a different way to a normal receipt or issue. It should be noted that the validation of a physical stock count both creates an entry in the movement variances in the stock journal plus entries giving the detail to each stock line.