# Profit / Cost Calculation

The *Cost Calculation Method* determines how profit is calculated after you complete a sale. In Shopfront, there are three ways to do this - Last Cost, Average Cost, and Mixed Mode.

# How to Change Profit Calculation Method

You can easily modify which method your Shopfront store is using. This will be set for all outlets and registers within your store.

- Navigate to
*Menu**> Setup >**General* - Change the tab to
*Company* - Change the
*Cost Calculation Method*to the method you wish to use - Press
*Save Settings*

# Last Cost

*Last Cost* overrides your cost with the last purchase cost that was received on your latest invoice for that product.

### Benefits

- Easy to understand
- Simple to work out how Cost is calculated

### Drawbacks

- If your cost changes, old stock is now at the wrong profit (some stock might have cost more than other stock)

# Average Cost

*Average Cost* is the most accurate method of keeping track of profit, however, if your stock falls into a negative amount the system has to compensate the amount of profit you should be receiving which may result in a negative cost or a cost several hundred dollars out (depending upon how inaccurate your inventory is).

### Benefits

- Highly accurate

### Drawbacks

- Complex to calculate
- Can create giant or negative costs

### How Average cost is calculated

- Get the current stock on hand (current_stock)
- Get the current cost (current_cost)
- Get the newly received stock (new_stock)
- Get the new cost (new_cost)
- Enter the numbers into the following formula:
- (current_stock * current_cost + new_stock * new_cost) / (current_stock + new_stock)

*Note; There are several edge cases with this formula that are handled outside this formula.*

# Mixed Mode

*Mixed Mode* is our new cost calculation method which uses Average Cost while your inventory is a positive amount and then goes back to using Last Cost when your inventory hits a negative amount.

### Benefits

- Profit is accurate while stock remains positive
- No huge or negative costs

### Drawbacks

- Profit is inaccurate when the stock goes into negative