Crash when settling Balance

Hi

Could anyone help me understand my error log please? My system crashes when i settle a customer balance via the payment screen. I thought the issue may be due to accounts i made e.g. discount or VAT, but i can’t interprate the error log to help narrow it down.

I know the alternative way of paying a customer balance (i.e. paying via ACCOUNTS screen). However, sometimes it is necessary to pay the balance via the usual payment screen. For example customer comes in, buys a meal then at payment screen we see customer owes us £5 from last time, so we click balance and try to pay it the current meal and the £5 owed all together.

Small demostration of the issue:
crash log

Crash log:

[Exception Info 1]

Top-level Exception
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object.
Source:      Samba.Presentation.Services
Stack Trace: at Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateTicketNumber(Ticket ticket)
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.AddAccountTransaction(Ticket ticket, Account sourceAccount, Account targetAccount, Decimal amount, Decimal exchangeRate)
   at Samba.Presentation.ClientLibrary.Modules.PosModule.Payments.PaymentEditor.UpdateTicketPayment(PaymentType paymentType, IList`1 changePayments, Account paymentAccount, Decimal paymentDueAmount, Decimal paidAmount, Decimal tenderedAmount, String description)
   at Samba.Presentation.ClientLibrary.Modules.PosModule.Payments.PaymentEditorViewModel.SubmitPaymentAmount(PaymentType paymentType, IList`1 changePayments, Account paymentAccount, Decimal paymentDueAmount, Decimal tenderedAmount, String description)
   at Samba.Presentation.ClientLibrary.Modules.PosModule.Payments.PaymentEditorViewModel.SubmitPayment(PaymentType paymentType)
   at Samba.Presentation.ClientLibrary.Modules.PosModule.Payments.PaymentEditorViewModel.OnMakePayment(PaymentType paymentType)
   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)

Thank you.

It is definitely a mistake with accounting. Reverse what you did then post here what you want to do and we can help you create the correct accounting automation.

1 Like

It looks like you’re trying to add an account transaction. This is not the correct way to do it. You can build a button for paying an account but you shouldn’t try to automate it with a payment type.

1 Like

If only I could remember…:sweat_smile:. Will go back through my many backups and figure out when the error started occuring.

I will do some digging and update this thread with my findings.

Thank you.

Surely clicking “Balance” on the payment screen IS an account transaction though? As the balance owed is on a customer account and the books need to balance.
Or does the Balance button just add the total on the account to a ticket and therefore it is a ticket transaction?

Samba.Presentation_Uh9Hp3JfHr

1 Like

Yep that’s what I need fixing.
Works fine with default database so it’s definitely something I did. Just going to go through my periodic database backups and find out where it messed up.

Its definitely an account transaction. Specifically its looking for something that doesnt exist at the time of the transaction.

1 Like