📍 Field visits and orders
Updated
Plan an agent's day, collect orders from the field app, and read GPS evidence without turning a visit into an accounting document.
User steps: run a field visit and write an order. Developer notes: visit and order links, map control. Mobile contour: mobile client.
How the process works#
The field path is:
- The office plans the day on Ribbon → Sales → Field → Sales dispatcher (
SalesDesk). Route seeds stops from aDeliveryRoutetemplate, nearest-neighbour orders outlets that have coordinates, and Save route writes aVisitRoute. Suggestions lists receivable or stale customers to add as stops. Tasks assignsAgentTaskrows that are not stops. - Separate work (a call, a collect reminder, other) is an
AgentTask, not a stop. Completing Collect does not writeCustomerPayment. - A phone signed in as that sales person pulls Today, open
AgentTaskrows, customers, contracts, catalogue, cached prices, receivables and stock hints. - The agent checks in at a stop. The phone queues an
AgentVisitin Open. Tasks sit in a Tasks block above the stops. - The agent writes a
SalesOrderfrom the visit workspace. The order stores the visit id in its hidden Visit field, so the visit card can show the order as a linked document. - The manager sees submitted orders and runs approval or rejection. The same office buttons exist in the desktop contour. The manager phone also lists team
AgentTaskrows, creates them (CreateAgentTask), and edits Draft / OpenVisitRoutestops (UpdateVisitRoute). - GPS breadcrumbs are written to
AgentGpsLogwhile the shift is running. Sales agents desk (/field-dispatch, ribbon Sales agents desk (Пульт торговых агентов)) remains the office watch screen: map, KPI strip, and today's routes and visits.
The visit is evidence and context. Money stays on the order and the sales realization; a visit print form lists order numbers and states, not amounts.
Settings#
Sales person and login#
Where: Ribbon → Sales → Dictionaries → Sales agents. Object: SalesPerson.
| Field | Values | Default | Behaviour |
|---|---|---|---|
| Name | Text | Required | The name shown on routes, dispatch and team lists. |
| Login user | User id | Empty | Connects a mobile login to this sales person. Empty means the phone still signs in, but Today says the login is not a field agent and no route is pulled for visits. |
Visit route#
Where: Ribbon → Sales → Field → Visit routes. Object: VisitRoute.
| Field | Values | Default | Behaviour |
|---|---|---|---|
| Agent | Sales person | Required | The day belongs to this agent. Sales agents desk and Manager views group visits through this field. |
| Route date | Date | Required | The phone Today page pulls the route for that day. Manager can look at today and up to seven days back. |
| Template route | Delivery route | Empty | Optional source for planned stops. Empty means the stops are entered on the route itself. |
| Stops table | Customer, optional outlet, order, window from / to, stop status | Empty | Each open stop appears on the phone with Check in and Skip. |
The route states are Draft, Open and Closed. The desktop Check in command opens a route day from Draft to Open; the phone's stop-level check-in writes AgentVisit records. Sales dispatcher writes Draft or Open for that agent and day.
Stale visit suggestion#
Where: constants of the Field group. Object: StaleVisitDays.
| Field | Values | Default | Behaviour |
|---|---|---|---|
| Days without a visit before a stop is suggested | Integer days | 14 | Load suggestions on Sales dispatcher includes a customer of this agent whose last AgentVisit is older than this many days, or who has none. Receivable suggestions use the live Receivable balance, not a second price engine. |
Agent task#
Where: Ribbon → Sales → Field → Agent tasks, or Sales dispatcher Create task. Object: AgentTask.
| Field | Values | Default | Behaviour |
|---|---|---|---|
| Kind | Call / Collect / Other |
Call on create |
A collect task is a reminder. Payment is still CustomerPayment. |
| Due date | Date | Today on the desk | The agent pull keeps Open rows and recently due ones. |
States: Open → Complete → Done, or Cancel → Cancelled. No register movement.
Sales order controls used by the field app#
Where: Ribbon → Sales → Settings → Sales settings. Object: SalesSettings.
| Field | Values | Default | Behaviour |
|---|---|---|---|
| Mobile price mismatch, % | Decimal percent. Empty or less than or equal to 0 means 0.5%. | 0.5% effective fallback | When the phone posts a sales order, the server reprices every line. If both the absolute difference is more than 0.01 and the percent difference is above this value, the command is rejected as a price mismatch. |
| Confirm order on submit | Off / on | Off | Off: a field order lands in Submitted and waits for manager approval. On: submit confirms it immediately, so the manager inbox is empty for that order. |
These settings change the order state, not the visit. A visit can still be checked in and checked out when the order is rejected.
GPS shift#
The movement thresholds are not user settings. During a running shift, a breadcrumb is kept when movement is more than 50 m from the last breadcrumb and at least 30 seconds after it, or by heartbeat after 60 seconds. Missing accuracy, speed or battery readings are omitted, not written as zero.
Map tiles are stand infrastructure, not Sales metadata. They are configured in Administration → Map and used by Sales agents desk and the Manager phone view.
Example with numbers#
A sales person is linked to user ivan.agent. The office creates a route for 30 September with two stops:
| Stop | Window | Result on the phone |
|---|---|---|
| 1 Khreshchatyk Kiosk | 09:00–10:00 | Shows first with Check in. |
| 2 Podil Cafe | 11:30–13:00 | Shows second with Check in. |
The agent starts a shift at 08:55. At 09:00 the phone records the first point. At 09:00:25 the agent has moved 40 m: no breadcrumb is kept, because movement is not more than 50 m and 30 seconds have not passed. At 09:01:00 the heartbeat keeps a point even without movement. At 09:03:00 the agent is 130 m away: another breadcrumb is kept.
At stop 1 the agent writes an order for 10 packs at 185.00 each. The phone total is 1850.00. The server price is 184.00 per pack, so the difference is 10.00, or 0.54%. With Mobile price mismatch, % at 0.5, the order is rejected. With the setting at 1.0, the same order is accepted and moves according to Confirm order on submit.
Boundaries and edge cases#
- The phone does not compute final prices, stock sufficiency or credit limits. It shows cached hints; the server rechecks on posting.
- A shift controls GPS tracking only. Check-in still works with the shift off, but Sales agents desk will not see a track.
- An
AgentVisithas no direct agent field. The agent is read through the route. - An order without a Visit value does not appear on the visit card.
- Moving an order to another visit moves the link; a quotation link is not removed.
- Photos are uploaded after the visit reaches the stand; a photo attached to a local draft waits.
- Purchase-order approval (threshold, separate approval state) is not in the field-sales contour.
What is posted#
| Object | Accounting effect |
|---|---|
VisitRoute |
No register movement and no general-ledger entry. |
AgentTask |
No register movement and no general-ledger entry. Complete and cancel only change the subtype. |
AgentVisit |
No register movement and no general-ledger entry. Check-in and check-out only stamp visit facts. |
AgentGpsLog |
Information-register rows with agent, period, latitude, longitude and optional accuracy / speed / battery. |
Field SalesOrder |
The same sales order process as the office: submit / approve, then a sales realization posts debt, tax and stock only when the realization reaches Released. |
Payments are still separate documents. The visit never marks an order paid.
What's not there yet#
- There is no purchase-order approval rule, threshold or separate approval state in this contour.
- There is no iOS build or app-store distribution.
- The phone does not contain its own map engine for tracks; Manager map actions open Google Maps.
- There is no visit amount or visit profitability calculation. The visit print form lists linked order numbers and states only.
- GPS tracking is not a legal time-and-attendance register.
Same topic for other readers: User · Developer