Fixed calculation in purchase and name edit in purchase