采购收货单:必须有来源单据
小于 1 分钟
示例代码
--采购收货单:必须有来源单据
IF @object_type = '20'
BEGIN
IF @transaction_type = 'A'
OR @transaction_type = 'U'
BEGIN
IF EXISTS (
SELECT T1.[BaseEntry]
FROM OPDN T0
INNER JOIN PDN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T1.[BaseEntry] IS NULL
AND T0.DocEntry = @list_of_cols_val_tab_del
)
BEGIN
SET @error = 201;
SET @error_message = '采购收货单必须有来源单据于订单';
END;
END;
END