fix view purchases

and actually save inventory line items