﻿USE [FabApprovalSystem]
GO
	/****** Object:  StoredProcedure [dbo].[UpdateLotDisposition]    Script Date: 11/21/2024 11:29:05 AM ******/
SET
	ANSI_NULLS ON
GO
SET
	QUOTED_IDENTIFIER ON
GO
	-- =============================================
	-- Author:		<Author,,Name>
	-- Create date: <Create Date,,>
	-- Description:	<Description,,>
	-- =============================================
	CREATE PROCEDURE [dbo].[UpdateLotDisposition] @IssueID INT,
	@IssueDescription VARCHAR(2000),
	@Title NVARCHAR(50),
	@PERequired BIT,
	@MRBRequired BIT,
	@DispositionByOCAP BIT,
	@CANo INT,
	@ResponsibilityID INT,
	@IssueDate DATETIME,
	--@OriginatorID INT, 
	@ReasonForDisposition VARCHAR(MAX),
	@ResponsibilityIssueID INT,
	@SPNScrapCode VARCHAR(25) --@CurrentStep INT
	AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
SET
	NOCOUNT ON;

UPDATE
	LotDisposition
SET
	IssueDescription = @IssueDescription,
	Title = @Title,
	PERequired = @PERequired,
	MRBRequired = @MRBRequired,
	DispositionByOCAP = @DispositionByOCAP,
	CANo = @CANo,
	ResponsibilityID = @ResponsibilityID,
	--IssueDate = @IssueDate, 
	--OriginatorID  = @OriginatorID, 
	ReasonForDisposition = @ReasonForDisposition,
	ResponsibilityIssueID = @ResponsibilityIssueID,
	SPNScrapCode = @SPNScrapCode,
	--CurrentStep = @CurrentStep
	LastUpdateDate = GETDATE()
WHERE
	IssueID = @IssueID
END
GO