# `Fun_GetknifeReportQty` (function)


- **Type:** FUNCTION
- **Returns:** `decimal(18,6)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sKnifeMouldGuid` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** Knife-mould (刀模) actual-output companion to `Fun_GetknifeProcessQty`. Where the sibling sums planned quantity, this one sums actually-reported production (`dProductionReportQty`) for a given die across active work-orders — used to judge real wear versus planned wear.

**What it does:** scans `mftworkorderprocess A INNER JOIN mftworkordermaster C ON A.sParentId = C.sId` where `A.sKnifeMouldId = sKnifeMouldGuid`, `C.bInvalid = 0`, `C.bCheck = 1`, and returns `SUM(IFNULL(A.dProductionReportQty,0))` (defaulting to `0`).

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit.
