The YUSEN LIMO scanner accepts two payload formats encoded in a QR code. The first is a JSON object containing one or more shipment fields, which triggersDocumentation 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.
normalizeShipmentPayload() and auto-fills the active form. The second is a plain text string (any non-JSON value), which is treated as a HAWB or MAWB identifier and used as a search/filter term on the Inventory or Activity page. The app selects between the two formats by attempting JSON.parse() on the decoded text — if parsing throws, the value is handled as plain text.
JSON Payload Format
When the decoded QR text is valid JSON,handleScannedPayload() passes the parsed object to normalizeShipmentPayload(). This function accepts a wide range of alias keys for each logical field, making it tolerant of QR codes generated by different source systems or label-printing tools.
Supported Field Aliases
| Canonical Field | Accepted Property Names |
|---|---|
hawb | hawb, HAWB, hawbNumber, shipmentId |
mawb | mawb, MAWB, mawbNumber |
client | client, Client, shipmentClient |
invoice | invoice, invoiceNumber, markings, marking |
transactionType | transactionType, transactionTypeName, transaction_type, transactionTypeLabel, transaction, type |
plateNo | plateNo, plate, plateNumber, vehiclePlate, vehiclePlateNo |
date | date |
time | time |
normalizeShipmentPayload(). Unknown keys will not cause an error, but their values will not be written to the form.
Full JSON Example
How normalizeShipmentPayload() Works
normalizeShipmentPayload(payload) accepts any object and returns a new object with a fixed set of canonical keys. Every key in the return value is always present — fields that have no matching alias in the source payload are returned as empty strings rather than undefined. This guarantees that populateShipmentForm() can iterate data-field elements without needing to guard against missing keys.
How populateShipmentForm() Works
After normalization,populateShipmentForm(payload, context) resolves the active form context — either the explicitly provided context argument, the currently visible .tab-content.active element, or the document root as a fallback. It then:
- Queries every element with a
data-fieldattribute inside that context. - Looks up
fieldValues[fieldName]from the normalized payload for each element. - For
<select>elements, delegates toapplySelectValue(), which tries an exact match on option text/value first, then a substring match — both comparisons are case-insensitive and strip punctuation. - For all other input types, sets
.valuedirectly and dispatches a syntheticinputevent so reactive UI listeners (e.g., auto-suggest, validation) are triggered. - If a stored shipment in Local Storage has a HAWB or MAWB matching the scanned value,
populateShipmentForm()additionally back-fills thelocation(text input) andunit(select) fields from that stored record — useful for outbound forms where the location was recorded at inbound time.
Date and Time Fallback
If the scanned payload omitsdate or time, populateShipmentForm() calls getPhilippineDateTime() and fills those fields with the current date and time in the Philippine Standard Time (UTC+8) timezone. This means forms are never submitted with blank date/time fields even when the QR code only carries identifiers.
Plain-Text Payload Format
IfJSON.parse(text) throws — meaning the QR code contains a raw string rather than a JSON object — handleScannedPayload() routes the raw text to applyScannedPayloadToPage(). This function checks for the presence of #inventorySearchInput or #activitySearchInput in the current page:
- If found, it sets the search input value to the decoded string and calls
refreshInventory()orrefreshActivity()to immediately re-filter the displayed rows. - If neither search input exists on the current page (for example, if the operator scans while on the Inbound/Outbound page),
applyScannedPayloadToPage()returnsfalseand the app shows an"Invalid QR Code"alert.
#inventorySearchInput with HAWB-20240601-001 and trigger a live filter, without any JSON parsing at all.
Generating QR Codes
Any standard QR code generator (browser-based, command-line, or embedded in a label printer) can encode the JSON payload as a UTF-8 string. There are no proprietary extensions or checksums beyond the QR standard itself. For maximum scanner reliability, encode only the shipment identifier (HAWB or MAWB) and let the application look up the remaining fields from Local Storage or, in a future backend integration, from the database:populateShipmentForm() receives a single-field payload like this, it will write the HAWB into the form, auto-fill date and time from the current Philippine time, and — if a matching inbound record is found in Local Storage — also restore location and unit from that stored shipment.