How LIFO/FIFO Stacks Function When Using Item/Warehouse Costing

If you choose to track costs at the item/warehouse level, existing LIFO/FIFO stacks will be divided out proportionally based on Item Warehouse quantities. Each existing stack will be replaced by a new stack for each Item Warehouse which has quantities on hand. This topic provides examples.

In these examples, rows in a stack will be identified by a quantity and cost. In reality, each row also contains a date and cost breakout and account numbers (Material, Labor, Fixed Overhead, Variable Overhead, and Outside). Account is included in the first example for clarity, but removed from subsequent examples.

Example

Warehouse MAIN contains 80 on-hand and warehouse DIST contains 20 on hand. This example uses one stack for the item, with five separate entries.

Quantity Acct Cost
20 1200 $5.00
20 1200 $7.00
20 1200 $4.50
20 1300 $6.50
20 1200 $7.00

After processing, there are now two stacks.

Stack #1: DIST

Quantity Acct Cost
4 1200 $5.00
4 1200 $7.00
4 1200 $4.50
4 1300 $6.50
4 1200 $7.00

Stack #2: MAIN

Quantity Acct Cost
16 1200 $5.00
16 1200 $7.00
16 1200 $4.50
16 1300 $6.50
16 1200 $7.00

Since DIST had 20% of the inventory, the stack for DIST received 20% of each row. MAIN received the remainder which matches up to the 80% of the net on hand it contains. The total for the item still contains the same number of entries for each cost. Thus, there is no impact to the cost of inventory and no journal entries are required.

Note:  This raises an issue: What if customers are using an Account number to distinguish different warehouses? In the above example, if account 1200 is used for MAIN and account 1300 is used for DIST, the stacks may not appear as expected afterward; however everything will balance by account in the end.

Rounding Quantities

The program will process all warehouses except the default warehouse, saving that for last. During the processing of each warehouse, quantities will be rounded, resulting in whole quantities in each. Any remainders are placed into the default warehouse. See "Dealing With Fractional Quantities" for information about fractional quantities.

FIFO Item Rounding Example:

Warehouse Qty on Hand
MAIN 70
DIST 30

Initial Stack

Quantity Cost
25 $5.00
25 $7.00
25 $4.50
25 $6.50

Rounding to whole numbers will result in the following distribution:

One stack for DIST

Quantity Cost
8 $5.00
8 $7.00
8 $4.50
6 $6.50

Another stack from MAIN

Quantity Cost
17 $5.00
17 $7.00
17 $4.50
19 $6.50

DIST gets 30% of each stack row since it contains 30% of the overall inventory. 30% of 25 is 7.5 which is rounded up to 8.  The remainder (17) goes into main. In this example DIST hits its limit of 30 so the last row will only contain 6. This is due to rounding of the other rows. Remainders are placed in MAIN and everything is balanced.

FIFO is processed top to bottom and LIFO is processed bottom to top. In the above example, the 6 for DIST and 19 for MAIN would be first in the list and thus the first row consumed during an inventory issue.

Maintaining Balances Across All Warehouses

As the above example illustrated, keeping track of the allocated quantity in a warehouse is important. This may dictate a second pass through the stack to re-allocate any leftover quantities.

Example across all warehouses:

Warehouse Qty on Hand
MAIN 70
DIST 25
DIS1 5

After processing:

Original StackQty Stack Cost DIS1 Qty DIST Qty MAIN Qty
7 $5.00 0 2 5
1 $7.00 0 0 1
10 $5.50 1 3 6
72 $6.00 4 18 50
3 $5.00 0 1 2
2 $7.50 0 1 1
5 $7.00 0 0 5

The last row would typically get a quantity of 1 for the DIST warehouse, but that would exceed the total for DIST, so the remainder, 5 goes into MAIN.

Note:  when a stack row results in a zero quantity, a record will not be created. There is no purpose to having a stack row with a quantity of zero.

Now consider a slightly different overall on hand:

Warehouse Qty on Hand
MAIN 69
DIST 25
DIS1 6

Allocation of that last stack row is slightly different:

After processing:

Original Stack Qty Stack Cost DIS1 Qty DIST Qty MAIN Qty
7 $5.00 0 2 5
1 $7.00 0 0 1
10 $5.50 1 3 6
72 $6.00 4 18 50
3 $5.00 0 1 2
2 $7.50 0 1 1
5 $7.00 1 0 4

DIST can not take a quantity of 1, and this time, MAIN can only take 4. In this scenario, the system will take a second pass through and find the first warehouse where on-hand has not been exceeded, adding as much as is available until everything is allocated or until that warehouse exceeds it's quantity on-hand. The process will continue until all remaining quantities from the original stack have been allocated.

Fractional Quantities

Some items are not stocked in whole amounts. Thus, a quantity of 3.35 could be valid. As discussed above in the rounding section, whole quantities are placed in the warehouses during processing. Then remainders are placed in the default warehouse.

Example:

Warehouse Qty on Hand
MAIN 70
DIST 30.5

Initial Stack

Quantity Cost
25 $5.00
25.5 $7.00
25 $4.50
25 $6.50

Results of rounding to the whole number:

Warehouse Qty Cost
MAIN 17 $5.00
17.5 $7.00
17 $4.50
18.5 $6.50
DIST 8 $5.00
8 $7.00
8 $4.50
6.5 $6.50

Initially, only whole numbers go into DIST and remainders are placed into MAIN. When processing the last value for $6.50, at first, only 6 are placed in DIST leaving 19 remaining. However, there's only room for 18.5 in MAIN, so an extra 0.5 is left over.

Thus, as discussed above in the section on multiple accounts, a second pass occurs on the stack and the remaining 0.5 goes into DIST. Thus, everything adds up correctly.

Negative Quantities

It is possible that we have to deal with negative quantities. If everything on hand is negative, the above examples will cover the situation (only the signs will be reversed). However, a couple of examples with a mixed scenario should be explained. A mix scenario will be defined as one with some warehouses negative and some positive.

Example of negative quantities

Note:  This process rounds negative numbers so that -7.5 becomes -8.

Item Stack

Qty Stack Cost
7 $5.00
10 $5.50
3 $5.00

Item Warehouse Amounts

Warehouse Qty on Hand
MAIN 3
DIST 24
DIS1 -7

Since the overall quantity for the item is positive, there will be no negative entries in the stack. The warehouse percent allocations are based on a net quantity on hand for the item of 20. The stack will break out into the following three stacks again based on a percentage:

Warehouse Qty on Hand Cost
MAIN 1 $5.00
2 $5.50
0 $5.00
DIST 8 $5.00
12 $5.50
4 $5.00
DIS1 -2 %5.00
-4 $5.50
-1 $5.00

All remainders go into MAIN, which in the case is negative. For example, consider the middle entry for $5.50. Originally this row contained 10. Two were allocated to DIS1, leaving 8. 12 were allocated to DIST, leaving -4. That remaining result goes into MAIN.

Note: Even in a mixed scenario, each stack must contain either all positive or all negative values. CloudSuite Industrial would never create a single stack with both positive and negative values.
Related topics