# `Sp_interface_del_udfvoucher_before` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProData` | `longtext` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sCode` | `int` |
| 6 | OUT | `sReturn` | `longtext` |
| 7 | OUT | `sHeader` | `longtext` |
| 8 | OUT | `sParam` | `longtext` |

## Body

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

## Narrative

**Business context:** Kingdee K3 Cloud integration before-hook for **delete-voucher** push. Mirrors a local 财务凭证 deletion (`udfvouchermaster`) over to the remote K3 Cloud `DynamicFormService.Delete` REST endpoint by assembling the request URL, headers, and JSON payload for the HTTP POST.

**What it does:** Parses `sProData` JSON to extract `FBillNo`/`sId` and any voucher-type/date fields. Sets OUT `sHttpUrl` to the K3 Cloud `DynamicFormService.Delete.common.kdsvc` endpoint (commented hostnames in the body reference `ser2019-yxk/K3Cloud`). Returns the JSON delete payload via OUT `sParam` and an empty `sHeader`. Errors out with `sCode=-1` if `sProData` is empty/invalid.

**Invocation:** Wired into the JD/Kingdee interface flow as the delete-side counterpart of `Sp_interface_udfvoucher_before` (save-side). Dispatcher pattern matches `JdInterfaceServiceImpl.JDUDFVOUCHER()` in `xly-src/xlyInterface/`: the interface service calls `procedureService.getCallPro()` to populate the URL/header/body, performs the HTTP DELETE/POST with `HttpsRequestUtil.doRequestHttpResponseCookies()`, then invokes the `_after` hook with the response. No grep hit in xly-src for this specific delete pair — likely an unactivated or admin-only path; the save pair (`_udfvoucher_before/_after`) is the one wired into `JdInterfaceServiceImpl`.
