# `Sp_SalSalesOrder_CheckUpdate` (procedure) > 销售订单保存插入工艺卡 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sGuid` | `varchar(100)` | | 2 | IN | `sFormGuid` | `varchar(100)` | | 3 | IN | `sLoginId` | `varchar(100)` | | 4 | IN | `sBrId` | `varchar(100)` | | 5 | IN | `sSuId` | `varchar(100)` | | 6 | IN | `iFlag` | `int` | | 7 | OUT | `sCode` | `int` | | 8 | OUT | `sReturn` | `varchar(4000)` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_SalSalesOrder_CheckUpdate`'`._ ## Narrative **Business context:** 销售管理 → 销售订单 — 销售订单保存插入工艺卡: on order-save (`iFlag=1`) or order-uncheck/withdraw (`iFlag=0`), refreshes the order's 工艺卡 control rows (`salsalesordercontrol` / `salsalesordercontrolcombine`). The control rows are the per-product process-card snapshot that downstream 生产 modules consume when scheduling work orders, so this proc keeps them in sync with whatever the user just edited on the order's slave grid. **What it does:** Sets `tNextDate = tCreateDate` on the master if NULL; reads `sCustomerId` / `tAppointDate` from `salsalesordermaster`; validates that every slave line has a non-zero unit price and the master has a non-zero total (returns localised `产品【…】单价为0,请核实确认!` / `产品总金额不能为0!` via `sCode=-1` when not). On `iFlag=1`, stages a `salsalesordercontrol_tmp` from `salsalesorderslave`, applies the diff into `salsalesordercontrol` and the combine bridge `salsalesordercontrolcombine`. On `iFlag=0`, removes the matching control rows so the order can be edited again. **Invocation:** No live `gdsmodule.sSaveProName` / `sProcName` hook references this proc and no other routine calls it; the page heading 销售订单保存插入工艺卡 is preserved, and an install script ships at `script/标版/30100101/Sp_SalSalesOrder_CheckUpdate.sql`. Status: appears orphaned in this tenant — likely wired in by customer-specific gdsmodule patches that aren't applied here. Candidate for maintainer audit.