Gross Profit and Cost Column Definitions
From EnablerWiki
Created: 14 April 2009. Last Reviewed: 22 April 2009
Table StockMovementTbl Cost and Gross Profit Columns
The stock movement table contains a row for every movement of stock, including a row associated with every sale or return line item. Except in complex cases such as multi-packs and kits, there is a 1 : 1 relationship between rows in SaleLine and StockMoveTbl. However, not all stock movement rows have associated SaleLine rows – consider stock receipts, transfers etc.
Note columns prefixed with FC are in the currency local to the branch (for EEE instances supporting branches in different countries). The Non-FC version of the column has the amount in the local currency of EEE as converted using user-defined exchange rates.
The population of cost and gross profit columns in table StockMovementTbl for stock movements associated with sales is:
Cost
FCCost * ExchangeRate
TotalCost
This is an SQL Server computed column: isnull (ActualTotalCost, Cost*Quantity)
FCCost
SQL Server stored procedure UpdateStock looks up the configuration for the branch to determine that branch's stock valuation configuration option – i.e. WAC or list cost. Based on this configuration, the current cost for the Branch/SKU is retrieved. If this is null or $0.00, uses BuyPrice1 for the branch/SKU.
Finally, any oncost amount passed back from POS is added to this cost, however for sales POS will always return oncost of $0.00.
FCTotalCost
This is an SQL Server computed column: isnull (FCActualTotalCost, FCCost*Quantity)
OnCost
This is populated with the unit on-cost amount passed back from POS, always $0.00 for sales.
ActualTotalCost
FCActualTotalCost * ExchangeRate
FCActualTotalCost
FCCost * Qty.
AlternateGPCost
Cost.AlternateGPCost except client code 22 which uses BuyPrice1 for warehouse branch
View vwSaleLine_GP Cost and Gross Profit Columns
This view combines sales data from table SaleLine with stock cost data from table StockMovement to provide the most accurate possible GP reporting. In the column descriptions below, “if available” means if a matching stock movement row is found for the SaleLine. In some cases the StockMovement row might be missing, for example in the minimally supported scenario where sales are recognised upon creation of a customer order or layby, but stock is not decremented until the order or layby is completed. In such case there is no StockMovement row to match the Sale, therefore no strictly accurate cost or GP is available.
ExtendedCostAmount
If available, StockMovementTbl.TotalCost else SaleLine.ExtendedCostAmount.
GrossProfit
If available, SaleLine.ExtendedNetAmount – SaleLine.ExtendedTaxAmount – StockMovementTbl.TotalCost else SaleLine.GrossProfit.
FCExtendedCostAmount
If available, StockMovementTbl.FCTotalCost else SaleLine.FCExtendedCostAmount
FCGrossProfit
If available, SaleLine.FCExtendedNetAmount – SaleLine.FCExtendedTaxAmount – StockMovementTbl.FCTotalCost else SaleLine.FCGrossProfit.
ExtendedAlternateGPCostAmount
StockMovementTbl.AlternateGPCost * SaleLine.Quantity. However if this is NULL, as will be the case when Cost.AlternateGPCost is null, then SaleLine.ExtendedCostAmount except for client code 22 which uses Cost.BuyPrice1 for branch 99 * SaleLine.Quantity.
GrossProfitAlternateGP
SaleLine.FCExtendedNetAmount – SaleLine.FCExtendedTaxAmount – ExtendedAlternateGPCost.