Fixed main temporal allocation SQL function to handle inventories without point source characteristics