Skip to main content

Route Picking / Delivery Sheet

Route picking is the handoff between invoiced sales orders and the transport workflow. The document groups invoices by delivery route, lets sales/warehouse staff order the stops, checks products and lots, confirms loading, and sends the delivery invoices to B1 for stock deduction.

The key idea is that invoice rows stay attached to the delivery sheet, while product checking and batch/lot selection are stored on the delivery document. After the sheet is confirmed, invoice add/remove/sort is locked and the work moves to transport/warehouse actions.

App Entry Points

AppTarget
MobileShippingList -> ShippingDetail
POS TerminalshippingRoute -> ShippingRouteDetailForm

End-To-End State Flow

Create And Invoice Management

Important details:

  • Route is required before the document can be created.
  • branchId and whGrpCode must exist; otherwise the app blocks creation.
  • Available invoice options exclude canceled invoices and invoices already assigned to a delivery.
  • Adding an invoice calls addInvoiceToDelivery(...); removing calls deleteInvoiceFromDelivery(...).
  • Sorting is saved through sortDeliveryInvoices(...).
  • Once confirmed, the sheet can no longer add, remove, or sort invoices unless another operational flow unlocks/reworks it.
  • If a confirmed sheet becomes empty while still active, Mobile has an auto-delete guard for empty active delivery detail.

Product Checking, Lots, And B1

Product checking starts after the sheet is confirmed and assigned into transport (toTransportation = 1). If it is not assigned to transport, product actions show “ยังไม่ถูกจัดขึ้นขนส่ง”.

B1 send behavior:

Loading And Assignment Flow

Loading status means:

ValueMeaning
emptygoods loading is not confirmed
LOADING_DOCKgoods are arranged at the dock
LOADEDgoods are loaded onto the vehicle

Status Reference

FieldValueMeaning
deliveryStatusemptypreparing delivery sheet
deliveryStatusFINISHEDsales finished preparing the sheet
deliveryStatusCHECKLOCATIONwarehouse checked products/lots
deliveryStatusPENDING_FOR_B1waiting for B1 stock deduction
deliveryStatusSOME_DELIVERY_FAILat least one invoice failed stock deduction
deliveryStatusDONEstock deduction completed
statusDELETEDdelivery sheet is deleted/locked

Permissions And Guards

ActionGuard
See Terminal menushippingRoute, deptCode -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 12, 22, 27, 28, 13, 16, 14, 30, main branch only
Create route sheetcanCreateShippingRoute(...), main branch, route selected, branchId and whGrpCode present
Add/remove/sort invoicedocument not deleted, not confirmed, current user is owner
Delete invoice rowsame as edit, plus toB1 !== 1
Confirm route sheetdocument not deleted, not confirmed, current user is owner
Accept workconfirmed, toTransportation = 1, no acceptedBy, dept allowed by ACCEPT_DEPTS
Check products/lotsdept 2, 8, 22, user 999997, or accepted worker
Confirm dock / loadeddept allowed by LOAD_DOCK_DEPTS
Assign workerloadingStatus = LOADING_DOCK and dept allowed by ASSIGN_DEPTS
Send to B1dept 2, 8, 12, 22, 28 and status is CHECKLOCATION, PENDING_FOR_B1, or SOME_DELIVERY_FAIL
Request invoice canceldept 12, 22, 28, delivery not DONE, no discount/credit-note usage, invoice not sent to B1

Mobile vs POS Terminal

TopicMobilePOS Terminal
Screen shapeShippingList -> ShippingDetailshippingRoute -> ShippingRouteDetailForm
List behaviordedicated stack/list screen with status filtersplit-pane list card in HomeScreen
Detail behaviorfull-screen detail, bottom/header actionsright-side detail panel, header actions from onHeaderActionsChange
Available invoicesgetShippingInvoicesWithoutDelivery(...)getShippingRouteAvailableInvoices(...) through split menu data
B1 progressmodal with batch statusmodal with batch status
Product lotsBatchLotSheet / BatchLotEditorModalbatch picker/editor inside shipping detail form

Developer Handoff Map

AreaCode
Mobile listapps/mobile/src/screens/shippingStack/shippingListScreen/index.tsx
Mobile detailapps/mobile/src/screens/shippingStack/shippingDetailScreen/index.tsx
Mobile rules/helpersapps/mobile/src/screens/shippingStack/shippingDetailScreen/helpers.ts
Terminal detailapps/pos-terminal/src/screens/HomeScreen/ShippingRouteDetailForm.tsx
Terminal split servicesapps/pos-terminal/src/services/splitMenuData.ts
Delivery APIsapps/mobile/src/services/deliveries.ts, apps/pos-terminal/src/services/deliveries.ts
Shipping queriesapps/mobile/src/services/shipping.ts, apps/pos-terminal/src/services/shipping.ts
Transport follow-upapps/*/src/services/transport.ts, TransportDetailForm