Bug 11665 introduces CountPendingOrdersByBiblionumber, this should be moved to a .pm and be unit tested. As it counts items on order, maybe it should also reflect that in the name a bit better.
It's only used once, maybe we could do better now anyway?