Hi,
We have seen the error “Attempted to divide by zero.” when trying to end a work period a couple of times in the past few months.
It seems to occur when a staff member puts in a negative item on a ticket (see attached ticket screenshot). Most likely if an item ends up being ‘0’ total quantity is the true cause but I haven’t been able to confirm this.
Ignoring why staff are doing this in the first place this does seem to be a bug that’s reoccurring. To fix it I have to go into the database and manually delete the offending orders.
Log:
20/03/2020 6:20 PM
[General Info]
Application: SambaPOS
Version: 5.2.26
Region: en
DB: SQ
Machine: xxx
User: xxx
Date: 20/03/2020
Time: 10:20 AM
User Explanation:
simon said “”
[Exception Info 1]
Top-level Exception
Type: System.DivideByZeroException
Message: Attempted to divide by zero.
Source: mscorlib
Stack Trace: at System.Decimal.FCallDivide(Decimal& d1, Decimal& d2)
at System.Decimal.op_Division(Decimal d1, Decimal d2)
at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.UpdateConsumption(PeriodicConsumption pc, Int32 warehouseId, IEnumerable1 tickets, IList
1 recipes) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 149
at Samba.Services.Implementations.InventoryModule.ConsumptionBuilder.BuildPeriodicConsumption() in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\ConsumptionBuilder.cs:line 68
at Samba.Services.Implementations.InventoryModule.InventoryService.DoWorkPeriodEnd(WorkPeriod currentWorkPeriod, WorkPeriod previousWorkPeriod) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\InventoryService.cs:line 191
at Samba.Services.Implementations.InventoryModule.InventoryWorkperiodProcessor.ProcessWorkPeriodEnd(WorkPeriod currentWorkPeriod, WorkPeriod previousWorkperiod) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\InventoryModule\InventoryWorkperiodProcessor.cs:line 25
at Samba.Presentation.Services.Implementations.WorkPeriodModule.WorkperiodClient.StopWorkPeriod(String description)
[Assembly Info]
mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
DevExpress.Xpf.Core.v16.2, Version=16.2.13.0
System.Xaml, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
DevExpress.Data.v16.2, Version=16.2.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
FastButton, Version=1.0.0.0
[System Info]
Operating System
-Microsoft Windows 10 Pro
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 480
–FreePhysicalMemory = 8071240
–OSArchitecture = 64-bit
–OSLanguage = 2057
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.18362
** Machine info removed, happens on any terminal **
######################### E N D #########################