Another error while accessing accounts screen


[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: SQ
Machine: CUISINACLIENT
User: Cuisina
Date: 7/23/2015
Time: 8:47 PM

User Explanation:

Cuisina said “”

[Exception Info 1]

Top-level Exception
Type: System.InvalidOperationException
Message: Sequence contains no matching element
Source: System.Core
Stack Trace: at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at Samba.Services.Implementations.CacheService.GetCurrencySymbol(Int32 currencyId)
at Samba.Services.Implementations.AccountModule.AccountRowBuilder.<>c__DisplayClass12.b__2(KeyValuePair2 x) at System.Collections.Generic.List1.ForEach(Action1 action) at Samba.Services.Implementations.AccountModule.AccountRowBuilder.GetAccountScreenRows(AccountScreen accountScreen, WorkPeriod currentWorkPeriod) at Samba.Services.Implementations.AccountModule.AccountService.GetAccountScreenRows(AccountScreen accountScreen, WorkPeriod currentWorkPeriod) at Samba.Modules.AccountModule.AccountSelectorViewModel.UpdateAccountScreen(AccountScreen accountScreen) at Samba.Modules.AccountModule.AccountSelectorViewModel.Refresh() at Samba.Modules.AccountModule.AccountModule.OnNavigate(String obj) at Microsoft.Practices.Prism.Commands.DelegateCommand1.<>c__DisplayClass6.<.ctor>b__2(Object o)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Primitives.ToggleButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(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()


[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 8.1 Pro
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 240
–FreePhysicalMemory = 2139180
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 6.3.9600

Machine
-CUISINACLIENT
–Manufacturer = Hewlett-Packard
–Model = HP Compaq 8200 Elite SFF PC
–TotalPhysicalMemory = 4177526784
–UserName = CuisinaClient\CUISINACLIENT\Cuisina


Likely caused by the same reason that Emre mentioned in your other Topic on the matter.

The message indicates there is a problem with your Accounts and/or Transaction Types. It cannot find an account.

Be sure you have not deleted any accounts. If you did delete an account, then recreate it, and remap the Transaction Type, Document Type, and the associated Entity (if any).

1 Like

What I’ve understood is you configured a foreign currency, made transactions with that foreign currency and deleted it. Looks like you are experimenting some settings. If you clear transactions that will work fine.

For next version I’ve added a validation code to prevent that.

You mean I clear transactions for that account?

You mean I clear transactions for that account?
How, exactly? hah

No I mean clearing all transactions (tickets, account transactions, etc.) You’re working on experimental database right? It is not a good idea to delete currencies from production database.

You can find dozens of topics if you search. For example you can follow the first topic of that tutorial.

I am actually, working on my main database… anywhere I can using SQL Database Manager 2014 and change something there?

So you need to review recent account transactions and correct ones that contains reference to removed accounts or currencies. Management > Accounts > Transactions…

I have over 2000 transactions, any other way?

You don’t need to start from beginning. If you deleted a currency two days before you can review only these transactions.

1 Like

I forgot when I did that actually

So seems like you don’t want to cooperate with us. Please let me know clearly what you want me to do for you.

No I’m serious, I want to cooperate with you, I’m just saying what is going on, I don’t want you to do anything for me, I just need help, I changed the currency and I don’t remember when, and accounts screen is crashing, as you can see, I just want to know if it’s possible to change anything from the SQL database? because I can’t search in 2000+ transactions.
Maybe in future versions we can search for all transactions made by a certain user and delete anything of it?

Yes you can but you would still have to search through 2000+ transactions to fix anything if you dont remember when you did it. What do you expect to be able to do in the database? There is no magic wand for the damage you did. Your going to have to find the transactions and fix them or just erase it all and start over.

That is not a practical feature for a real world situation. Typically you dont delete transactions. In fact this idea would open up for serious internal fraud issues.

1 Like

There would be a field in the database showing my customer name, and the currency that the POS can’t find, I can change that currency back to the default one and it’ll work.
Transaction should have a connection to a certain customer or something I can look for

I can’t delete the customer’s account because it’s used by a “Ticket” how can I delete the account? to be able to delete the customer entity

IF you don’t use foreign currencies at all you can open SambaPOS database with a SQL tool and execute these scripts one by one. Please take backups before doing anything… and be sure you are not using any Foreign Currency.

Update Accounts set ForeignCurrencyId = 0
Update AccountTransactionValues set Exchange = Debit-Credit 
Update AccountTransactions set ExchangeRate = 1

That will mute the error but what you’re not convincing to is… you made transactions with that currency (we don’t know how many) so your transaction amounts should also reviewed and fixed accordingly because what we’re doing by running these SQL Scripts will convert all currency related data to default currency. As a result your account balances may not balance correctly. If you won’t review them I’ll strongly recommend to clear all transactions and start from beginning.

I hope that helps.

I’ve noticed you still want to delete stuff, lol. On a financial application you should never delete your records because you’re generating reports, trusting these numbers and make future decisions based on that data. When you delete part of data in the future your past reports changes. We don’t allow that for many reasons. At least this is how SambaPOS works.

1 Like

Indeed, thank you for understanding