Samba crashes when trying to settle open tickets

When I could not delete some customer accounts (which were created for saving unpaid orders), I renamed those accounts to other names. (After reading several threads, I now know that I shouldn’t have done that. Doh!)

Now, Samba crashes when I try to settle those unpaid tickets. I think those tickets were tied to those customer accounts. I have no idea what to do now. I can’t close the work session with open tickets.

Here is the crash message:

“Exception has been thrown by the target of an invocation.”


[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: CE
Machine: BB-PC
User: BB
Date: 4/26/2015
Time: 6:03 PM

User Explanation:

BB said “”

[Exception Info 1]

Top-level Exception
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Delegate.DynamicInvokeImpl(Object args)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at Samba.Presentation.App.Main()

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.Modules.PosModule.PosViewModel.CloseTicket()
at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(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)


[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.6.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.6.0
PresentationCore, Version=4.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
EntityFramework, Version=4.4.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1


[System Info]

Operating System
-Microsoft Windows 7 Ultimate
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = -300
–FreePhysicalMemory = 1491952
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 6.1.7600

Machine
-BB-PC
–Manufacturer = Dell Inc.
–Model = Latitude XT2
–TotalPhysicalMemory = 3103682560
–UserName = BB-PC\BB


Please help. I’m not sure what to do next. I have the .SDF file zipped and ready for anyone to take a look.

Is this on a production machine?
If you think changing the name has caused have you tried renaming them back to what they were then closing the ticket?
Is crash when ticket opens or on close?

2 Likes

I only have one machine (so I guess it is the production machine).
Before replying, I tried to renaming the customer’s account name back, but no luck.
Ticket crashes on close.

@aznwonderboy What shows for entity on the ticket when open, the new name or the old one?

By production I mean is it active in working environment?

Try selecting a different entity when the ticket is open to refresh the entity listed in database for that ticket.

Presume other tickets can open and close ok?

Let me give you a bit more background:

From the main screen, I click on Manage–>Entities—>Entities, the Entity List has 11 “Customers” named as followed: 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9, 10. None of these customers have any other information. I have tried to delete these customers, but they were tied to a ticket so I didn’t want to mess with them anymore.

From the main screen, I click on Tickets–>(view Open Tickets)–> it shows a customer named: “Lost Hermanos”. I click on this customer, which shows 1 unpaid item. Then I click on DISPLAY to open this ticket, click SETTLE, and try to pay. That’s when the error shows up.

Other new tickets are okay.

Yes, this machine is in an active working environment.

If you do a new ticket to an entity does that work ok?

Have you tried changing the customer? Ie if the entity name is ‘out of date’ as been changed in management it would ‘update’
Open the ticket click select customer again and search for different one and select that.

When I open up the unpaid ticket (from customer “Lost Hermanos”), there is NO “Select Customer” button. Even when I try to close this ticket (without settling), the crash occurs.

If I create a new order, save the unpaid order to a new customer, then re-open that customer’s ticket, then everything works fine. There is a “Select Customer” button with this new customer.

:-/ hmmm if it was an sql install I would have a go at fixed directly in table but not sure how/if this can be done on compact edition.

There is no select customer button on that ticket?
What’s the mapping like for the customer entity screen? Screenshot?

Screen shot of NO Select Customer button for this problem ticket:

Mapping for Customer entity screen:

Screenshot of a new ticket WITH Select Customer button.

Hmmmm, you may need to wait for more experienced help from @Jesse or @QMcKay.

Just to clarify, that entity allocated to the problem ticket, is it in your entity list?

I changed it to question this is a configuration error and not a real SambaPOS issue. It seems you changed or deleted the entity type for that entity. It was assigned to that ticket type originally. You need to remake and reassign that entity type to that ticket type. I am out of town today but when I get home I can look deeper.

Did you rename or delete any Entity Types?

Please look here for when and how to use the Issue category:

1 Like

Thank you for your help, @JTRTech.

No, the entity allocated to the problem ticket is NOT in the entity list.

The problem is that I did mess with Entity Type, but I don’t even remember what it was. I hoped that was just a small issue that I overlooked. It looks like I might have to dig deep.

Under ticket type you need to reassign the original entity type that entity belonged too.

You probably renamed it and it needs to be relinked to the ticket type

The ticket’s Entity Type is blank (nothing is written in that box). I don’t know how to re-assign it to another ticket type.

Can you pm me a copy of your database?

3 Likes

PM sent. Thank you for taking a look at it.

1 Like

I am going to recommend you stop using CE and try either LocalDB SQL Express or install SQL Express 2014 and convert your database to SQL. CE is limited and frankly slower and underpowered compared to SQL.

PS. I am still looking. It is because of the Entity but I am converting your database to SQL so I can look at it in MSSMS to see whats going on.

Great tutorial for converting it to SQL express 2014

Scroll down in the tutorial for instructions on converting the SDF file.

1 Like

Well apparently you changed the Entity to ... it was originally Lost Hermanos… changing it back did not fix it so there is more links missing I am still looking.

Ok its the Entity Type ID is not matching you must have deleted the Entity Type or did something to it. It originally was 1 now its 5. But that Ticket the entity assigned still thinks the Type is 1. I am looking how to fix it.

Essentially you messed up the database relation for that Entity to the Entity Type.

Kinda strange dont think ive seen this before. I wasnt even sure it was possible lol.

Throwing out a guess here, but you cannot delete an Entity nor an Account if it has been used in a Ticket Transaction. SambaPOS prevents you from doing this. If you manually deleted something from the DB using a query, then I could see how this issue would arise.

Also, renaming an Entity or Account (or pretty much anything for that matter) should have almost no effect, since the Transactions are based on IDs, not names.

Did you delete a Document Type?

Well he definitely renamed the Entity to ... How it let him do that with a ticket assigned I have no clue.

Although It looks like it will let you do that…

There are no documents linked its not paid yet…