USP_DATALIST_SALESORDER_RESERVEDITEM

Lists all reserved items belonging to a sales order.

Parameters

Parameter Parameter Type Mode Description
@SALESORDERID uniqueidentifier IN Input parameter indicating the context ID for the data list.
@SALESORDERITEMID uniqueidentifier IN Sales Order Item ID
@ISEXPIRED bit IN Is Expired

Definition

Copy


            CREATE procedure dbo.USP_DATALIST_SALESORDER_RESERVEDITEM
            (
                @SALESORDERID uniqueidentifier = null
        , @SALESORDERITEMID uniqueidentifier = null
        , @ISEXPIRED bit = 1
            )
            as
                set nocount on;

                select
                    [ID]
        , [SALESORDERID]
        , [SECONDSUNTILEXPIRATION]
        , [DATEADDED]
        , [EXPIRATIONDATE]
                from dbo.[SALESORDERRESERVEDITEM]
                where (@SALESORDERID is null or [SALESORDERID] = @SALESORDERID)
          and (@SALESORDERITEMID is null or [ID] = @SALESORDERITEMID)
          and ((@ISEXPIRED = 1 and EXPIRATIONDATE <= current_timestamp) or (@ISEXPIRED = 0 and EXPIRATIONDATE > current_timestamp))