Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

m18-item-type-mapping.md 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!-- AUTO-GENERATED by scripts/generate_m18_mapping_docs.py — do not edit by hand -->
  2. # M18 `udfProducttype` → MTMS `items.type`
  3. _Generated: 2026-08-01 10:01 UTC_
  4. **Source of truth**
  5. - Enums: `NewItemRequest.kt` → `ItemType`, `M18ItemType`
  6. - Sync: `M18MasterDataService.saveProduct` / `saveProducts` (`when (pro.udfProducttype)`)
  7. - UI labels (inventory): `FPSMS-frontend/src/i18n/zh/inventory.json`
  8. ## Sync mapping
  9. | M18 `udfProducttype` (exact string) | `M18ItemType` | MTMS `items.type` | `ItemType` | Inventory UI (zh) |
  10. |---|---|---|---|---|
  11. | `Consumable Material` | `CONSUMABLES` | `consumables` | `CONSUMABLES` | 消耗品 |
  12. | `Non-consumable Material` | `NONCONSUMABLES` | `non-consumables` | `NONCONSUMABLES` | 非消耗品 |
  13. | `Product` | `FG` | `fg` | `FG` | 成品 |
  14. | `WIP` | `SFG` | `sfg` | `SFG` | 半成品 |
  15. | `Item` | `ITEM` | `item` | `ITEM` | 貨品 |
  16. | *(any other value / empty)* | — | `mat` | `MATERIAL` | 原料 |
  17. ## Enum inventories
  18. ### `M18ItemType`
  19. | Constant | String value | Used in sync `when`? |
  20. |---|---|---|
  21. | `CONSUMABLES` | `Consumable Material` | yes |
  22. | `NONCONSUMABLES` | `Non-consumable Material` | yes |
  23. | `FG` | `Product` | yes |
  24. | `SFG` | `WIP` | yes |
  25. | `ITEM` | `Item` | yes |
  26. ### `ItemType` (MTMS stored values)
  27. | Constant | `items.type` | Inventory UI (zh) |
  28. |---|---|---|
  29. | `MATERIAL` | `mat` | 原料 |
  30. | `CONSUMABLES` | `consumables` | 消耗品 |
  31. | `NONCONSUMABLES` | `non-consumables` | 非消耗品 |
  32. | `FG` | `fg` | 成品 |
  33. | `SFG` | `sfg` | 半成品 |
  34. | `ITEM` | `item` | 貨品 |
  35. ## Known gaps (not auto-mapped)
  36. | M18 value seen | Effect | Notes |
  37. |---|---|---|
  38. | `CMB` | → `mat` (else) | Seen on M18 pro.udfProducttype (e.g. MG1852). Falls through to mat. |
  39. Frontend Settings → Items edit also offers `cmb` / `wip` / `nm` as local types;
  40. those are **not** written by the current M18 `udfProducttype` mapper.
  41. ## Regenerate
  42. ```bash
  43. python scripts/generate_m18_mapping_docs.py
  44. ```