Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/raceliciouss/YUSEN-LIMO-WAREHOUSE/llms.txt

Use this file to discover all available pages before exploring further.

The Inbound & Outbound page (pages/inbound-outbound.html) is the primary data entry interface for warehouse operations. It handles two distinct workflows — receiving cargo into the warehouse and releasing cargo for dispatch — both accessible from a tabbed interface on the same page. All form data is written to Local Storage under the warehouseShipments key by saveStoredShipments(), which also fires the warehouse:data-updated event to update the dashboard and inventory views in real time.

Tabbed Interface

The page uses two tabs rendered inside .tabs-header > .tabs:
Tab labeldata-tab valueContent container
Inbound (Receive Cargo)inbound#inbound-content
Outbound (Release Cargo)outbound#outbound-content
Clicking a tab adds the active class to that tab and its corresponding .tab-content div, and hides the other tab’s content. The active tab at page load is always Inbound.

Inbound Form Fields

The inbound form is divided into three sections.

Shipment Information

These fields identify the shipment being received.
Labeldata-fieldTypeNotes
ClientclienttextName of the consignee or shipper
DestinationdestinationtextDelivery destination
HAWB NumberhawbtextHouse Air Waybill number; includes inline scan button
MAWB NumbermawbtextMaster Air Waybill number; includes inline scan button
Invoice / MarkingsinvoicetextCommercial invoice number or cargo markings
Transaction TypetransactionTypeselectOptions: AFF Import, AFF Export, OFF Import, OFF Export

Receiving Information

These fields capture the logistics details of the inbound truck arrival.
Labeldata-fieldTypeNotes
DatedatedateDate of cargo receipt
TimetimetimeTime of cargo receipt
Received ByreceivedBytextName of the receiving warehouse staff
Plate No.plateNotextVehicle plate number of the delivery truck
TruckertruckertextTrucking company name
DriverdrivertextDriver’s full name
Cargo ConditioncargoConditiontextCondition of cargo on arrival (e.g. Good, Damaged)
Warehouse LocationlocationtextInternal warehouse bay or zone where cargo is stored

Quantity Information

The quantity section supports multiple rows, each containing:
Labeldata-fieldTypeNotes
QuantityquantitynumberNumeric count; minimum value 1
UnitunitselectOptions: PLT, CTN, SACK, PARCEL, BUNDLE, DRUM, PAIL, WOODEN CRATE, STEEL CRATE, ROLLS, CRATE, PCS, CASE, PKG
Additional quantity rows are added by clicking + Add Another Quantity. Each row has a delete button (.btn-delete) to remove it. When a shipment is built, quantities across all rows are summed into qtyIn.

Outbound Form Fields

The outbound form mirrors the inbound layout but captures release-specific details. It also contains a Shipment Information section with the same client, destination, hawb, mawb, invoice, and transactionType fields so that outbound entries can be linked to the correct inbound reference.

Release Information

Labeldata-fieldTypeNotes
DatedatedateDate of cargo release
TimetimetimeTime of cargo release
Released ByreleasedBytextName of the staff authorising the release
Plate No.plateNotextVehicle plate of the outbound truck
TruckertruckertextTrucking company name
DriverdrivertextDriver’s full name
Cargo ConditioncargoConditiontextCondition of cargo on departure
Warehouse LocationlocationtextLocation from which cargo is being released
The quantity section on the outbound form is identical in structure to the inbound form. Quantities entered here are accumulated into qtyOut when the record is aggregated.

QR Scan Button

Both the inbound and outbound forms include inline scan buttons (.inline-scan-btn) next to the HAWB Number and MAWB Number fields. Clicking any scan button:
  1. Opens #scanModal, a full-screen camera overlay.
  2. Sets the scan context to the active tab’s form (inbound-content or outbound-content).
  3. Starts startQrScanner(), which uses navigator.mediaDevices.getUserMedia() and the jsQR library to decode QR codes from the live camera feed.
  4. On a successful decode, normalizeShipmentPayload() maps the QR payload fields to the standard form field names, and populateShipmentForm() writes the values into the form using data-field selectors.
  5. Closing the modal with the Cancel button calls stopQrScanner() and hides the overlay.
If the QR payload is plain text rather than JSON, the app treats the decoded string as a HAWB or MAWB value and populates the corresponding field directly.

Save Button

Each form has a Save button (.save-shipment-btn). Clicking it triggers the following sequence:
  1. buildShipmentRecord(form) reads all data-field inputs from the active form and constructs a shipment object.
  2. validateShipmentRecord(shipment) checks that required fields are present; an alert is shown if validation fails.
  3. The new shipment is prepended to the existing array from getStoredShipments() using shipments.unshift(shipment).
  4. saveStoredShipments(shipments) writes the updated array to localStorage under the warehouseShipments key.
  5. saveStoredShipments() dispatches new Event('warehouse:data-updated') on window, which triggers renderDashboardData(), refreshInventory(), and refreshActivity() on any open page.
  6. The form is cleared with clearShipmentForm(form) and a toast confirmation is displayed.

Saved Shipment Record Structure

Each record written to warehouseShipments has the following shape:
{
  "client": "ACME Corp",
  "destination": "Manila",
  "hawb": "HAWB-20240101-001",
  "mawb": "MAWB-20240101-999",
  "invoice": "INV-2024-0042",
  "transactionType": "AFF Import",
  "location": "Bay A-3",
  "status": "RECEIVED",
  "entryType": "inbound",
  "savedAt": "2024-01-01T09:30:00.000Z",
  "date": "2024-01-01",
  "time": "09:30",
  "receivedBy": "Juan Cruz",
  "plateNo": "AAA 1234",
  "trucker": "FastFreight Inc.",
  "driver": "Pedro Santos",
  "cargoCondition": "Good",
  "quantity": "10",
  "unit": "PLT",
  "qtyIn": "10",
  "qtyOut": "",
  "releaseDate": "",
  "releaseTime": "",
  "releasePlate": "",
  "releaseDriver": "",
  "releaseQty": "",
  "remarks": ""
}
For outbound records, entryType is set to "outbound", the qtyOut / releaseQty fields are populated, and the releaseDate, releaseTime, releasePlate, and releaseDriver fields carry the release details. The hawb and mawb fields on the outbound record must match the reference from the corresponding inbound record so that aggregateShipmentsByReference() groups them correctly.
Partial outbound support: You do not need to release an entire shipment in a single outbound entry. Each outbound save for the same HAWB or MAWB is preserved as a separate entry in the outboundDetails array after aggregation. qtyOutValue accumulates the sum of all outbound quantities for that reference, and the drawer in the Inventory page lists every release event in chronological order. This allows warehouses to process staged or split releases against a single inbound shipment.
No server-side duplicate validation: Because the system is fully client-side, there is no deduplication check on hawb or mawb at save time. Submitting the inbound form twice with the same HAWB will create two separate records in warehouseShipments, both of which will contribute to qtyInValue during aggregation, inflating the inventory count. Operators should verify that each HAWB or MAWB is entered only once per receiving event.

Build docs developers (and LLMs) love