跳至主要內容

生产订单:生产订单字段必填

五六零网校小于 1 分钟

注意

限制生产订单抬头的销售订单、实际开始日期、实际完工日期、供应商(委外)等字段必填

代码示例

--生产订单:产订单抬头的销售订单、实际开始日期、实际完工日期、供应商(委外)等字段必填
IF @object_type = '202'
	BEGIN
		IF @transaction_type = 'A'
		OR @transaction_type = 'U'
			BEGIN
				IF EXISTS (
					SELECT T0.[OriginNum]
					FROM OWOR T0
					WHERE T0.Status = 'R'
						AND T0.[OriginNum] IS NULL
						AND T0.DocEntry = @list_of_cols_val_tab_del
				)
					BEGIN
						SET @error = 20201;
						SET @error_message = N'生产订单抬头的销售订单字段不能为空!!!';
					END;
				BEGIN
					IF EXISTS (
						SELECT T0.[U_VendorCode]
						FROM OWOR T0
						WHERE T0.[Status] = 'R'
							AND T0.[U_VendorCode] IS NULL
							AND T0.DocEntry = @list_of_cols_val_tab_del
					)
						BEGIN
							SET @error = 20202;
							SET @error_message = N'生产订单抬头的委外供应商字段不能为空!!!';
						END;
				END;
			END;
	END