Workperiod failing to close “Sequence contains more than one matching element”

Hi there,

Today when I tried to end a workperiod I got an error

“Sequence contains more than one matching element”

This also happens when I go to the warehouses screens ( the inventory ).

You need to post the full error here as at the moment we have no idea what issue you may have

1 Like

Its probably a recipe issue.

This is the error that I am getting


[General Info]

Application: SambaPOS
Version:     5.2.12
Region:      en
DB:          SQ
Machine:     SERVER
User:        server
Date:        10/2/2018
Time:        7:24 PM

User Explanation:

server said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.InvalidOperationException
Message:     Sequence contains more than one matching element
Source:      System.Core
Stack Trace: at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Samba.Services.Implementations.CacheService.GetRecipe(String portionName, Int32 menuItemId) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\CacheService.cs:line 835
   at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.UpdateConsumption(PeriodicConsumption pc, Int32 warehouseId, IEnumerable`1 tickets, IList`1 recipes) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 136
   at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.CreatePeriodicConsumptionItems(Int32 wid, PeriodicConsumption pc, IList`1 inventoryItems, PeriodicConsumption previousPc, IList`1 tickets, IList`1 recipes) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 119
   at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.CreateWarehouseConsumption(Int32 warehouseId) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 90
   at Samba.Services.Implementations.InventoryModule.InventoryService.GetCurrentWarehouseConsumptionFor(WorkPeriod currentWorkPeriod, WorkPeriod previousWorkPeriod, Int32 warehouseId) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\InventoryService.cs:line 140
   at Samba.Presentation.ClientLibrary.Modules.InventoryModule.WarehouseInventoryViewModel.UpdateSelectedWarehouse(Int32 warehouseId) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\InventoryModule\WarehouseInventoryViewModel.cs:line 98
   at Samba.Presentation.ClientLibrary.Modules.InventoryModule.WarehouseInventoryViewModel.OnWarehouseSelected(Warehouse obj) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\InventoryModule\WarehouseInventoryViewModel.cs:line 79
   at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>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.Button.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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v16.2, Version=16.2.6.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v16.2, Version=16.2.6.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v16.2.Core, Version=16.2.6.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v16.2, Version=16.2.6.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=1.0.0.0
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Microsoft.CSharp, Version=4.0.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
DevExpress.Data.v16.2, Version=16.2.6.0
NCalc, Version=1.3.8.0
WindowsInput, Version=1.0.4.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 10 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -420
--FreePhysicalMemory = 954400
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.17134

Machine
-SERVER
--Manufacturer = NEC
--Model = PC-MK26MGFCC
--TotalPhysicalMemory = 3412840448
--UserName = SERVER\server

-----------------------------

You have 2 recipes for the same product. Normally this is not allowed but if you noticed some way to do that I’ll be glad to know.

1 Like

Are you using MobileClient?

No I am not using a mobile client. I found one item that had a duplicate recipe.

Thanks to you guys.

On that note can we have a feature to find duplicate recipes

It’s not supposed to let you make duplicate recipe. Somehow you found a way.

1 Like

I don’t even know how it allowed me to create a duplicate recipe. Maybe because this is an old db and i created these recipes a long time ago maybe that’s when I created this Johnny twice. It wasn’t sold for sometime maybe that’s why it didn’t give an error because there was no movement of that item until on Friday.

1 Like

I found a way to do that and fixed it for the next update.

Thank you for reporting.

3 Likes