pipekit/config/modules/iv00102.sql
Paul Trowbridge dd9f89f4b5 feat: version-control pipeline definitions via export/apply
Add `pipekit export` / `pipekit apply` (pipekit/config_io.py) to serialise the
DB's config — drivers, connections, modules (+ columns, watermarks, hooks),
groups, schedules — to a git-trackable text tree under config/, and rehydrate
it. SQLite stays runtime state; definitions become diffable/reviewable/
revertible.

- config only: run_log/group_run/settings and per-run state columns excluded
- name-keyed refs (portable across databases); source_query in .sql sidecars;
  columns as real JSON arrays for line-by-line diffs
- newline-normalised so CRLF-vs-LF is never a spurious change
- apply is create/update by name; child collections fully synced; top-level
  deletes gated behind --prune; --dry-run prints the plan
- round-trip is identity (export -> apply --dry-run == nothing to do)

Commits the current config/ as the first baseline, capturing the freshly
populated columns_json for rm00101/rm00301/iv00101. Documented in SPEC.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 10:56:55 -04:00

84 lines
2.5 KiB
Transact-SQL

SELECT
ITEMNMBR AS itemnmbr,
LOCNCODE AS locncode,
BINNMBR AS binnmbr,
RCRDTYPE AS rcrdtype,
PRIMVNDR AS primvndr,
ITMFRFLG AS itmfrflg,
BGNGQTY AS bgngqty,
LSORDQTY AS lsordqty,
LRCPTQTY AS lrcptqty,
LSTORDDT AS lstorddt,
LSORDVND AS lsordvnd,
LSRCPTDT AS lsrcptdt,
QTYRQSTN AS qtyrqstn,
QTYONORD AS qtyonord,
QTYBKORD AS qtybkord,
QTY_Drop_Shipped AS qty_drop_shipped,
QTYINUSE AS qtyinuse,
QTYINSVC AS qtyinsvc,
QTYRTRND AS qtyrtrnd,
QTYDMGED AS qtydmged,
QTYONHND AS qtyonhnd,
ATYALLOC AS atyalloc,
QTYCOMTD AS qtycomtd,
QTYSOLD AS qtysold,
NXTCNTDT AS nxtcntdt,
NXTCNTTM AS nxtcnttm,
LSTCNTDT AS lstcntdt,
LSTCNTTM AS lstcnttm,
STCKCNTINTRVL AS stckcntintrvl,
Landed_Cost_Group_ID AS landed_cost_group_id,
BUYERID AS buyerid,
PLANNERID AS plannerid,
ORDERPOLICY AS orderpolicy,
FXDORDRQTY AS fxdordrqty,
ORDRPNTQTY AS ordrpntqty,
NMBROFDYS AS nmbrofdys,
MNMMORDRQTY AS mnmmordrqty,
MXMMORDRQTY AS mxmmordrqty,
ORDERMULTIPLE AS ordermultiple,
REPLENISHMENTMETHOD AS replenishmentmethod,
SHRINKAGEFACTOR AS shrinkagefactor,
PRCHSNGLDTM AS prchsngldtm,
MNFCTRNGFXDLDTM AS mnfctrngfxdldtm,
MNFCTRNGVRBLLDTM AS mnfctrngvrblldtm,
STAGINGLDTME AS stagingldtme,
PLNNNGTMFNCDYS AS plnnngtmfncdys,
DMNDTMFNCPRDS AS dmndtmfncprds,
INCLDDINPLNNNG AS inclddinplnnng,
CALCULATEATP AS calculateatp,
AUTOCHKATP AS autochkatp,
PLNFNLPAB AS plnfnlpab,
FRCSTCNSMPTNPRD AS frcstcnsmptnprd,
ORDRUPTOLVL AS ordruptolvl,
SFTYSTCKQTY AS sftystckqty,
REORDERVARIANCE AS reordervariance,
PORECEIPTBIN AS poreceiptbin,
PORETRNBIN AS poretrnbin,
SOFULFILLMENTBIN AS sofulfillmentbin,
SORETURNBIN AS soreturnbin,
BOMRCPTBIN AS bomrcptbin,
MATERIALISSUEBIN AS materialissuebin,
MORECEIPTBIN AS moreceiptbin,
REPAIRISSUESBIN AS repairissuesbin,
ReplenishmentLevel AS replenishmentlevel,
POPOrderMethod AS popordermethod,
MasterLocationCode AS masterlocationcode,
POPVendorSelection AS popvendorselection,
POPPricingSelection AS poppricingselection,
PurchasePrice AS purchaseprice,
IncludeAllocations AS includeallocations,
IncludeBackorders AS includebackorders,
IncludeRequisitions AS includerequisitions,
PICKTICKETITEMOPT AS pickticketitemopt,
INCLDMRPMOVEIN AS incldmrpmovein,
INCLDMRPMOVEOUT AS incldmrpmoveout,
INCLDMRPCANCEL AS incldmrpcancel,
Move_Out_Fence AS move_out_fence,
INACTIVE AS inactive,
DEX_ROW_ID AS dex_row_id
FROM [GPSERVER].[CHG].[dbo].[IV00102]
WHERE QTYONHND <> 0