# Route Wise Customer

<p class="doc-lead">Map view of all customers on a route — spot customers plotted outside the route area and reassign their route without leaving the report.</p>

<div class="doc-toc">
<p class="doc-toc-title">On this page</p>
<div class="doc-toc-links">
<a href="#/sales/reports/route-wise-customer?id=overview">Overview</a>
<a href="#/sales/reports/route-wise-customer?id=use-cases">Use Cases</a>
<a href="#/sales/reports/route-wise-customer?id=filters">Filters</a>
<a href="#/sales/reports/route-wise-customer?id=layout">Layout</a>
<a href="#/sales/reports/route-wise-customer?id=columns">Columns</a>
<a href="#/sales/reports/route-wise-customer?id=actions">Actions</a>
<a href="#/sales/reports/route-wise-customer?id=faq">FAQ</a>
</div>
</div>

<hr class="doc-section-divider">

<h2 id="overview">Overview</h2>

Go to <b>Sales → Reports → Route Wise Customer</b>.

Report title in ERP: <b>Route Wise Customer</b>

<p><b>What it shows.</b> Every active customer assigned to the selected route(s), plotted on a Google map using the customer's saved GPS location, with a summary of customer counts, outliers, and customers that have no location saved.</p>

<p><b>When to use it.</b> Use it to verify route hygiene — to find customers who are mapped to the wrong route because they sit far away from the rest of the route, and to correct the route assignment on the spot.</p>

<p><b>How amounts are calculated.</b> This is a location report, not a sales total. It lists active customers on the selected route(s) using each customer's saved GPS. Distance from the route centre flags outliers. Customers with no location are counted separately and are not plotted.</p>

<p><b>How outliers are calculated.</b> For each route the system takes the <b>median</b> latitude and longitude of all located customers on that route as the route centre, then measures the straight-line (haversine) distance from each customer to that centre. Any customer beyond the <b>Outside … km</b> threshold (25 km by default) is flagged as <b>Outside area</b> and drawn as a red marker. The median is used instead of the average so that one stray pin does not pull the centre towards itself.</p>

<img src="sales/images/route-wise-customer.webp" alt="Route Wise Customer map with customers on the selected route" loading="lazy">

<hr class="doc-section-divider">

<h2 id="use-cases">Use Cases</h2>

<ul>
<li><b>Route data cleanup</b> — Find customers tagged to a route that are geographically nowhere near it and move them to the correct route.</li>
<li><b>Route planning</b> — See the real spread of a route on a map before splitting or merging routes.</li>
<li><b>Geo-tagging follow-up</b> — Use the <b>No Location</b> tab to chase customers whose GPS was never captured, which also blocks Field Sale App check-ins.</li>
<li><b>New customer review</b> — Confirm that recently created customers were assigned to a sensible route.</li>
</ul>

<hr class="doc-section-divider">

<h2 id="filters">Filters</h2>

<b>Route Group</b>, <b>Route</b>, <b>Outside … km</b>.

<ul>
<li>Leave <b>Route Group</b> and <b>Route</b> blank to load all active routes.</li>
<li>Selecting a <b>Route Group</b> includes every route in that group.</li>
<li><b>Outside … km</b> sets the outlier threshold. Options are 2, 5, 10, 25, and 50 km, and it defaults to <b>25 km</b>. Lower it for dense city routes, raise it for wide rural routes. Changing it reloads the report.</li>
<li>Only customers with status <b>Active</b> are included.</li>
</ul>

<hr class="doc-section-divider">

<h2 id="layout">Layout</h2>

The report is a three-panel screen:

<ul>
<li><b>Left — Routes.</b> One row per route with its customer count, outlier count, and no-location count. Click a route to load it into the middle and map panels.</li>
<li><b>Middle — Customers.</b> Two tabs: <b>On Map</b> (customers with GPS, sorted with the farthest from the route centre first) and <b>No Location</b> (customers with no GPS saved).</li>
<li><b>Right — Map.</b> Markers for every located customer on the selected route, auto-zoomed to fit. <span style="color:#c0392b"><b>Red</b></span> markers are outliers, blue markers are within the route area. Hover a marker to see the customer name, code, and distance from the route centre; click it to open the customer bubble with the <b>Edit</b> button.</li>
</ul>

<hr class="doc-section-divider">

<h2 id="columns">Columns</h2>

<b>Routes panel</b>

| **Column** | **Description** |
|------------|-----------------|
| Route | Route name. |
| Route Group | Route group the route belongs to. |
| Customers | Total active customers on the route. |
| Outside | Customers farther than the selected km threshold from the route centre. |
| No Loc | Customers with no latitude/longitude saved. |

<b>Customers panel</b>

| **Column** | **Description** |
|------------|-----------------|
| Customer Code | Party code of the customer. |
| Customer | Customer name. Click to open the customer quick view. |
| Distance | Straight-line distance from the route centre, in km. |
| Outside area | Shown when the customer is beyond the outlier threshold. |

<hr class="doc-section-divider">

<h2 id="actions">Actions</h2>

<ul>
<li><b>Generate</b> — run the report for the selected filters</li>
<li><b>Hover a marker</b> — show the customer name, code, and distance from the route centre without clicking</li>
<li><b>Click a marker</b> — open the customer bubble</li>
<li><b>Edit</b> (pencil icon) — open the customer edit form from the map bubble or the customer row; the report refreshes after saving</li>
<li><b>Customer name</b> — open the customer quick view</li>
<li><b>Route row</b> — switch the map and customer list to that route</li>
</ul>

<p>The <b>Edit</b> action opens the full customer form in a window, so you can correct the route along with any other customer detail. It requires the customer <b>update</b> permission.</p>

<hr class="doc-section-divider">

<h2 id="faq">FAQ</h2>

<p><b>Why is a customer missing from the map?</b><br>The customer has no GPS location saved. Check the <b>No Location</b> tab — those customers are listed there and can still be reassigned.</p>
<p><b>How do I identify a pin without clicking it?</b><br>Hover over the marker. The tooltip shows the customer name, party code, and distance from the route centre.</p>
<p><b>How do I save a customer's location?</b><br>Open the customer and use the <b>Map</b> tab to drop the pin, or capture it from the Field Sale App at the customer's shop.</p>
<p><b>A customer is flagged Outside area but is genuinely on the route. Is that wrong?</b><br>Not necessarily. The flag is only a distance hint. Raise the <b>Outside … km</b> threshold for spread-out rural routes, or ignore the flag for that customer.</p>
<p><b>Does the outlier count include customers with no location?</b><br>No. Customers without GPS are counted separately under <b>No Loc</b> and are never flagged as outliers.</p>
<p><b>Why does the report say the result was truncated?</b><br>The report loads a maximum of 5000 customers at a time. Filter by route or route group to see a complete list.</p>
<p><b>Does changing the route here affect past invoices?</b><br>No. It updates the customer master going forward. Historical documents keep the route they were saved with.</p>
<p><b>Which customers are included?</b><br>Only active customers that have a route assigned. Customers with no route do not appear on any route row.</p>

<hr class="doc-section-divider">

<h2 id="related">Related</h2>

<ul>
<li><a href="#/sales/reports/route-wise-sale">Route Wise Sale</a></li>
<li><a href="#/sales/reports/customer-route-checkin">Customer Wise Route Check In</a></li>
<li><a href="#/sales/reports/employee-customer-checkin">Employee Wise Customer CheckIn</a></li>
<li><a href="#/settings/routes">Routes</a></li>
</ul>
