-
Notifications
You must be signed in to change notification settings - Fork 2
Documents Tab
This document describes the design for a unified Documents Tab feature across Booking/Order and Shipment/Job/Declaration doctypes in the Logistics app. The feature provides centralized document management, monitoring, and compliance tracking with configurable templates per product type, date-based requirements, and overdue alerts.
| Module | DocType | Description |
|---|---|---|
| Air Freight | Air Booking | Air freight booking/order |
| Sea Freight | Sea Booking | Sea freight booking/order |
| Transport | Transport Order | Domestic transport order |
| Customs | Declaration Order (Customs Declaration Order) | Customs declaration order |
| Warehousing | Inbound Order | Inbound warehouse order |
| Warehousing | Release Order | Release/outbound order |
| Warehousing | Transfer Order | Internal transfer order |
| Module | DocType | Description |
|---|---|---|
| Air Freight | Air Shipment | Air freight job/shipment |
| Sea Freight | Sea Shipment | Sea freight job/shipment |
| Transport | Transport Job | Domestic transport job |
| Warehousing | Warehouse Job | Warehouse operation job |
| Customs | Declaration | Customs declaration (already has Documents tab) |
| Logistics | General Job | General logistics job |
Note: Declaration already has a Documents tab with Declaration Document child table. The design will align with this pattern and optionally migrate/extend it to use the new template system.
A new Document List Template doctype defines which documents are required for each product/context.
| Field | Type | Description |
|---|---|---|
template_name |
Data | Template name (e.g., "Air Export Standard", "Sea Import FCL") |
product_type |
Select | Air Freight, Sea Freight, Transport, Customs, Warehousing, General |
applies_to |
Select | Booking, Shipment/Job, Both |
direction |
Select | Import, Export, Domestic, All (optional filter) |
entry_type |
Select | Direct, Transit, Transshipment, ATA Carnet, All (optional) |
is_default |
Check | Default template for this product when no match |
description |
Small Text | Template description |
Child table defining each document requirement:
| Field | Type | Description |
|---|---|---|
document_type |
Link → Logistics Document Type | Reference to standard document type |
sequence |
Int | Display order |
is_mandatory |
Check | Required for submission/progression |
date_required_basis |
Select | ETD, ETA, Booking Date, Job Date, Manual, None |
days_offset |
Int | Days before/after basis date (e.g., -7 = 7 days before ETD) |
status_flow |
Select | Upload → Done → Received → Verified (comma-separated workflow) |
allow_early_upload |
Check | Can upload before date_required |
description |
Small Text | Help text for users |
Standard catalog of document types used across products. Named Logistics Document Type to avoid conflict with Frappe core's Document Type.
| Field | Type | Description |
|---|---|---|
document_code |
Data | Short code (e.g., CI, PL, BL, AWB) |
document_name |
Data | Full name (e.g., Commercial Invoice, Packing List) |
category |
Select | Trade, Transport, Customs, Insurance, DG, Other |
typical_format |
Select | PDF, Image, Excel, Any |
has_expiry |
Check | Document has expiry date |
is_product_specific |
Check | Only for certain products |
Standard Document Types (examples):
- Commercial Invoice (CI)
- Packing List (PL)
- Bill of Lading (BL)
- Air Waybill (AWB)
- Certificate of Origin (COO)
- Export License
- Import License / Permit
- Insurance Certificate
- Phytosanitary Certificate
- Fumigation Certificate
- Dangerous Goods Declaration (DGD)
- Delivery Order (DO)
- CMR / Cargo Manifest
- Proof of Delivery (POD)
A reusable child table attached to each target doctype:
| Field | Type | Description |
|---|---|---|
document_type |
Link → Logistics Document Type | From template |
template_item |
Link | Optional link to template item for traceability |
document_name |
Data | Custom name override |
document_number |
Data | Reference number (BL#, AWB#, etc.) |
status |
Select | Pending, Uploaded, Done, Received, Verified, Overdue, Expired, Rejected |
date_required |
Date | Calculated or manual – when document must be available |
date_received |
Date | When document was received/uploaded |
date_verified |
Date | When verified (if applicable) |
expiry_date |
Date | For documents with validity |
issued_by |
Data | Issuing authority |
attachment |
Attach | File attachment |
is_required |
Check | From template (mandatory) |
is_verified |
Check | Verification complete |
verified_by |
Link → User | Who verified |
notes |
Small Text | Notes |
overdue_days |
Int | Computed: days past date_required (read-only) |
Status Flow:
Pending → Uploaded → Done → Received → Verified
↓ ↓
Overdue Expired (if expiry_date passed)
Each target doctype gets a Documents tab containing:
-
Document Checklist (Table)
- Rows auto-populated from Document List Template based on product + context
- Columns: Document Type | Status | Date Required | Date Received | Attachment | Overdue | Actions
- Inline edit for status, attachment, dates
- Visual indicators: 🟢 Complete, 🟡 Pending, 🔴 Overdue
-
Document Summary (HTML/Collapsible)
- Count: X of Y required documents complete
- Overdue: N documents overdue
- Next due: Document X due on [date]
-
Dashboard Alerts (in Dashboard tab)
- Notice when documents are missing or overdue
- Link to Documents tab
When a document is opened/created:
- Resolve
product_typefrom doctype (e.g., Air Booking → Air Freight) - Resolve
applies_to(Booking vs Shipment/Job) - Optionally use
direction,entry_typefrom parent doc - Find matching Document List Template (first match by filters, else default)
- Create/refresh child rows from template items
- Compute
date_requiredfromdate_required_basis+days_offset
For doctypes with a Dashboard tab (e.g., Air Shipment, Sea Shipment, Warehouse Job):
- Add an Alerts or Notices section
- Display:
- Missing Documents: List of required documents not yet uploaded/received
-
Overdue Documents: Documents past
date_requiredwith days overdue -
Expiring Soon: Documents with
expiry_datewithin next 7 days
- Each item links to the Documents tab
- Use color coding: red (overdue), orange (due soon), green (complete)
Example structure for dashboard notice:
<div class="document-alerts">
<div class="alert alert-danger" if overdue>
<strong>2 documents overdue</strong>
<ul>
<li>Commercial Invoice – 3 days overdue</li>
<li>Packing List – 1 day overdue</li>
</ul>
<a href="#documents_tab">View Documents</a>
</div>
<div class="alert alert-warning" if missing>
<strong>1 required document pending</strong>
<ul>
<li>Bill of Lading – due 2025-02-25</li>
</ul>
</div>
</div>| Basis | Source Field | Example |
|---|---|---|
| ETD | etd |
date_required = etd + days_offset |
| ETA | eta |
date_required = eta + days_offset |
| Booking Date | booking_date |
date_required = booking_date + days_offset |
| Job Date |
creation or booking_date
|
Same |
| Manual | User entry | User sets date_required |
-
Overdue:
statusin (Pending, Uploaded) ANDdate_required< today -
Days Overdue:
date_diff(today, date_required)when overdue -
Expired:
expiry_dateis set ANDexpiry_date< today
- Daily job to:
- Update
status→ Overdue for documents pastdate_required - Send notifications/emails for overdue documents
- Update dashboard cache
- Update
- Form load: If document has overdue/missing required docs, show banner
- Dashboard tab: Always show document status summary
- Before submit: Warn if mandatory documents are missing (configurable – can block or allow with confirmation)
- Email assignee when document becomes overdue
- Reminder X days before
date_required - Digest: daily summary of all overdue documents per user/customer
- Create Logistics Document Type doctype
- Create Document List Template and Document List Template Item
- Create Job Document child table – generic, linkable to multiple parents
- Add
document_list_templateLink field to relevant doctypes for override
- Add Documents tab +
documentschild table to:- Air Booking, Sea Booking
- Transport Order, Declaration Order
- Inbound Order, Release Order, Transfer Order (as applicable)
- Add Documents tab to:
- Air Shipment, Sea Shipment
- Transport Job, Warehouse Job
- General Job
- Declaration: Extend existing Documents tab to support template-based population (optional migration)
- Server method:
get_document_template_items(product_type, applies_to, direction, entry_type) - On form load: populate child table from template if empty
- Compute
date_requiredfrom parent fields (etd, eta, booking_date) - Client script: refresh document rows when etd/eta/booking_date changes
- Add document alerts section to Dashboard tab (Air Shipment, Sea Shipment, etc.)
- Server method:
get_document_alerts(parent_doctype, parent_name) - Return: missing, overdue, expiring_soon
- Render in milestone_html or dedicated HTML field
- Scheduled task: mark overdue, send notifications
- Report: Document Compliance Report (all products)
- Permission checks for document access
Logistics Document Type (master)
↑
Document List Template
└── Document List Template Item (child) → Document Type
Air Booking / Sea Booking / Transport Order / ... (parent)
└── Booking Document (child) → Document Type, status, dates, attachment
Air Shipment / Sea Shipment / Transport Job / ... (parent)
└── Job Document (child) → Document Type, status, dates, attachment
Declaration (existing)
└── Declaration Document (child) – align fields with Job Document
-
Declaration Document: Already exists. Options:
- (A) Keep as-is, add template support only for Declaration
- (B) Create generic Job Document and migrate Declaration to use it with a compatibility layer
- (C) Rename/refactor Declaration Document to be the generic child table used everywhere
Recommendation: (A) for minimal disruption. Use Job Document for all new integrations; Declaration keeps its existing child table. Both can share the same Document Type master and similar status/date logic.
| Document | Mandatory | Date Basis | Offset |
|---|---|---|---|
| Commercial Invoice | Yes | ETD | -3 |
| Packing List | Yes | ETD | -3 |
| Certificate of Origin | No | ETD | -2 |
| Export License | If required | ETD | -5 |
| DG Declaration | If DG | ETD | -2 |
| Document | Mandatory | Date Basis | Offset |
|---|---|---|---|
| Bill of Lading | Yes | ETA | -1 |
| Commercial Invoice | Yes | ETA | -2 |
| Packing List | Yes | ETA | -2 |
| Import Permit | If required | ETA | -5 |
| Document | Mandatory | Date Basis | Offset |
|---|---|---|---|
| Delivery Order | Yes | Job Date | 0 |
| Proof of Delivery | Yes | Job Date | +1 |
-
Whitelisted methods:
get_document_template_items(product_type, applies_to, direction, entry_type)get_document_alerts(doctype, docname)-
populate_documents_from_template(doctype, docname)– for manual refresh
- REST API: Standard Frappe API for Document List Template, Document Type, and child document tables
-
Custom templates: Customers can create their own Document List Templates and assign via
document_list_templatefield
Document Version: 1.0
Last Updated: 2025-02-21
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