MES Production Return → U8 Material Outbound (Red Voucher) Sync: A Field Guide
What This Strategy Solves (Scenario & Value)
Every shift on a shop floor produces "return-to-stock" events: workers over-pulled, used the wrong spec, or reworked a step. MES captures the operational truth; U8 owns the financial and inventory books. In U8, production returns must be posted as red-voucher material-outbound documents, otherwise inventory and cost accounting drift apart. The volume is modest, but the freshness requirement is high — anything delayed past shift-end breaks daily reconciliation. We use Qeasy (轻易云) to push MES return records into U8 as red vouchers, so the books close on the same shift.
Data Flow & Field Mapping
Flow: MES (WebAPI common/search QUERY) → Qeasy middle layer (filter, transform, map) → U8 (WebAPI CLCKDAdd EXECUTE red voucher).
| Business meaning | MES source | Qeasy middle | U8 target |
|---|---|---|---|
| Document date | createTime | pass-through | dDate |
| MES return number | confrimNo | used as U8 doc number | cCode |
| Red/blue flag | businessType="return" | coerce to boolean | bIsRedVouch = true |
| Document type | business param | mapping dict | AddType |
| Auto-approve | strategy param | default true | AutoAudit |
| Linked PO number | business field | pass-through (nullable) | cOrderCode |
| Item/qty/batch | body rows | line transform | child table fields |
The red flag is not cosmetic — it is the core of U8's posting direction. Default AutoAudit on, but during gray release keep it off for one week of manual checks.
How to Configure in Qeasy
- Source metadata: WebAPI POST, paginated,
pageSize=100, scope bywsId,queryKeyidentifies the business type (return). - Target metadata: WebAPI POST to
CLCKDAdd, header plus body array in one call. - Centralized code mapping: items, units, warehouses, and transaction classes are cross-system masters — keep them in Qeasy's mapping center so every strategy shares one source of truth. Especially separate the red-voucher transaction class from the normal outbound class.
- Header before body, in stages: return documents usually have multiple lines. Get the header right first, then add body rows. Capture U8's returned internal ID for each line so you can trace back later.
- Incremental + full both ways: daily incremental by
lastModifiedTime; first go-live or after incidents, switch to full re-run (source pulled by time window).
Implementation Steps
- Phase 1: environment & credentials. Register both platforms in the on-prem Qeasy environment, confirm the U8 account has
CLCKDAddpermission, and add IPs to the whitelist. - Phase 2: mapping & trial run. Push 3–5 real return records through Qeasy's "trial run", then check the red voucher number, direction, and inventory impact in U8.
- Phase 3: gray scheduling. Keep auto-approve off; run at 7–15 minute intervals (source
*/7 7-22 * * *, target2-59/7 7-22 * * *, offset to avoid peak overlap) for one week. - Phase 4: turn on auto-approve and go live. Once finance confirms, flip
AutoAudittotrueand move to production schedule. - Phase 5: monitoring & reconciliation. Watch success rate and error distribution on the Qeasy dashboard. Before daily close, reconcile the count and amount against U8's material-outbound (red) summary.
Pitfall Recap
- Forgot the red flag.
bIsRedVouchomitted or sent as the string"true"instead of a boolean — U8 treats it as a blue voucher and inventory goes the wrong way. Force-coerce to boolean in Qeasy's field transform. - Duplicate document number. Reusing the MES return number as U8
cCodecollides with manually keyed vouchers. Add a "U8-side dedup" check in Qeasy and prefix on collision. - Auto-approve too early. Turning
AutoAudit=truefrom day one means errors are already booked; cleanup is expensive. The pragmatic path is manual review for one week, then enable. - Body quantity direction. Returns are "negative consumption" — quantity stays positive in the source, and stays positive in U8 red-voucher body (the red flag handles direction). Passing a negative number is rejected by U8.
- Cross-shift gaps. The 7–22 schedule covers day shift; night-shift returns get missed the next day because
createTimecrosses midnight. Either widen the source window by 1–2 hours or switch the cursor tolastModifiedTime.
When to Use, When Not To
Use when: a discrete manufacturer runs MES and U8 side by side, has frequent production returns (a few to a few dozen per day), and needs the inventory book to reflect them the same shift. Do not use when: the whole process lives in a single system, or returns require a multi-level approval workflow that MES does not record as an operational fact — in that case, the approval is better initiated on the U8 side.