# `Sp_Sis_GetMaxNo_1` (procedure)

> 最大单据号


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sBillType` | `varchar(100)` |
| 2 | OUT | `sReturn` | `varchar(100)` |
| 3 | IN | `sFormGuid` | `varchar(100)` |
| 4 | IN | `sSaleManGuid` | `varchar(100)` |
| 5 | IN | `sCustomerGuid` | `varchar(100)` |
| 6 | IN | `sClassNo` | `longtext` |
| 7 | IN | `sBrId` | `varchar(100)` |
| 8 | IN | `sSuId` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** Backup variant of [`Sp_Sis_GetMaxNo`](Sp_Sis_GetMaxNo.md) — same 8-arg signature, near-identical body (header `declares` and prefix builders match line-for-line). The `_1` suffix marks a snapshot kept around the time of a behaviour change; per wiki convention, `_N` backup objects are not narrated as live code.

**What it does:** Same as `Sp_Sis_GetMaxNo` at the time of copy — bill-number factory keyed by `SysBillNoSettings` template, time/salesman/customer prefix, table-side `MAX(...) + 1` sequence, zero-padded to `iBillNoLength`.

**Invocation:** Not referenced in `gdsmodule`, no form-master binding, no other DB routine calls it, no xly-src reference. Status: appears orphaned — not expected to be called from production. Verify against the live `Sp_Sis_GetMaxNo` before relying on it.
