In SMRT Systems, we track the origin of every order.
The ability to group orders by origin has many advantages. The most significant being that you get a clear distinction in sales number.
In the POS we refer to the origin as an "Agent" - the entity that produced the order.
An agent can be any of the following: Store, Route or a Group.
Orders, Customers, Payments, and Credits are all assigned an agent.
The following explains how we assign agents.
When an order is created through the delivery app, it automatically assigns the current route as the agent for the new order.
An order created through the POS is a little more complicated.
We have developed the following algorithm to determine the agent for these new orders. The are prioritized in the order they are listed.
1. If the customer is in a group that is a separate agent - use the group agent.
2. If the customer has a future delivery or is on a route; show the Route vs Store return location selection.
- If the return location is set to a route - use the selected route agent.
- If the return location is set to a store - use the selected store agent.
3. If a customer not on a route had a delivery that was not deleted the last 3 days - use the agent of the most recent delivery.
4. Group all unpaid orders for the customer by agent - use the agent with the most orders.
5. Use the agent of the current store.
The agent of an order can be changed in the order menu as long as the order is not in A/R.
All Customers are also assigned an agent, however the agent of a customer can be highly variable. If they decide to use different stores or even routes, their agent will change.
Every time a new order is created, it will update the customer's assigned agent to the agent derived by the order agent algorithm.
Note that this does not mean the agent are sure to change even if the customer has a one-off where they went to a new store on a single instance. This is because the Order Agent algorithm is tailored to return the "current store" only as a last resort.
While a customer's agent is important for reporting purposes, it's not as serious as an order's agent. It does not define how sales are accounted for but rather reflects the customer's most recent method for using your services.
Payments along with every bookkeeping transaction are assigned an agent. This is because every agent has its own ledger.
In turn this means that every financial action needs to keep agents separate.
For example, an order from one agent must be paid with a payment assigned the same agent.
You can not pay orders of different agents with one single payment.
Credits follow the same rules as payments, with a single difference. For practical advantages we have developed a system that automatically transfer credits between the accounting ledgers whenever necessary in order to make the payment process easier.