Sp_Check_sDgn (procedure)
送货通知单单据保存之前数据校验
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sTableName |
varchar(100) |
| 2 | IN | sGuid |
varchar(100) |
| 3 | IN | sFormGuid |
varchar(100) |
| 4 | IN | sLoginId |
varchar(100) |
| 5 | IN | sBrId |
varchar(100) |
| 6 | IN | sSuId |
varchar(100) |
| 7 | IN | iFlag |
int |
| 8 | OUT | sCode |
int |
| 9 | OUT | sReturn |
varchar(4000) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpCheck_sDgn'._
Narrative
Business context: 销售管理 → 销售送货流程 → 送货通知单 (saldelivernotifymaster/slave) — post-save validator and money/qty back-calculator on the 送货通知单 form. Also serves 材料送货通知单单据 (101251240115016140461755160) which shares the same table.
What it does: Initial guard: if any slave with dProductQty>0 OR dGiveQty>0 has bRemainderScrap=1, aborts with sCantChooseBfck ("正数和备品数不为0时,不能勾选余数报废出库选项"). Reads NetMoney/NetPrice precision from SysSystemSettings. Cursors every just-saved saldelivernotifyslave row, joins salsalesorderslave (the originating sales-order line), and re-derives dProductMoney/dProductPrice/dProductNoTaxMoney/dProductTaxMoney/dProductForeignMoney/dProductTaxForeignMoney/dNProductPrice/dProofingMoney/dPlateMoney/dKnifeMouldMoney using the order's dCurrencyRate and sistax.dRate (forward/reverse calc by bInverse).
Invocation: Bound to gdsmodule.sSaveProName on 送货通知单单据 (15833158840002862255575040533000) and 材料送货通知单单据 (101251240115016140461755160) — both under 销售管理 → 销售送货流程. Dispatched by BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName") after the save batch commits. Pre-save peer is Sp_beforeSave_sDgn; audit handler is Sp_Calc_sDgn. xly-src ships script/标版/30100101/Sp_Check_sDgn.sql as the install body.