Skip to main content

First In First Out (FIFO)

FIFO is one of the several Cost price methods available to EVA; this document will go into how EVA handles FIFO specifically. If you'd like more general information on the flows of purchase orders, sales orders, invoices and (virtual) shipments between entities, see Unified Orders.

In short: when FIFO is set for an organization unit, any purchase order that is received on that OU will generate a record holding the 'received quantity' and the 'purchase price' for which that quantity was received. After having received multiple purchase orders, we now have a list of records, which are 'varying quantities' with 'varying purchase prices'. Whenever any operation in EVA occurs for which valuation of stock is required, EVA will ideally use the last known purchase price.

Example

Let's start with an example;

We are operating in a store that has received two purchase orders so far. One purchase order contained 5 products with a purchase price of 1. The second purchase order contained 10 products with a purchase price of 2. Let's imagine our cost price record is a table, it will now look like this:

QuantityPurchase price
51
102

Top to bottom is oldest to newest

Now, when we make a sale on this OU, with a quantity of 3, these 3 items will all be sold with a unit cost of 1.

As a result, a quantity of 3 will be subtracted from our oldest known purchase price record;

QuantityPurchase price
21
102

Now, if we were to sell 3 of these items again, it would result in the sale of products with a different purchase price.

In that case, EVA will make a weighted average calculation of the unit costs.

  • Quantity of 2 with unit cost 1
  • Quantity of 1 with unit cost 2

This would then result in the following value: (2×1+1×2) / (2+1) = 1.33333333.

This is a very basic example of sales on organization units that use the FIFO stock valuation method.

Financial events

In essence, we can boil any situation where FIFO would be relevant down to certain financial events. More specifically, financial events related to unit cost for stock.

The relevant financial events are:

  • CostOfGoods
  • StockMutation
  • StockMutationAutomaticCorrection
  • StockReceived
  • StockSold

Operations

We will now sum up some situations and lay out what financial events will be raised and how EVA will calculate the unit price values in these situations.

Sales

During a normal sale, we trigger two events:

  • StockSold
  • CostOfGoods
  • StockMutation

StockSold is triggered when the actual stock movement occurs; when the order is shipped. The amount for this financial event will be taken from the purchase price record we mentioned before, and multiplied by the quantity sold. This is also when the quantity is subtracted from that record.

Then, a CostOfGoods event is raised when the order is invoiced. The amount for this event will be the same as for the corresponding StockSold event, and no stock will be subtracted from the record as the stock movement has already occurred.

Returns

During returns, the exact same events are raised as during a regular sale, but they will be negative:

  • StockSold
  • CostOfGoods

These events are also raised at the same times as during a regular sales order, only the amount calculation for StockSold is a little different.

  • The amount specified in the StockSold event will be determined by the UnitCost on the original order. If there is no original order;
  • the UnitCost of the most recent order for that product will be used. If no recent order is known;
  • the oldest purchase price record will be used.

These prices are also multiplied by the quantity returned.

The amount for CostOfGoods will again be the same as for StockSold.

Note

StockSold and CostOfGoods can be both positive and negative as explained above.

Returning to a different stock label

If for some reason, an employee decides to book the returned products to any stock label other than Sellable, the StockSold event will be followed up by a StockMutation event.

This event will include a 'Reason' which will be filled with the stock label to which the products are booked. You're essentially booking the items to Sellable first, and then moving it to whatever stock label was selected.

Receiving stock

When receiving stock as a result of a purchase order, EVA will raise the StockReceived event. The amount for this event will be determined by the purchase price on the order, multiplied by the quantity of products.

Stock mutation

There are a lot of situations that have some effect on your stock. We might correct stock levels as a result of a cycle count. We might find some major deviations after a full stock count. You might use some product internally, or an employee might have borrowed some items.

Each and every one of these situations raise a StockMutation event. Every StockMutation event contains a reason specifying the cause of the mutation. In the order mentioned above, those would be; 'CycleCountDeviation', 'FullStockCount', 'InternalUse' and 'UserBorrowedProduct'.

All stock mutations are handled the same within the confines of FIFO:

Increasing stock

If stock is added, the amount of the StockMutation event is positive, and determined by the last known purchase price for that product multiplied by the mutation quantity. This will also add the same quantity to the oldest entry in the purchase prices record.

Decreasing stock

If stock is removed, the amount of the StockMutation event is negative, and determined by the last known purchase price for that product multiplied by the mutation quantity. This will also subtract the same quantity from the oldest entry in the purchase prices record.

For any stock mutation where stock is only 'moved' between stock labels the amount is calculated as mentioned above, but we do not add or subtract from the known records.

NASC

When you sell a product, that - according to EVA - is not in stock in your store, EVA allows you to sell the stock by quickly adding a quantity that's equal to the quantity in your cart to your store stock level.

This raises the StockMutationAutomaticCorrection event. The amount for this event is determined by the last known purchase price for the product, multiplied by the quantity of products. This will also add the same quantity to the oldest entry in the purchase prices record.

Afterwards, all regular sales events are raised exactly as mentioned above.

Practical scenarios

Scenario 1: Purchase Order

Let's say we've got the following stock value on the receiving end:

ProductQuantityUnit costDate
Red Gloves515,00 (EUR)01-01-2022
Blue Jeans1090,00 (EUR)01-01-2022
Black Cap1520,00 (EUR)01-01-2022
Green Shoes20120,00 (EUR)01-01-2022
White Socks2510,00 (EUR)01-01-2022

The receiving end is adding stock sold from the supplying end in the following purchase order:

ProductQuantityUnit costDate
Red Gloves520,00 (EUR)01-02-2022
Blue Jeans1095,00 (EUR)01-02-2022

Our financial booking will look like this:

  • Cost Of Goods: Red Gloves 100,00 (EUR)
  • Cost Of Goods: Blue Jeans 950,00 (EUR)

The receiving end would conclude with the following stock value:

ProductQuantityUnit costDate
Red Gloves5 (FIRST)15,00 (EUR)01-01-2022
Blue Jeans10 (FIRST)90,00 (EUR)01-01-2022
Black Cap1520,00 (EUR)01-01-2022
Green Shoes20120,00 (EUR)01-01-2022
White Socks2510,00 (EUR)01-01-2022
Red Gloves5 (LAST)20,00 (EUR)01-02-2022
Blue Jeans10 (LAST)95,00 (EUR)01-02-2022

Scenario 2: Sales order

If we would consider our stock value based on our purchase order scenario, then a sale would look like this:

ProductQuantityUnit cost
Red Gloves616,00 (EUR) (AVERAGE)
Blue Jeans1090,00 (EUR)

Our financial booking will look like this:

  • Stock Sold: Red Gloves 95,00 (EUR)
  • Stock Sold: Blue Jeans 900,00 (EUR)

If we would make another sale, it would look like this:

ProductQuantityUnit cost
Red Gloves420,00 (EUR)
Blue Jeans995,00 (EUR)

Our financial bookings will look like this:

  • Stock Sold: Red Gloves 80,00 (EUR)
  • Stock Sold: Blue Jeans 855,00 (EUR)

If we make another sale, it'd look like this:

ProductQuantityUnit cost
Red Gloves120,00 (EUR)
Blue Jeans195,00 (EUR)

We're selling the Red Gloves even when there is no stock value anymore; the unit cost is now determined by the product's most recent sale. This is initiated by a NASC (also known as Negative Automatic Stock Correction).

Our financial bookings will look like this:

  • Stock Sold: Red Gloves 20,00 (EUR)
  • Stock Sold: Blue Jeans 95,00 (EUR)

Scenario 3: Referenced return

When a product is returned from an order that originated in EVA (or the relevant order information was shared with EVA), the original unit cost is applied and the product is added back to stock.

Scenario 4: Unreferenced return

When a product is returned without EVA knowing the original order, the unit cost is based on the last stock value of the product. If there is no stock, then the unit cost is determined by the product's most recent sale.

If there is neither, then there's no FIFO cost price reference, making the price fall back to 0.

Scenario 5: Expected & Unexpected

  • If we've found more stock than expected, then the unit cost is determined by its most recent stock value. If there is no stock, then the unit cost is determined by the unit cost of the product's most recent sale.
  • If we've found less stock than expected, then stock value is reduced based on first to last stock value. If there is no stock, then the unit cost is determined by the unit cost of the product's most recent sale.

If there is no stock nor a sale, then there's no FIFO cost price reference, making the price fall back to 0.

Note: Expected & Unexpected stock is initiated for example due to a scheduled stock count.

Scenario 6: Damaged

  • If damaged stock is returned with EVA knowing the original order, then the original unit cost is applied and it's added back to stock - but flagged as damaged.
  • If damaged stock is returned without knowing the original order, then the unit cost is determined by its last stock value. If there is no stock, then the unit cost is determined by the unit cost of the product's most recent sale and its added back to stock - but flagged as damaged.
  • The latter goes as well for damaged stock found during a Full stock count for example.

Note: Stock labelled as damaged is ignored during cost price determination in all possible scenarios.

Scenario 7: Multi-Currency

If there is a currency mismatch between the supplying end and the receiving end, then a currency conversion is applied based on the current exchange rate.

If the euro is equal to 9,99 NOK, then our stock value will result in the following:

Supplier (EUR)

ProductQuantityUnit cost
Red Gloves515,00 (EUR)

Receiver (NOK)

ProductQuantityUnit cost
Red Gloves5149,84 (NOK)

If there is an agreement between the two parties, with the unit cost already determined in the currency of the receiving end, then no conversion is applied.

Scenario 8: Movement

If we would move stock value from one organization to another, our stock value would look like this:

Supplying end

ProductQuantityUnit costDate
Black Cap5(-5)20,00 (EUR)01-02-2022
Black Cap5(-1)25,00 (EUR)01-03-2022

If we move Black Cap with the quantity of 6 on the first of April to the receiving end, then their stock value would look like this:

Receiving end

ProductQuantityUnit costDate
Black Cap520,00 (EUR)01-04-2022
Black Cap125,00 (EUR)01-04-2022

Scenario 9: Disputes

If received stock ended up having a different cost price which can be initiated by an invoice dispute, then some corrections are applied.

If we would have a purchase order with the product Green Shoes with a quantity of 5 but already sold 1.

Stock value

ProductQuantityUnit cost
Green Shoes4120,00 (EUR)

Stock sold

ProductQuantityUnit cost
Green Shoes1120,00 (EUR)

Our financial bookings would look like this:

  • Cost Of Goods: Green Shoes 600,00 (EUR)
  • Stock Sold: Green Shoes 120,00 (EUR)

If however a dispute would tell us that the actual unit cost was 125,00 (EUR), then our situation would turn into the following:

Stock value

ProductQuantityUnit cost
Green Shoes4125,00 (EUR)

Stock sold

ProductQuantityUnit cost
Green Shoes1125,00 (EUR)

Our financial bookings would look like this:

  • Cost Of Goods: Green Shoes 20,00 (EURO) (CORRECTION AMOUNT)
  • Stock Sold: Green Shoes 5,00 (EUR) (CORRECTION AMOUNT)

Scenario 10: Corrections

If there is any other reason for why a stock value would be incorrect - other than an invoice dispute - then you can initiate a manual stock correction by using EVA's manual stock correction functionality to correct your stock value and stock sold.

Stock value:

ProductQuantityUnit cost
White Socks910,00 (EUR)

Stock sold:

ProductQuantityUnit cost
White Socks110,00 (EUR)

Our financial bookings would look as follows:

  • Cost Of Goods: Green Shoes 100,00 (EUR)
  • Stock Sold: Green Shoes 10,00 (EUR)

If you'd correct your unit cost from 10.00 EURO to 15.00 EURO, then it would change into the following:

Stock value

ProductQuantityUnit cost
White Socks915,00 (EUR)

Stock sold

ProductQuantityUnit cost
White Socks115,00 (EUR)

Our financial bookings would look like this:

  • Cost Of Goods: White socks 45,00 (EURO) (CORRECTION AMOUNT)
  • Stock Sold: White socks 5,00 (EUR) (CORRECTION AMOUNT)

Scenario 11: Cost Price Calculations

When a product has a variable unit cost, then our cost price calculations come in handy.

Let’s say you’ve configured the following cost price calculations:

ProductFactor
Fresh baitfish0.50
Fresh fish0.75

If you sell Fresh bait fish for 100,00 EUR, then your cost price is calculated by the configured factor.

  • 100,00 EUR * 0.5 = 50,00 EUR (Cost)

If you sell Fresh Fish for 500,00 EUR, then your cost price is calculated by the configured factor.

  • 500,00 EUR * 0.75 = 375,00 EUR (Cost)