server code for updating sales rather than creating new ones for updates