Receipt view upgraded, database logic fixes