Change Seat Status - Undo Attended Tickets?

So our NSCAN has the annoying defect where it won't let us easily change our attendance numbers on the scanner. After clicking it a whole bunch of times I was able to change the first set of tickets in this group, but no matter what I did I couldn't change the second set (for school tours, their tour and their studio project are billed as two separate performances with two separate line items). So currently it looks like 29 students did the art project, but only 25 went on the tour. 

I need to un-attend those 4 kids to have the project match the tour. Is there an easy way of doing this? 

Parents
  • I wrote a procedure to do this:

    ALTER PROCEDURE [dbo].[LP_MARK_AS_UNATTENDED](@sli_no INT = NULL)
    AS
    BEGIN
        IF( @sli_no IS NOT NULL )
        BEGIN
            DECLARE @order_no INT = (SELECT order_no FROM dbo.T_SUB_LINEITEM WHERE sli_no = @sli_no)

            DELETE FROM dbo.T_ORDER_SEAT_HIST WHERE order_no = @order_no AND sli_no = @sli_no AND event_code = 22
            DELETE FROM dbo.t_nscan_event_control WHERE sli_no = @sli_no
            UPDATE tx_perf_seat SET available_ind = 1 WHERE order_no = @order_no AND sli_no = @sli_no
        END
    END

Reply
  • I wrote a procedure to do this:

    ALTER PROCEDURE [dbo].[LP_MARK_AS_UNATTENDED](@sli_no INT = NULL)
    AS
    BEGIN
        IF( @sli_no IS NOT NULL )
        BEGIN
            DECLARE @order_no INT = (SELECT order_no FROM dbo.T_SUB_LINEITEM WHERE sli_no = @sli_no)

            DELETE FROM dbo.T_ORDER_SEAT_HIST WHERE order_no = @order_no AND sli_no = @sli_no AND event_code = 22
            DELETE FROM dbo.t_nscan_event_control WHERE sli_no = @sli_no
            UPDATE tx_perf_seat SET available_ind = 1 WHERE order_no = @order_no AND sli_no = @sli_no
        END
    END

Children