We built a Multi-Branch Software that work offline and online.
We will install the application in each location with database offline.
Each location will work offline, any time any location have internet, the system will sync with the online version. ie. the script will update new change in the offline database online AND also check the online database and update the offline database.
E.g.
The head office can transfer an item to a store in another location. the script need to update the online database first which will update the local database of the location when the connected online to receive the transfer.