posting sales/purchase payments to journal (plpgsql function)