# `Sp_Quotation__CalcDataPackLastStd_zr` (procedure)


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `bChangeRate` | `int` |
| 3 | IN | `sLoginId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `p_sFormId` | `varchar(100)` |
| 7 | IN | `p_sCorrugateWidth` | `varchar(100)` |
| 8 | IN | `p_sCorrugateLength` | `varchar(100)` |
| 9 | IN | `p_dMinusLength` | `varchar(100)` |
| 10 | IN | `p_dMinusWidth` | `varchar(100)` |
| 11 | IN | `p_sModelsType` | `varchar(100)` |
| 12 | IN | `p_sSlaveGuid` | `varchar(100)` |
| 13 | IN | `p_sCustomerId` | `varchar(100)` |
| 14 | IN | `p_sProductId` | `varchar(100)` |
| 15 | IN | `p_NetPrice` | `varchar(100)` |
| 16 | IN | `p_NetMoney` | `varchar(100)` |
| 17 | OUT | `sCode` | `int` |
| 18 | OUT | `sReturn` | `varchar(5000)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Quotation__CalcDataPackLastStd_zr`'`._

## Narrative

**Business context:** 销售管理 → 报价&估计管理 — variant of `Sp_Quotation__CalcDataPackLastStd` for the packaging-product (包装) quote-cost calculation, with extra `_zr` parameter list adding corrugate-board geometry inputs (`p_sCorrugateWidth`, `p_sCorrugateLength`, `p_dMinusLength`, `p_dMinusWidth`) and pre-computed net-price/net-money carriers. Final-control / last-process step of the pack quote pipeline.

**What it does:** Like its standard sibling: reads the quote master + slave + control + materials + process temp tables (quoquotation*_tmp population is done by `Sp_Quotation_CalcDataPack`), then computes per-control quantities — `dSumProductQty`, `dSumGiveQty`, `dSumStockUpQty`, rate transforms, public-plate flags — and writes back `dProcessOutQty`, `dProcessInQty`, `dAdjustRate` etc. on `QuoQuotationControl_Tmp`/`QuoQuotationMaterials_Tmp`/`QuoQuotationProcess_Tmp` for the last process row. The `_zr` build incorporates the corrugate-board specifics into the size-deduction math (length/width minus values, public-plate sharing).

**Invocation:** Same `gdsmodule.sCalcProName` slot as the rest of the family, but no live module binds this `_zr` name (queried `gdsmodule.sCalcProName='Sp_Quotation__CalcDataPackLastStd_zr'` → empty), no other DB routine references it, and the only xly-src hit is the install script `script/标版/30100101/Sp_Quotation__CalcDataPackLastStd_zr.sql`. Status: appears orphaned — customer-specific (`_zr` likely a customer/initials suffix) variant kept alongside the standard for ad-hoc deployment. Candidate for maintainer audit.
