updating upsert method for sales_records.js