UFN_RESOURCE_NONPERTICKET_NONCONSUMABLE_QUANTITYVALID

This function validates the resource quantity for non-perticket non-consumable resources

Return

Return Type
int

Parameters

Parameter Parameter Type Mode Description
@RESOURCEID uniqueidentifier IN
@QUANTITY int IN

Definition

Copy


            create function dbo.UFN_RESOURCE_NONPERTICKET_NONCONSUMABLE_QUANTITYVALID(@RESOURCEID uniqueidentifier, @QUANTITY int)
            returns int
            as
            begin
                return (
                    select CASE
                        WHEN ISPERTICKETITEM = 0 and TYPECODE = 0 AND @QUANTITY > QUANTITY THEN 0
                        ELSE 1
                        END
                    from RESOURCE
                    where ID = @RESOURCEID
                )
            end