Hi All,
Good day.
I think [dbo].[TP_ORDER_IMPORT_MAIN] has a bug in it.
-- Loop through each ticket and mark as printed
Line 2508 code should be:While @ticket_no < @last_ticket_no
Line 2494-2522
===========================
-- PRINT TICKETS for order if specified for the import setIf @print_tickets_ind = 'Y'BeginSelect @print_count = count(sli_no) From [dbo].T_SUB_LINEITEM Where order_no = @order_no and sli_status = @sli_seated_paid and perf_no > 0
-- Get a batch of ticket numbersExecute @ticket_no = [dbo].AP_Get_NextID_function 'TN', @increment = @print_countSelect @last_ticket_no = @ticket_no + @print_count
Insert Into @print_set (sli_no, ticket_no)Select sli_no,@ticket_no + row_number() over (order by sli_no) - 1From [dbo].T_SUB_LINEITEMWhere order_no = @order_noand sli_status = @sli_seated_paid
-- Loop through each ticket and mark as printedWhile @ticket_no <= @last_ticket_noBeginSelect @sli_no = sli_noFrom @print_setWhere ticket_no = @ticket_no
EXEC [dbo].TP_UPDATE_SLI_WITH_TICKET@sli_no = @sli_no,@new_tkt_no = @ticket_no,@session_id = @ticket_session_no
Select @ticket_no = @ticket_no + 1
EndEnd -- If @print_tickets_ind = 'Y'
=======================
Have fun
Ben
Thank you very much Bob, I have raised a helpdesk ticket.