POS Exception after loading script

Hello!

I am currently trialling SambaPOS. My main initial aim is to get a lot of the standard features of a hospitality system such as fast user switching, user security controls for discounts etc.

It had been going okay but I realised I would need a ‘food discount’ button. To facilitate this I used a file from the post Checkbox for a product item to exclude it from "discount %" calculation
Unfortunately, after I load this and go into the POS, the POS throws up an exception as soon as I try and sell something.
Naturally I can restore to the backup but just wondered if anyone had any ideas?

I tried resetting the database and reloading the file mentioned. After I log back in, do a ‘start work period’ and try and sell something, same exception occurs.

The exception details are below.


[General Info]

Application: SambaPOS
Version: 5.3.0
Region: en
DB: SQ
Machine: DESKTOP-FS0P6E3
User: User
Date: 01/08/2020
Time: 00:28

User Explanation:

User 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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Inner Exception 1
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Domain
Stack Trace: at Samba.Domain.Models.Accounts.AccountTransaction.Create(AccountTransactionType template, DateTime date, Int32 departmentId)
at Samba.Domain.Models.Accounts.AccountTransactionDocument.AddNewTransaction(AccountTransactionType template, Int32 departmentId, IEnumerable1 accountDataList) at Samba.Domain.Models.Accounts.AccountTransactionDocument.AddSingletonTransaction(Int32 transactionTypeId, AccountTransactionType template, Int32 departmentId, IEnumerable1 accountDataList)
at Samba.Domain.Models.Tickets.Ticket.AddCalculation(CalculationType calculationType, Decimal amount, String userName, Boolean forceRemove, Decimal exchangeRate)
at Samba.Services.ActionProcessors.TicketModule.UpdateTicketCalculation.Process(ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\TicketModule\UpdateTicketCalculation.cs:line 40
at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Common\RuleActionTypeRegistry.cs:line 39
at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:line 42
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.b__0() in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:line 76
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:line 84
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:line 125
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:line 62
at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:line 26
at Samba.Services.Implementations.TicketModule.TicketServiceBase.RecalculateTicket(Ticket ticket, Boolean forceRecalculation, AppState appState) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 289
at Samba.Services.Implementations.TicketModule.TicketServiceBase.AddOrder(Ticket ticket, MenuItem menuItem, Nullable1 quantity, Boolean enforceQuantity, String portionName, String orderState, String orderTagJson, AppState appState, Nullable1 price) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 205
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.AddOrder(Ticket ticket, Int32 menuItemId, Nullable1 quantity, Boolean enforceQuantity, String portionName, String orderState, String orderTagJson) at Samba.Presentation.ClientLibrary.Modules.PosModule.TicketOrdersViewModel.AddOrder(Int32 menuItemId, Nullable1 quantity, Boolean enforceQuantity, String portionName) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketOrdersViewModel.cs:line 209
at Samba.Presentation.ClientLibrary.Modules.PosModule.TicketOrdersViewModel.AddOrder(ScreenMenuItemData data) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\TicketOrdersViewModel.cs:line 216
at Samba.Presentation.ClientLibrary.Modules.PosModule.PosViewModel.OnMenuItemSelected(EventParameters1 obj) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 484 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]

mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Samba.Services, Version=5.3.7390.41537
Samba.Domain, Version=5.3.7390.41536
Samba.Infrastructure.Data, Version=5.3.7390.41536
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=5.3.7390.41539
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v17.2, Version=17.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v17.2, Version=17.2.13.0
DevExpress.Xpf.Grid.v17.2.Core, Version=17.2.13.0
System.Xaml, Version=4.0.0.0
Samba.Infrastructure, Version=5.3.7390.41533
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.v17.2, Version=17.2.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=5.3.7390.41536
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=5.3.7390.41534
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
NCalc, Version=1.3.8.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.v17.2, Version=17.2.13.0
WindowsInput, Version=1.0.4.0


[System Info]

Operating System
-Microsoft Windows 10 Pro
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = 60
–FreePhysicalMemory = 3165788
–OSArchitecture = 64-bit
–OSLanguage = 2057
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.18363

Machine
-DESKTOP-FS0P6E3
–Manufacturer = LENOVO
–Model = 4180PR1
–TotalPhysicalMemory = 8471670784
–UserName = DESKTOP-FS0P6E3\User