UBL Despatch Advice: fix a delivered quantity error
Repair DeliveredQuantity and unit errors in UBL DespatchAdvice. Compare remaining quantities only with explicit order context and inspect each validation layer.
Read the reported quantity in context
A despatch export can be valid XML while the quantity is unusable for goods receipt. Our independently written preflight checks that DeliveredQuantity is a nonnegative decimal with at most six fractional places and eighteen integer digits. A negative value is flagged at the quantity itself. This is a deliberate lite-scope check for an ERP export, not a reproduction of the official BIS assertions. Zero is accepted by this partial check; the recipient’s agreed profile may impose further conditions.
The fictional failing example declares minus six C62 units. DESPATCH-DELIVERED points to line 15, at /p:DespatchAdvice[1]/p:DespatchLine[1]/p:DeliveredQuantity[1]. The prefix in the diagnostic is generated for navigation; the document’s namespace determines the actual element identity. If the warehouse intended to announce six units, correct the exporter to emit six. Establish the intended quantity from the source order and warehouse workflow before changing the sign.
Keep units explicit
DeliveredQuantity needs a unitCode with an uppercase alphanumeric shape. OutstandingQuantity, when supplied, must use the same unit for this comparison. A quantity in kilograms cannot be compared directly with a quantity in pieces, even if both numbers happen to match. This tool does not invent conversions, load a live code list or establish that a unit code belongs to the receiver’s permitted list. A correct-looking code is therefore only a shape check.
For an ERP mapping error, inspect both the product master’s stocking unit and the order line’s sales unit. A case of twelve pieces is not automatically twelve handling units. Packaging quantities describe a separate structure. The validator deliberately does not compare TotalPackageQuantity to DeliveredQuantity because a package can contain several products, and a product can span several packages.
Use complete order context for remaining amounts
OutstandingQuantity cannot be verified by subtracting DeliveredQuantity from an unknown order. To enable a comparison, open the optional context panel and provide JSON with complete set to true and a lines array. Each record identifies orderId, lineId, ordered, previousDelivered and unitCode. Quantity values are strings so decimal arithmetic stays exact. The fictional context orders twelve units, records two previously delivered and announces six now. Four remain.
The complete flag is your assertion about the supplied history; it is not evidence that those earlier deliveries occurred. With matching units and one unambiguous order-line reference, the tool computes ordered minus previously delivered minus the current delivery. An OutstandingQuantity of five then produces DESPATCH-REMAINING at line 16. Without context, with another unit, or with repeated references that cannot be allocated safely, the remaining-quantity check stays visibly unexecuted. No amount is inferred from the despatch document alone.
Before and after
Before: matching needs repair
DeliveredQuantity = -6 C62After: this error is resolved
DeliveredQuantity = 6 C62Download this fictional error · Known outcomes and source locations.
Verify the regenerated export
- Compare the source order, agreed unit and warehouse export mapping.
- Repair the quantity at its source and regenerate the XML rather than patching each shipment manually.
- Inspect the business, plausibility and remaining-quantity statuses separately.
- Supply your authorised complete XSD package if you need the structural layer to execute.
A passing independent result is only a local partial preflight. Our own test subset demonstrates an XSD rejection for an invalid date at line 7, but is not the official OASIS schema. Without an authorised supplied package, the XSD result explicitly remains not executed.
Primary basis and limits
OASIS UBL 2.1 and the DespatchAdvice root schema provide the structural basis. BIS Despatch Advice 3.1 documents the exchange context. Sources were rechecked on 6 November 2026. Checks, examples and explanations here are independently written; no official rule implementation is included.
OASIS notices are retained. Complete import-chain rights must also be established: ETSI signature-import distribution rights remain unresolved here, so no official schema pack is bundled. Local BYO requires concrete per-artifact processing rights and notices; public access is not permission. Official BIS rules remain a separate rights and engine decision. Nothing in this result proves physical delivery, stock, receipt, party registration, network acceptance or legal approval.
Recheck the logistics export
UBL Despatch Advice validator · Related despatch repair guide · API / CLI scope