# `SP_Inventory_Product_Inout_new` (procedure)


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

## Parameters

_No parameters._

## Body

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

## Narrative

**Business context:** 数据修复脚本 — parameterless ad-hoc data-repair procedure, the product-side counterpart of `SP_Inventory_Materials_Inout_new`. Replays `SP_Inventory_ProductCalcQty` over every distinct product/style/warehouse/location combination touched by 产品退货单 (`pitproductrejectmaster` + `pitproductrejectslave`) within a hardcoded window `'2024-12-26'` < `tCreateDate` < `'2024-12-31 09:38:49'`. Looks like a forensic patch run to rebuild product stock totals after the 2024-12 batch of product-return slips.

**What it does:** Counts the impacted reject-slip rows (skipping `bNoObject=1`), opens cursor `Cur_OrderSlave` over them, and per fetch calls `SP_Inventory_ProductCalcQty(...)` with the customer/product/style/warehouse/location/date keys. No parameters, no returns — fire-and-forget.

**Invocation:** Status: appears orphaned. No form binding, no `gdsmodule` hook, no other-routine reference, no `xly-src` reference. The hardcoded December-2024 date range marks this as a one-shot manual repair tool to run by hand; not part of any user flow. Candidate for removal once the repair has been confirmed.
