Deleted old menu and tickets with outstanding items

Help!

I have deleted my old menus, tickets, entity screens with open items on them and now I can’t close the work period. When I search for tickets it can’t find any. Is there a solution to this?

Thanks

Nick

How you’ve deleted old tickets?

no just menu, ticket type etc

It will be great if you can explain us what you’ve deleted exactly, how you’ve deleted them and what happens (details of error message if you see any) when you want to close the work period.

You shouldn’t be able to delete a ticket type that used by tickets.

First I will explain that I exported the database to a standalone system so that I could configure the whole system including the menu and recipes from home with the view to importing it back into V5 when it was complete.

I have been testing items similar to the questions I have recently posted.

Now that my menu is complete I have no need for the old menu. So decided to delete it.

This was done by deleting the following things.

Entity Screen related to old menu
Ticket type called “dinner”
Menu called “evening menu”
Department called “Restaurant”

However, I had 17 open tickets which weren’t even placed on this menu they were on the new menu called combined.

Hope this helps

Inner Exception 1
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Presentation.Services
Stack Trace: at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.MoveOrders(Ticket ticket, Order[] selectedOrders, Int32 targetTicketId, Int32 targetTicketTypeId)
at Samba.Modules.PosModule.PosViewModel.OnTicketEventReceived(EventParameters1 obj) at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.b__0(Object[] arguments)
at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

This would appear to be the error in that the ticket type no longer exists

I am also perplexed that you were able to delete the Ticket Type (or Entities for that matter) with Tickets assigned to it.

Did you run the Clear Transactions operation/script so that you were allowed to make these deletions?

Did you try Ticket Explorer?

Set date filter to a large span.
Select All Tickets
Click Refresh

Have done this and it gives the error message that I posted above.

I have not run any script on the system.

Have tried to recreate the tickets and departments and entities but to no avail.

Not too bothered as it is not a live system. Am moving to V5 soon so is there anyway, that I can backup the data that I have changed recently but minus the transactions?

Did you edit the database directly to delete anything?

no it is a standalone version. So not even sure how you can edit the database?

Sure. Just run the Clear Database Transactions task…

:warning: This process is not reversable, short of restoring a full backup.

The task/script clears all Transactional data and values (Sales data - so it will get rid of your “rogue” tickets), but retains the rest of your setup in it’s entirety, such as Products, Menus, Inventory, Automation, Settings, etc. This .

That effectively runs this script:

DELETE FROM [TicketEntities]
GO
DELETE FROM [Tickets]
GO
DELETE FROM [InventoryTransactionDocuments]
GO
DELETE FROM [InventoryTransactions]
GO
DELETE FROM [AccountTransactionDocuments]
GO
DELETE FROM [AccountTransactions]
GO
DELETE FROM [AccountTransactionValues]
GO
DELETE FROM [Calculations]
GO
DELETE FROM [CostItems]
GO
DELETE FROM [Orders]
GO
DELETE FROM [PaidItems]
GO
DELETE FROM [PeriodicConsumptionItems]
GO
DELETE FROM [PeriodicConsumptions]
GO
DELETE FROM [ProductTimerValues]
GO
DELETE FROM [Payments]
GO
DELETE FROM [WarehouseConsumptions]
GO
DELETE FROM [WorkPeriods]
GO
UPDATE [Numerators] SET Number = 0
GO
UPDATE [EntityStateValues] SET EntityStates = '[{"S":"Available","SN":"Status"}]' Where EntityStates like '%Status%'
GO

Ah it’s CE. Stay away from CE version. Just about every time I’ve seen weird stuff not supposed to happen it’s usually because of CE version. Stand alone localdb is best option you can upgrade it to full SQL easily.

1 Like

Since you are just getting started, it would be best to get your system running on SQL LocalDB or SQL Express 2014. You will only regret not switching from CE sooner rather than later.

The script I posted should solve your issue in the interim. But you may need to remove the [brackets]. Use something like SQL Compact Query Analyzer to run the script.

1 Like

Not just getting started. Have been using for more than a year. However, with the release of V5, I copied the local version of the database to my laptop so that I could completely configure it to the way I wanted whilst I am home. Including order tags, recipes in recipes, etc. I was then going to test it locally with all of my receipts before exporting it to V5.

It was just that I did this really stupid thing when I was bleary eyed this morning (pre coffee)

Thanks for all the advice though

One last question, do database tools come included with V5?

Yes all Modules are included with V5 license.

Newer Addon Modules may have a cost, but everything you had to purchase before is now included in V5.