-
Notifications
You must be signed in to change notification settings - Fork 2
Transit Entry Routing Implementation Guide
This document explains the Automatic Routing Creation for Transit Entry Type feature in the Logistics system. When an Air Booking or Air Shipment is created with a Transit entry type (which maps to "Transshipment" in the system), the system automatically creates routing legs to help track the cargo journey through intermediate ports.
Transit Entry Routing automatically creates routing legs when cargo is marked as transit/transshipment. This eliminates manual routing setup and ensures proper tracking of cargo that passes through intermediate airports before reaching its final destination.
- Multi-Leg Journeys: Cargo traveling from Origin → Transit Airport → Final Destination
- Transshipment Tracking: Track cargo that changes flights/airlines at intermediate airports
- Compliance & Documentation: Ensure proper routing documentation for customs and regulatory purposes
- Operational Visibility: Provide clear visibility of the complete cargo journey
- Cost Allocation: Help allocate costs across different legs of the journey
-
Create a New Air Booking
- Navigate to: Air Freight → Air Booking → New
- Fill in the basic booking details (Booking Date, Customer, etc.)
-
Set Entry Type to Transit
- In the Booking Details section, locate the Entry Type field
- Select "Transshipment" from the dropdown
- Note: "Transshipment" is the system term for Transit entry type
- This maps from "Transit" in Sales Quote
-
Fill Required Port Information
- Origin Airport: Select the origin UNLOCO code
- Destination Port: Select the final destination UNLOCO code
- ETD: Enter Estimated Time of Departure
- ETA: Enter Estimated Time of Arrival
-
Save the Document
- Click Save button
- The system automatically creates a routing leg in the Routing tab
-
View Created Routing
- Navigate to the Routing tab
- You will see a routing leg automatically created with:
- Leg Order: 1
- Mode: AIR
- Type: Main
- Status: Planned
- Load Port: Your origin port
- Discharge Port: Your destination port
- ETD/ETA: Dates from the main document
-
Modify Routing as Needed
- You can add additional legs if cargo transits through intermediate airports
- Edit the created leg to add flight numbers, carriers, or other details
- Add more legs by clicking Add Row in the Routing Legs table
-
Create Sales Quote with Transit Entry Type
- In Sales Quote, set Air Entry Type to "Transit"
- Fill in other required details
-
Create Air Booking from Sales Quote
- Create a new Air Booking
- Link it to the Sales Quote
- Click "Fetch Quotations" button
- The system will:
- Map "Transit" from Sales Quote to "Transshipment" in Air Booking
- Automatically create routing when the document is saved
-
Routing is Automatically Created
- After saving, check the Routing tab
- Routing leg is automatically populated
-
Create Air Booking with Transit Entry Type
- Follow steps from Scenario 1
- Ensure routing is created
-
Convert to Air Shipment
- Click "Convert to Shipment" button
- The routing legs are automatically copied to Air Shipment
- If Air Shipment doesn't have routing and entry_type is "Transshipment", routing is created automatically
The system automatically creates routing in the following scenarios:
-
On Document Save: When Air Booking or Air Shipment is saved with
entry_type = "Transshipment" -
Only if Empty: Routing is only created if
routing_legstable is empty (prevents overwriting existing routing) -
Requires Ports: Both
origin_portanddestination_portmust be set
Location: logistics/air_freight/doctype/air_booking/air_booking.py
Method: create_routing_for_transit_entry()
Called From: validate() method
def create_routing_for_transit_entry(self):
"""
Automatically create routing legs when entry_type is Transshipment (Transit).
Creates a main routing leg from origin to destination if routing_legs is empty.
"""
# Only create routing if entry_type is Transshipment
if self.entry_type != "Transshipment":
return
# Only create routing if routing_legs is empty
routing_legs = getattr(self, "routing_legs", []) or []
if routing_legs:
return
# Require origin and destination ports
if not self.origin_port or not self.destination_port:
return
# Create main routing leg
leg_data = {
"leg_order": 1,
"mode": "AIR",
"type": "Main",
"status": "Planned",
"load_port": self.origin_port,
"discharge_port": self.destination_port,
"etd": self.etd,
"eta": self.eta,
}
# Set carrier information if available
if self.airline:
leg_data["carrier_type"] = "Airline"
leg_data["carrier"] = self.airline
# Append the routing leg
self.append("routing_legs", leg_data)Location: logistics/air_freight/doctype/air_shipment/air_shipment.py
Method: create_routing_for_transit_entry()
Called From: validate() method
Same implementation as Air Booking for consistency.
The system maps entry types between Sales Quote and Air Booking:
| Sales Quote Entry Type | Air Booking Entry Type |
|---|---|
| Direct | Customs Permit |
| Transit | Transshipment |
| Transshipment | Transshipment |
Mapping Function: _map_sales_quote_entry_type_to_air_booking()
When routing is automatically created, the following fields are populated:
| Field | Value | Description |
|---|---|---|
| Leg Order | 1 | Sequence number of the leg |
| Mode | AIR | Transportation mode |
| Type | Main | Leg type (Main/Pre-carriage/On-forwarding) |
| Status | Planned | Current status of the leg |
| Load Port | Origin Port | Port where cargo is loaded |
| Discharge Port | Destination Port | Port where cargo is discharged |
| ETD | Document ETD | Estimated Time of Departure |
| ETA | Document ETA | Estimated Time of Arrival |
| Carrier Type | Airline | Type of carrier (if airline is set) |
| Carrier | Airline Name | Specific carrier/airline (if airline is set) |
After routing is created, you can manually add:
- Flight No: Flight number for the leg
- Vessel: For sea freight (not applicable for air)
- Voyage No: For sea freight (not applicable for air)
- ATD: Actual Time of Departure
- ATA: Actual Time of Arrival
- Notes: Additional notes about the leg
- Charter Route: If this is a charter route
Scenario: Cargo from New York (JFK) to Tokyo (NRT) via Dubai (DXB)
Steps:
- Create Air Booking
- Set Entry Type: Transshipment
- Origin Port: USNYC (New York)
- Destination Port: JPTYO (Tokyo)
- Save document
Result:
- System creates 1 routing leg: JFK → NRT
- You can manually add a second leg: JFK → DXB (Leg 1), DXB → NRT (Leg 2)
Scenario: Cargo with known transit points
Steps:
- Create Air Booking with Transit entry type
- System creates initial leg: Origin → Destination
- Manually modify routing:
- Leg 1: Origin → Transit Airport (Flight: AA123)
- Leg 2: Transit Airport → Destination (Flight: JL456)
Result: Complete routing with all transit points documented
Scenario: Creating Air Booking from Sales Quote with Transit entry type
Steps:
- Sales Quote has Air Entry Type = "Transit"
- Create Air Booking and link to Sales Quote
- Click "Fetch Quotations"
- System maps "Transit" → "Transshipment"
- Save Air Booking
Result: Routing automatically created with mapped entry type
The system enforces the following rules:
-
Entry Type Check: Routing is only created when
entry_type = "Transshipment" -
Empty Routing: Routing is only created if
routing_legstable is empty -
Required Ports: Both
origin_portanddestination_portmust be set - No Overwrite: Existing routing is never overwritten by automatic creation
Check the following:
-
Entry Type: Ensure
entry_typeis set to "Transshipment"- If using Sales Quote, ensure "Transit" is selected (it maps to Transshipment)
-
Ports Required: Both Origin Port and Destination Port must be filled
- Check that UNLOCO codes are valid
-
Existing Routing: If routing already exists, automatic creation is skipped
- Clear existing routing legs if you want automatic creation
-
Document Status: Ensure document is saved (not just draft)
- Routing is created during
validate()which runs on save
- Routing is created during
Common Issues:
-
Missing Carrier: If airline is not set on the document, carrier fields won't be populated
- Solution: Set the Airline field, or manually add carrier to routing leg
-
Missing Dates: If ETD/ETA are not set, routing leg will have empty dates
- Solution: Fill ETD/ETA on the main document before saving
-
Wrong Ports: If origin/destination ports are incorrect, routing will reflect those
- Solution: Correct ports on main document, then delete and recreate routing
-
Air Booking Form:
- Navigate to Routing tab
- View Routing Legs table
-
Air Shipment Form:
- Navigate to Routing tab
- View Routing Legs table
- Leg Order: Shows sequence (1, 2, 3, etc.)
- Status: Color-coded status (Planned/Confirmed/On-hold)
- Mode: Shows AIR or SEA icon
- Type: Indicates Main/Pre-carriage/On-forwarding
A: Transshipment (Transit) entry type indicates cargo that passes through intermediate ports. Direct shipments don't require multi-leg routing, so automatic creation is only for transit scenarios.
A: Currently, automatic routing creation cannot be disabled. However, it only creates routing if the routing_legs table is empty, so existing routing is never overwritten.
A: The system creates the first leg automatically. You can manually add additional legs by clicking "Add Row" in the Routing Legs table.
A: Currently, this feature is implemented for Air Booking and Air Shipment only. Sea Freight routing creation can be added in a future enhancement.
A: All routing legs are automatically copied from Air Booking to Air Shipment. If Air Shipment doesn't have routing and entry_type is "Transshipment", routing is also created automatically.
A: Yes! The automatically created routing leg is fully editable. You can modify any field, add flight numbers, change status, or add additional legs.
A: Changing entry_type does not delete existing routing. Routing remains in place. If you delete routing and change entry_type back to "Transshipment", routing will be recreated on save.
-
v1.0 (2025-02-10): Initial implementation
- Added automatic routing creation to Air Booking
- Added automatic routing creation to Air Shipment
- Entry type mapping from Sales Quote
- Automatic routing on document save
For questions or issues related to Transit Entry Routing:
- Contact the development team
- Refer to technical documentation
- Check system logs for validation errors
- Entry Type Mapping: "Transit" from Sales Quote maps to "Transshipment" in Air Booking
-
Validation Timing: Routing is created during
validate(), which runs before save - No Overwrite: Always check if routing_legs is empty before creating
- Port Validation: Ensure ports are valid UNLOCO codes before creating routing
Test the following scenarios:
- Create Air Booking with Transit entry type → Routing created
- Create Air Booking with Direct entry type → No routing created
- Create Air Booking with existing routing → No overwrite
- Create Air Booking without ports → No routing created
- Convert Air Booking to Air Shipment → Routing copied
- Create Air Shipment directly with Transit → Routing created
Potential improvements:
- Configurable Settings: Allow users to enable/disable automatic routing creation
- Sea Freight Support: Extend to Sea Booking and Sea Shipment
- Transit Port Detection: Automatically detect transit ports from flight schedules
- Multi-Leg Creation: Automatically create multiple legs based on known transit points
- Template-Based Routing: Use routing templates for common transit routes
Last Updated: February 10, 2025
Status: ✅ Implemented and Active
Version: 1.0
Getting Started
- Getting Started
- Recent Platform Updates
- CargoNext v1 — Release Notes
- CargoNext v1 — Astraea Press Release
- Document Management
- Milestone Tracking
- Customer Portal
Setup and Settings
- Logistics Settings
- Credit Management
- Default Details and Relationships
- Sea Freight Settings
- Air Freight Settings
- Transport Settings
- Warehouse Settings
- Customs Settings
Sea Freight
- Sea Freight Module
- Sea Booking
- Sea Shipment
- Sea Consolidation
- Master Bill
- Shipper
- Consignee
- Container Type
- Container Management
Air Freight
Transport
- Transport Module
- Transport Order
- Transport Job
- Transport Consolidation
- Transport Leg
- Transport Plan
- Run Sheet
- Proof of Delivery
- Transport Template
- Load Type
- Transport Order — Inter-module Field Copy
Customs
Warehousing
- Warehousing Module
- Inbound Order
- Release Order
- Transfer Order
- VAS Order
- Stocktake Order
- Warehouse Job
- Warehouse Contract
- Gate Pass
- Periodic Billing
- Storage Location
- Handling Unit Type
Pricing Center
- Sales Quote
- Sales Quote — Separate Billings and Internal Job
- Change Request
- Sales Quote – Calculation Method
Job Management
- Job Management Module
- Revenue Recognition Policy — Accounts, Dates, and Charges
- Proforma GL Entries
- WIP and Accrual Reversal on Invoicing
Sustainability
Intercompany
Special Projects
Pages
Features
Reports
Glossary