# `Sp_BillOfApplyLine` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sBrId` | `varchar(100)` |
| 2 | IN | `sSuId` | `varchar(100)` |
| 3 | IN | `sLoginId` | `varchar(100)` |
| 4 | IN | `bFilter` | `text` |
| 5 | IN | `pageNum` | `int` |
| 6 | IN | `pageSize` | `int` |
| 7 | IN | `sUnTaskFormId` | `varchar(100)` |
| 8 | OUT | `totalCount` | `int` |
| 9 | IN | `countCloumn` | `varchar(5000)` |
| 10 | OUT | `countMapJson` | `longtext` |
| 11 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 12 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 13 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产执行 / 现场物料管理 — line-side variant of `Sp_BillOfApply` (body header comment `-- 线边仓物料`, "line-side warehouse materials"). Builds the same "by-work-order materials-application" pickup list, but scoped to line-side / 线边仓 inventory instead of the main warehouse.

**What it does:** Same paged-list shape as `Sp_BillOfApply`: joins `eleproduct`, `EleMaterials` / `elematerialsstock`, `elecustomer`, `siswarehouse`, `MftWorkOrderControl` and resolves auxiliary-unit sums from `SysSystemSettings`, materialising the page into `P_Tmp_List`. The differentiator is the filter clause that restricts `siswarehouse` rows to line-side ones.

**Invocation:** Status: appears orphaned. No caller in any channel (form-master, gdsmodule, other DB routines, xly-src grep across all extensions). Likely an unwired variant intended for a separate 线边仓 form that was never published, or superseded by `Sp_BillOfApply` plus a runtime warehouse filter. Candidate for maintainer audit.
