USE [WMSToolBox]
GO
/****** Object: StoredProcedure [dbo].[ops_packageinfomation_set_new] Script Date: 21/06/2017 11:19:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[ops_packageinfomation_set_new]
(
@PackageCode nvarchar(50),
@PackageSystemCode nvarchar(50),
@ProductionReceiveDetailID nvarchar(50),
@PackageQTY float,
@PackageUOM int,
@BaseQTY float,
@BaseUOM int,
@PackakgeConfrimQTY float,
@IsStatusPackage int
--Edit on 30052017
,
@PackageUnit int,
@PackageTot int,
@Remark nvarchar(150),
@CountPackage int
)
AS
IF CURSOR_STATUS('global','TrigTempUpdate')>=-1
BEGIN
INSERT INTO dbo.ops_packageinfomation
( PackageCode,PackageSystemCode,ProductionReceiveDetailID,PackageQTY,PackUomID,BaseQTY,BaseUOM,PackageUnit,PackageTot,Remark,CountPackage
)
VALUES
( @PackageCode,@PackageSystemCode,@ProductionReceiveDetailID,@PackageQTY,@PackageUOM,@BaseQTY,@BaseUOM,@PackageUnit,@PackageTot,@Remark,@CountPackage
)
UPDATE ops_productionreceivedetail
SET PackakgeConfrimQTY=@PackakgeConfrimQTY,
IsStatusPackage=@IsStatusPackage
WHERE ProductionReceiveDetailID=@ProductionReceiveDetailID
DEALLOCATE TrigTempUpdate
END