Orders are downloaded from the web server in CSV format. The file in unnormalised form: the orders and orderDetails tables are joined together, and the product name is also included. This is a fairly standard format for downloading data from a web server. Orders for more than one item are split over several lines, with line for each item. Only fresh orders are downloaded.
In order to avoid downloading the samer record more than once, change flags is used. Every record has a flag that indicates whether it has been downloaded (or processed in some other way). The flag is set when the record is uploaded from a mobile device and reset when the Clear change flags option is selected. The standard procedure is:
- download orders
- process CSV file
- reset change flags
The system allows users to upload an order more than once. This usually happens when the first attempt fails for some reason, or when the data has not been uploaded correctly. The hosting service also allows orders to be uploaded more than once, and updated records are output in the CSV file together with fresh ones. This means that the same order can be downloaded more than once.
Duplicate Order Ids
The mobile app allocates order numbers in sequence, and in a multi-user environment each user is allocated a separate reange of order ids. In principle this should ensure that order ids are always unique. However it is always possible that two users will use the same order id by mistake.
The hosting service can handle this, and both orders will be output to the CSV file. But the system that you are importing the CSV files to probably expects unique order ids. To help resolve this, the Find duplicates option lists all orders with duplicate ids. Hopefully there will not be any.