Syncing Kingdee Inventory Loss to WMS Consignment Outbound: A Practical Guide with Qeasy
What This Strategy Solves
In a multi-warehouse operation at a retail enterprise, financial inventory losses are first recorded as inventory loss vouchers in the source ERP, while the warehousing side needs to reflect the physical movement as a consignment outbound document at the third-party cloud warehouse. With no bridge between the two systems, the loss figures typically lag 1–2 days behind. We use the Qeasy Data Integration Platform to carry this one-way sync, so that loss events in the source system land on the WMS consignment outbound document with minimal delay.
Data Flow and Field Mapping
The flow is "Source ERP (System B) → Qeasy Middle Layer → WMS Open Platform (System A)." The middle layer is not only responsible for transporting fields but also for code conversion, warehouse mapping, and document status filtering. See the key field mapping table below.
| Business Meaning | Source ERP (Source) | WMS Open Platform (Target) | Handling Notes |
|---|---|---|---|
| Document Number | FBillNo | outer_trade_no | Direct mapping, add prefix to identify source |
| Business Date | FDate | trade_time | Convert to yyyy-MM-dd HH:mm:ss |
| Warehouse | FStockId | warehouse_no | Convert via mapping table |
| Consignment Warehouse ID | Business Org | consign_warehouse | Write cloud warehouse code as fixed value |
| SKU Code | FMaterialId | spec_code | SKU mapping handled in middle layer |
| Quantity | FQty | num | Take absolute value before writing |
| Loss Reason | FReason | remark | Truncate to 200 characters |
| Approval Status | FDocumentStatus | status | Only "Approved" is allowed to pass |
Warehouse and SKU mappings are recommended to be maintained centrally in Qeasy's mapping tables rather than scattered across scripts — this is a common practice among Qeasy customers, known as "centralized code mapping management."
How to Configure on Qeasy
The source side uses the source ERP's standard "inventory loss voucher" interface, fetching data incrementally by modification time; the target side calls the WMS consignment outbound document's open interface, writing to the WMS open platform. Key configuration points:
- Source Interface: Select the inventory loss voucher list, enable "incremental by last modified time," and record the
_update_atstarting point. - Target Interface: Use the consignment outbound document creation interface, enable "idempotency by outer_trade_no" to prevent duplicate documents from reruns.
- Mapping Layer: Place warehouse and SKU mapping tables in the "Data Governance" module so that configuration changes automatically retrigger related tasks.
- Filter Conditions: Filter
FDocumentStatus = 'Approved'at the source to prevent draft documents from triggering warehouse writes. - Failure Handling: Failures enter the retry queue, and alerts are sent to the enterprise messaging platform when thresholds are exceeded — no silent dropping.
Implementation Steps
A phased scheduling approach for a stable rollout:
- Full Initialization: Run a full sync on go-live day to bring historical inventory loss vouchers up to date on the cloud warehouse books. Configure "full trigger" directly in Qeasy, preferably during off-peak hours.
- Incremental Start Point Confirmation: After the full sync completes, set 23:59 of that day as the incremental start point and write it into crontab to avoid overlap with the full sync.
- Scheduling Frequency: Inventory loss vouchers are event-driven and not high-frequency; a 15-minute polling interval is sufficient. If the customer wants more real-time behavior, hook an approval-completion callback on the source side and switch to event-driven mode.
- Reconciliation Patrol: Run a source-target amount reconciliation daily for the first two weeks. Once the loss amounts on both sides match consistently, reduce to a weekly patrol.
- Mapping Table Maintenance SOP: When adding new SKUs or opening new cloud warehouses, register them in the mapping table first before using the new codes, to prevent wild codes from leaking through.
The "dual-track of incremental and full" approach is commonly used by Qeasy customers: full syncs backfill history, incrementals catch up on new data, and the two tracks do not interfere with each other.
Pitfalls and Lessons Learned
- Missing approval-status filter: Inventory loss vouchers go through "Draft → Approved" states in the source ERP. The first version did not filter approval status, which caused draft documents to be pushed through, resulting in extra negatives at the cloud warehouse. The safe practice is to add the
FDocumentStatuscheck at the source — better to push less than to push more. - Sign handling reversed: Inventory losses appear as negatives in the source system, and pushing them directly to the target causes them to be interpreted as return-outbound. This is a common pitfall. The safe practice is to take the absolute value in the mapping layer and write the loss reason into the remark field for traceability.
- Hardcoded warehouse code: In the early days, some customers hardcoded the cloud warehouse code in scripts. When a new warehouse opened, it required code changes, releases, and rollbacks. After centralizing maintenance in Qeasy mapping tables, adding a new warehouse only requires editing one row of configuration.
- Missing idempotency key: The first version did not use
outer_trade_nofor idempotency, and reruns produced duplicate consignment outbound documents. Adding idempotency keys to both the header and the line items is the safe practice. - Time zone and date format: The source ERP returns datetime strings, but the target interface requires plain dates. A typical mistake here is using a direct
substring. The safe practice is to unify the format normalization in the middle layer.
Applicable and Non-Applicable Scenarios
Applicable: The source ERP handles finance/inventory master books, the WMS handles third-party warehouse operations, and inventory loss events need to be reflected on the cloud warehouse books in real time. Non-applicable: Scenarios where inventory loss vouchers require offline approval before being closed — in such cases, triggering should occur after approval is complete, not based on modification-time incrementals. Also not applicable when the cloud warehouse is outside the WMS ecosystem.