Inventory Erro, help find it please

People been doing recipes the whole day, and something went wrong, system cant calculate inventory in Local Warehouse.

Anyone have a better idea where the error is?

-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.62
Region:      pt-BR
DB:          SQ
Machine:     ASUS-PC
User:        Asus
Date:        07-08-2017
Time:        19:53

User Explanation:

Asus said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Exception
Message:     Inventory calculation generated an error. Check your recipes. 
Pao D. Marcela                                              .Normal
Marmelada Extra Purissimo 450g                              .Normal
Manteiga Castelo 500g                                       .Normal
Laranja Kg                                                  .Normal
Chouriço Corrente Colorau                                   .Normal
Leite Delta Uht M/Gordo 1L.Normal
Queijo Paiva Azeitonas 150g                                 .Normal
GalĂŁo.Normal
Café.Normal
Actimalt 33cl                                               .Normal
Meia Cachupa.Normal
Meia de Leite.Normal
Cachupa.Normal
SUMOS NATURAIS.Normal
OVO.Normal
Sumo Colombo Pessego 200 ml.Normal
Tosta Galinha.Normal
Omolete mista.Normal
Gelado La Terrasse Chocolate Puro                           .Normal
Kul Cola 0.33cl.Normal
Bolacha Chocomax 125g                                       .Normal
Ruffles  Presunto 45g.Normal
Tomate Kg                                                   .Normal
Café Criolo 250g.Normal
Strela Krioula 25cl                                         .Normal
Tosta Mista.Normal
Agua Trindade 1.5L.Normal
Cha Lipton Yellow Label                                     .Normal
Mentos Mix Beach Maracuja/Manga                             .Normal
Carlsberg Lata 33cl.Normal
Sanduiche queijo.Normal
Trident Sense Tropical Mix                                  .Normal
Guarana Antarctica Lata 0.33cl                              .Normal
Agua C/Gas Bonaqua 1l                                       .Normal
Mateus Original Rose  75cl.Normal
Agua Trindade 0,5l.Normal
BIFE VACA.Normal
Strela Imprial 20cl.Normal
Cappocino.Normal
L&M                                                         .Normal
Super Bock XL 50cl.Normal
Coca Cola 150cl                                             .Normal
Super Bock 1L.Normal
Penso Higienico Super Suave 10 Peças                        .Normal
Sumol Laranja Lata 0.33cl.Normal
Garoto.Normal
Gelado La Terrasse Morango                                  .Normal
Leite 1/2 Gordo Parmalat 1l                                 .Normal
Iogurte Paiva Manga 4*125g                                  .Normal
Iogurte Paiva Frutos Tropicais 4*125g                       .Normal
Cigarro Sg Gigante                                          .Normal
Atum Em Pedaços com Picante Frescomar 115g.Normal
Carne Bife Groot 200g                                       .Normal
Sumo Colombo Laranja 200 ml.Normal
Gelado La Terrasse Maracuja                                 .Normal
Fini Strawberry Rings 100g.Normal
Lipton Ice Tee Limao 0.5l                                   .Normal
Super Bock 25cl.Normal
HAMBUERGER SIMPLES.Normal
Gelado La Terrasse Chocolate Roche                          .Normal
Chocolate Chipmix 125g.Normal
Grog Velha.Normal
Coca Cola 35cl Pet                                          .Normal
Lay´S Original 45 g.Normal
Somersby Sidra Maça 0.33.Normal
Mancarrinha Pellito 50g                                     .Normal
Lay´S Camponesa 170g.Normal

Source:

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

[Exception Info 2]

Top-level Exception
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object.
Source:      Samba.Services
Stack Trace: at Samba.Services.Implementations.CacheService.<>c__DisplayClass217_0.<GetRecipe>b__0(Recipe x) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\CacheService.cs:line 832
   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\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\CacheService.cs:line 832
   at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.UpdateConsumption(PeriodicConsumption pc, Int32 warehouseId, IEnumerable`1 tickets, IList`1 recipes) in C:\Users\emree\Documents\Github\SambaPOSPro\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\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 119
   at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.CreateWarehouseConsumption(Int32 warehouseId) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 90
   at Samba.Services.Implementations.InventoryModule.InventoryService.GetCurrentWarehouseConsumptionFor(WorkPeriod currentWorkPeriod, WorkPeriod previousWorkPeriod, Int32 warehouseId) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\InventoryService.cs:line 135
   at Samba.Modules.InventoryModule.WarehouseInventoryViewModel.UpdateSelectedWarehouse(Int32 warehouseId)
   at Samba.Modules.InventoryModule.WarehouseInventoryViewModel.Refresh(Int32 warehouseId)
   at Samba.Modules.InventoryModule.InventoryModule.OnNavigate(String parameterName)

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

[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.v14.1, Version=14.1.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.13.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.13.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.v14.1, Version=14.1.13.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

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

[System Info]

Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = -60
--FreePhysicalMemory = 1307988
--OSArchitecture = 64-bit
--OSLanguage = 2070
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-ASUS-PC
--Manufacturer = ASUSTeK COMPUTER INC.
--Model = BM2AD_D310312510MT_ED3
--TotalPhysicalMemory = 4161974272
--UserName = Asus-PC\Asus

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

Found it!!! One of the recipes was giving an error, it looked normal, yet it was not … deleting it, solved the issue.
Fastet way to find it was actually to click on “Find Required Recipe” and it showed it. :sweat_smile:

1 Like

Oh no! Apparently there is something wrong with my Samba, most products show as if the recipe for it does not exist.

I didn’t notice this until too late, whenever I click find missing recipes it shows me a huge list, even though I have items added the system does not see them.

I suspect it might be because I used Bulk Importer Tool from @QMcKay with SambaPOS5 5.1.60 and later upgraded to latest version (download and install on top) … could this be the issue?

It would be great if anyone can help me solve this, or else I’ll have to re-do everything. I tried deleting recipes and re creating them, the problem persist, Samba does not see them, I dont know why. I tried creating a brand new item, inventory and recipe. Still same problem, when I click required recipe it shows me a list with:

[name of product].Normal

And there is nothing I can do to solve it. Here is the error from log when I try to open warehouse.

[General Info]

Application: SambaPOS
Version: 5.1.62
Region: en
DB: SQ
Machine: DESKTOP-C2F7MLL
User: User
Date: 8/8/2017
Time: 11:09 AM

User Explanation:

User said “”

[Exception Info 1]

Top-level Exception
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.Implementations.CacheService.<>c__DisplayClass217_0.b__0(Recipe x) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\CacheService.cs:line 832
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at Samba.Services.Implementations.CacheService.GetRecipe(String portionName, Int32 menuItemId) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\CacheService.cs:line 832
at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.UpdateConsumption(PeriodicConsumption pc, Int32 warehouseId, IEnumerable1 tickets, IList1 recipes) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 136
at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.CreatePeriodicConsumptionItems(Int32 wid, PeriodicConsumption pc, IList1 inventoryItems, PeriodicConsumption previousPc, IList1 tickets, IList1 recipes) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 119 at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.CreateWarehouseConsumption(Int32 warehouseId) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 90 at Samba.Services.Implementations.InventoryModule.InventoryService.GetCurrentWarehouseConsumptionFor(WorkPeriod currentWorkPeriod, WorkPeriod previousWorkPeriod, Int32 warehouseId) in C:\Users\emree\Documents\Github\SambaPOSPro\Samba.Services\Implementations\InventoryModule\InventoryService.cs:line 135 at Samba.Modules.InventoryModule.WarehouseInventoryViewModel.UpdateSelectedWarehouse(Int32 warehouseId) at Samba.Modules.InventoryModule.WarehouseInventoryViewModel.OnWarehouseSelected(Warehouse 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.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.v14.1, Version=14.1.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.13.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.13.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.v14.1, Version=14.1.13.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

Show a screenshot of a Recipe.

1 Like

I am absolutely sure its not a recipe problem. This one is very strange, what happened was this, I had created automatic recipes and inventory with the bulk importer tool and everything was working, but then after a few days and people messing with the system, suddenly Samba could not find recipes, it was missing ALL recipes, although I was looking straight at them.

I was thinking its a problem in recipes or inventory, or relation between recipe id and MenuItemID in database… I spent these 2 days checking all columns in hopes of finding the error, cross referenced IDs and tables in database… everything seemed normal.

However after a lot of time and deleting parts of data one by one I narrowed down the issue to products, some products were throwing Samba off course and making it think it had no recipes.

I was able to find 5 products which were added and even had recipes, but Samba could not see them, and in sequence was getting an error from everything else. Deleting these 5 products fixed everything.

Visually they all seemed fine, all fields perfectly added. ALL GOOD.
I didnt have the energy to look for the problem on database, to see what they were missing.

Weird. But seems solved now. I hope … :sweat_smile:

1 Like