From the KB: AverageCostrepresentstheaveragecostofthestockcurrentlyonhandforanitem.Itiscalculatedandstoredforallitems(notjustthosedefinedwithanAverage Costvaluation). Negativeaveragecostsarenotnormal,butcanexistundercertaincombinationsoftransactions.ItismorelikelytohappenforLIFOorFIFOitemswhen thequantityonhandhasgonenegativeduetosalesbeingprocessedpriortoreceipts. Theaveragecosts(bothoverallandwarehouse)areupdatedeverytimeatransactionisupdatedtoinventory.Itiscalculatedasthenewvalueonhand dividedbythenewquantityonhand.Ifthenewquantityonhandiszero,theaveragecostremainsunchangedsincethereisnoquantitytouseinan averagecostcalculation.
Not sure the hierarchy is used for every situation, as I found FIFO tends to use average when going negative, even though item costing file has cost. Maybe it varies by version, but that's been my experience with 2014.