Moves purchase to before lineitem as reported to cause error in some cases.