Adding an order to an Open Ticket from another application

Hallo,
I want to add and order to an existing Ticket via an external application. I get as far as seeing the new order in the left screen. However, when the SambaPOS 5 terminal is used to add a new item it crashes.

Im accessing ans where nessessary updating the following tables:

AccountTransactions
AccountTransactionValues
Orders
Tickets
TicketEntities
MenuItems

Have I forgotten anything?

Regards,
Stuart
Here is the extract of the log:

Application: SambaPOS
Version: 5.2.24
Region: en
DB: SQ
Machine: LENOVO-STUART
User: stuart
Date: 03.04.2020
Time: 14:54

User Explanation:

stuart 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.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.GetAccountTransactionTypeById(Int32 id) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\CacheService.cs:line 385
at Samba.Services.Implementations.TicketModule.TicketServiceBase.<>c__DisplayClass26_0.b__2(IGrouping2 order) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 228 at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at Samba.Services.Implementations.TicketModule.TicketServiceBase.RefreshAccountTransactions(Ticket ticket) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 226
at Samba.Services.Common.OrderUpdater.Update(ITicketServiceBase ticketService, ICacheService cacheService, Ticket ticket, Order order, String menuItemName, Nullable1 quantity, Nullable1 price, Nullable1 increaseInventory, Nullable1 decreaseInventory, Nullable1 locked, Nullable1 calculatePrice, String taxTemplate, String accountTransactionType, String warehouseName, String portionName, String priceTag, Nullable1 disablePortionSelection, String groupTagName, String groupTagFormat, AppState appState) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\Common\OrderUpdater.cs:line 45 at Samba.Services.ActionProcessors.TicketModule.UpdateOrder.Process(ActionData actionData, RuleExecutionContext context) in C:\Users\vehbi\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\TicketModule\UpdateOrder.cs:line 30 at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) in C:\Users\vehbi\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\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:line 42 at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.<InvokeWith>b__0() in C:\Users\vehbi\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\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\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\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\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:line 26 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\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\TicketModule\TicketServiceBase.cs:line 204 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\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\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\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\PosModule\PosViewModel.cs:line 541
at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument)
at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) at Microsoft.Practices.Prism.Events.CompositePresentationEvent1.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=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
WindowsBase, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v16.2, Version=16.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v16.2, Version=16.2.13.0
DevExpress.Xpf.Grid.v16.2.Core, Version=16.2.13.0
System.Xaml, 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.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
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.v16.2, Version=16.2.13.0
WindowsInput, Version=1.0.4.0

Please don’t duplicate posts, Jesse had answered your othet