Sp_BtnEventCalculatewages (procedure)
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sProInParam |
longtext |
| 2 | IN | sMakePerson |
varchar(100) |
| 3 | IN | sBrId |
varchar(100) |
| 4 | IN | sSuId |
varchar(100) |
| 5 | OUT | sReturn |
varchar(1000) |
| 6 | OUT | sCode |
int |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpBtnEventCalculatewages'._
Narrative
Business context: 工人计件工资 — toolbar handler that 确认 a 生产报工 slave line (mftproductionreportslave) and computes its piece-wage payout. Verifies the master is already audited (bCheck=1) and that the user supervises the slave's machine department, then invokes the formula engine Sp_System_ReplaceField against the line's sWageId formula to produce dAllMoney and per-employee dWageMoney.
What it does: Parses $.params[*].value[*] with sId, dProcessQty, dHour, dAdjustableHour, sParams. Gates: master bCheck=1 else returns sUpDataNotReview; user's eleemployee.sDepartId must match the slave's elemachine.sDeptId else returns sCantConfirmOtherDepart. Updates the slave with the supplied/fallback quantities, marks bAffirm=1, sAffirm, tAffirmDate, computes dEmpHour=(dHour+dAdjustableHour)*Σ(mftproductionreportemployee.dEmpNum), then dTimeHourMoney/dTimeMoney from sisworkcenter.dAverageHourSalary. Branches on sPayrollCalculate ('0' = slave-level formula → distribute by dProportion; '1'/'2' = per-employee formula via cursor, then aggregate to slave).
Invocation: Dispatched dynamically by GenericProcedureCallServiceImpl.doGenericProcedureCall() (POST /procedureCall/doGenericProcedureCall) — 工人计件工资 grid's 确认 toolbar button names this proc as its action. Internally calls Sp_System_ReplaceField (formula resolver). Variant: Sp_BtnEventCalculatewages_financial (财务确认 — same logic, different department-mismatch message sSupervisorDepartNotMatch).