# `Sp_System_CalcCurrentPeriodCost_20221014` (procedure)

> @author:杨恒林
							@date:20210523 封存
							@describe: 从成本月结表中，拿到工单数据，计算本月成本数据后回写到成本月结表	注意点：
							1.本期期初成本从本工单最近一次月结成本表中获取，不一定就是上期
							2.在制品是指所有入库数小于工单数的工单


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `tStartDate` | `datetime` |
| 2 | IN | `tEndDate` | `datetime` |
| 3 | IN | `sPeriod` | `varchar(100)` |
| 4 | IN | `sProInParam` | `varchar(255)` |
| 5 | IN | `sMakePerson` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | OUT | `sReturn` | `varchar(1000)` |
| 9 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** Backup / snapshot variant of `Sp_System_CalcCurrentPeriodCost` (`_20221014` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)).

**What it does:** Same as `Sp_System_CalcCurrentPeriodCost` at the time of copy.

**Invocation:** Not expected to be called from production code; verify before relying on it.
