fixed upsert in sales_records