SambaPOS Forum

English Boards => V3 Development => Topic started by: QMcKay on September 24, 2013, 06:17:42 pm

Title: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on September 24, 2013, 06:17:42 pm
I'd like to know how to configure Payouts to Vendors/Suppliers from the Cash drawer so that when I get a delivery of Soda/Beer/Eggs/Meat/etc from one of my suppliers, I can simply click a "Payout" button, select the Supplier, enter the Payout Amount, kick the drawer, and give the supplier the cash.

I've created Supplier Entities and Accounts, as well as Expense Transactions, but I'm having trouble getting it to all work in a simple manner.  At this point, I need to go into Accounts, select Cash, click Account details, click Cash Expense, pick the Supplier from a drop-down-list, enter the Amount, and click Save.  There must be a simpler way to do this from the POS SCREEN, instead of the Account screen.

The Payout button shown in the screenshot does nothing - I don't know why.  I've even tried creating a different TicketType and Department, but when I try to select a Supplier Entity, the program crashes with the following...
Code: [Select]
-----------------------------
[General Info]

Application: SambaPOS
Version:     3.0.27 BETA
Region:      en
DB:          SQ
Machine:     ASUSROCKET
User:        Quentin
Date:        2013-09-24
Time:        7:06 PM

User Explanation:

Quentin said "Select/click Supplier Entity causes exception."
-----------------------------

[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._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
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.GetExchangeRate(Account account)
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CreateTicket()
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.OpenTicket(Int32 ticketId)
   at Samba.Modules.PosModule.PosViewModel.OpenTicket(Int32 id)
   at Samba.Modules.PosModule.PosViewModel.OnEntitySelectedForTicket(EventParameters`1 eventParameters)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>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]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1

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

[System Info]

Operating System
-Microsoft Windows 7 Home Premium
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = -360
--FreePhysicalMemory = 13918992
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-ASUSROCKET
--Manufacturer = ASUSTeK Computer Inc.       
--Model = N71Jq
--TotalPhysicalMemory = 17100726272
--UserName = AsusRocket\Quentin

-----------------------------
- See more at: http://sambapos.org/en/content/configuring-payouts-vendors-cash#sthash.w3DgS0wv.dpuf (http://sambapos.org/en/content/configuring-payouts-vendors-cash#sthash.w3DgS0wv.dpuf)
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: emre on October 01, 2013, 04:39:43 am
Error generates while trying to read exchange rate. It seems you've enabled foreign currencies but there is a problem with related account configuration.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 01, 2013, 12:19:19 pm
Yes, I have foreign currency, and the error suggests there is something wrong:
Samba.Presentation.Services.Implementations.TicketModule.TicketService.GetExchangeRate(Account account)

However, I can see no difference in the account configuration for Suppliers, when compared to a Customer Account.  No Currency is specified for Customer Accounts, suggesting use of the default currency.

If I define a foreign currency, do I also need to define the default currency?  As you can see, I have made no selection for the currency of Customer Accounts, nor Supplier Accounts, since I want them to use the default currency (not explicitly defined), rather than the Foreign currency.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: emre on October 01, 2013, 12:47:03 pm
OK can you follow these steps?

1. Please check "Ticket Type" of the ticket you are creating and note "Sale Transaction Template"
2. Edit this Sale Transaction Template and check if a valid account assigned to "Default Target Account"
3. Check if that account's exchange rate configuration is valid.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 01, 2013, 05:14:18 pm
Ok, I followed you instructions.  I set a default Target Account of "Expense General", and now I can select a Supplier Entity without a crash.  I think I am very close to getting this to work, but now I have another problem. 

I currently have 2 Departments, and 2 associated Menus and Ticket Types:

Department: Restaurant
Menu: Menu (contains all the products that I sell)
Ticket Type: Ticket

Department: Payouts
Menu: Expenses & Suppliers (contains a single "dummy" product called "Payout" valued at 1.00)
Ticket Type: Payout Ticket

I select the Payout department, select the Supplier Entity, select the "Payout" product, change the value to that of the actual payout (eg. 118.00), click Payout (Automation Command that fires Action "AC Payout" which pays from Cash to Supplier Account, similar to charging to a Customer Account from Receivables), then I click "Close", but I receive this exception:
Code: [Select]
-----------------------------
[General Info]

Application: SambaPOS
Version:     3.0.28 BETA
Region:      en
DB:          SQ
Machine:     JVSERVER
User:        JavaVine
Date:        10/1/2013
Time:        8:08 PM

User Explanation:

JavaVine said "Payout department, select the Supplier Entity, select the "Payout" product, change the value to that of the actual payout (eg. 118.00), click Payout (Automation Command that fires Action "AC Payout" which pays from Cash to Supplier Account, then click Close."
-----------------------------

[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._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventsubject](TEventsubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Common.Services.ApplicationState.<NotifyEvent>b__7(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(String automationCommandName, String automationCommandValue)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(AutomationCommand automationCommand, String selectedValue)
   at Samba.Modules.PosModule.TicketViewModel.OnExecuteAutomationCommand(CommandContainerButton obj)
   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.Primitives.ToggleButton.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.StylusLogic.PromoteMainToMouse(StagingAreaInputItem stagingItem)
   at System.Windows.Input.StylusLogic.PromoteMainUpToTouch(StylusDevice stylusDevice, StagingAreaInputItem stagingItem)
   at System.Windows.Input.StylusLogic.PromoteMainToTouch(ProcessInputEventArgs e, StylusEventArgs stylusEventArgs)
   at System.Windows.Input.StylusLogic.PromoteMainToOther(ProcessInputEventArgs e)
   at System.Windows.Input.StylusLogic.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventsubject](TEventsubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Modules.TicketModule.ActionProcessors.CloseActiveTicket.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__2(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>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)

Inner Exception 2
Type:        System.InvalidOperationException
Message:     Sequence contains more than one matching element
Source:      System.Core
Stack Trace: at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Samba.Domain.Models.Tickets.Ticket.Recalculate()
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.RecalculateTicket(Ticket ticket)
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
   at Samba.Modules.PosModule.PosViewModel.CloseTicket()
   at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters`1 obj)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>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]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1

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

[System Info]

Operating System
-Microsoft Windows 7 Enterprise
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = -360
--FreePhysicalMemory = 6716484
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-JVSERVER
--Manufacturer = INTEL_
--Model = DH61WW__
--TotalPhysicalMemory = 8558923776
--UserName = JVserver\JavaVine

-----------------------------
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 01, 2013, 06:50:27 pm
Tried something different...

 I changed action AC Payout to create a Transaction Document that transfers funds from Cash to the Supplier Account (instead of Pay Ticket action).  This appears to work: it debits Cash and credits the Supplier Account.  But now I can not kill the Payout Ticket without Cancelling or Voiding (which reverses the Transaction).  If I don't Void/Cancel and Close the Ticket, I can't End Work Period.

I'm note sure what to do at this point.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: emre on October 01, 2013, 07:31:44 pm
Sorry I'm on a vacation now and a little tired so maybe I didn't understand how you'll use that. You should close ticket with a payment so maybe you can configure a new ticket type, new payment type and configure required payment transaction as your need. Maybe it can be just the reverse of the customer payment transaction.

The error message generates because there is duplicate use of a transaction type. It is hard to understand the problem from the error message but that happens if you assign a sale transaction for another action other than the ticket transaction. For example if you assign sale transaction type to a ticket type and a payment type these will generate two transactions with same transaction type. For sale transactions this is not permitted. 
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 02, 2013, 04:06:54 pm
The premise is simple, and it is based on this document, which works, but it is not simple and intuitive for a cashier or manager to execute:

http://sambapos.org/en/content/configuring-cash-transactions-v2-users (http://sambapos.org/en/content/configuring-cash-transactions-v2-users)

If you look at my original post, you should see what I'm trying to achieve:

Quote
I'd like to know how to configure Payouts to Vendors/Suppliers from the Cash drawer so that when I get a delivery of Soda/Beer/Eggs/Meat/etc from one of my suppliers, I can simply click a "Payout" button, select the Supplier, enter the Payout Amount, kick the drawer, and give the supplier the cash.

I've created Supplier Entities and Accounts, as well as Expense Transactions, but I'm having trouble getting it to all work in a simple manner.  At this point, I need to go into Accounts, select Cash, click Account details, click Cash Expense, pick the Supplier from a drop-down-list, enter the Amount, and click Save.  There must be a simpler way to do this from the POS SCREEN, instead of the Account screen.

If I payout cash from the drawer, this will help me reconcile at the end of the day.  The Payout should also increase the value in the supplier's account, so I can track my spending with the supplier.

So, what I'm trying to do is have a Payout Department, with Products that my suppliers sell to me.  Clicking Payout or Settle should Debit the Cash drawer and Credit the supplier account.  It's that simple.  Maybe I need to start over: wipe out all the Supplier Accounts, Supplier Transaction Types and Supplier Documents, then reconfigure from scratch.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 02, 2013, 04:28:19 pm
Hi,
Have you look at this How To http://www.sambapos.org/en/content/adding-refund-button-cash (http://www.sambapos.org/en/content/adding-refund-button-cash) ?
I think the way you do it might be conflict with the idea of sale screen that somehow may cause an error I don't know.
But you may find the way around in the account screen may make more sense. May be sales screen was code for Sales and Receivable account and Account screen is design for accounting.
Just my 2 cents
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 02, 2013, 04:35:10 pm
Btw, The tutorial show to hot add cash refund. But I do it for all kind of payment account. It works even tho some payment type has some buttons not for this account show up but I think I maybe setup account type thing not correctly.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 02, 2013, 04:55:39 pm
Thanks for the link sukasem.  I have not read that tutorial yet, but I will do so now.  Perhaps the approach used for a "Refund" will suit my purpose.

When I get this to work the way I want it to, I will post my own Tutorial for others who may find it useful.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 02, 2013, 05:09:52 pm
V3 Accounts are very confusing for new comers. I'm just learning right now too. I think after Emre back from vacation he might have some great ideas how to set this up in account screen. no one would ever figure that refund stuff out but him I guess.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 02, 2013, 05:22:32 pm
I read the Refund Tutorial.  It's very similar to the tutorial on Expenses which I previously mentioned:

http://sambapos.org/en/content/configuring-cash-transactions-v2-users (http://sambapos.org/en/content/configuring-cash-transactions-v2-users)

Unfortunately, both documents use methods that are not simple, since they make use of the Accounts screen.  They are simple to set up, but not simple or intuitive for a Cashier or Manager.  I'm trying to implement something that uses the POS screen in a Payout Department.  I find it frustrating that I cannot get this to work properly.  Basically I want to make a Negative Sale, the reverse of a Sale.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 02, 2013, 07:33:12 pm
@QTM, sorry, the tutorial title is misleading I thought it was for Version 2. So, it's the same idea then.
Sorry about that,
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: emre on October 03, 2013, 09:05:07 am
I think we shouldn't focus on tickets. You can configure a "Cash Payment" button on supplier account screens so when user clicks "Payout" Department he'll see entity search screen. He searches the supplier entity, click "Account Details" and click Cash Payment > type amount > click save.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 03, 2013, 01:50:25 pm
I've reverted my changes back to the configuration shown in document http://sambapos.org/en/content/configuring-cash-transactions-v2-users, (http://sambapos.org/en/content/configuring-cash-transactions-v2-users,) because I know it works properly.

I removed the Payout department and Payout ticket type.

Is there an action available to display the Account screen, so that I can map an Automation Command button on the POS screen?
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 03, 2013, 02:22:52 pm
How can we have the list of accounts in this case Vendors in the dropdown box (See picture)
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on October 03, 2013, 03:45:43 pm
You must begin typing in the dropdown box, and the list will populate.
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: sukasem on October 03, 2013, 04:00:25 pm
Damn, stupid me  :-[ I only type one letter. After second letter it shows up lol. But the list would be nice anyway  ;)
Title: Foreign Currency Transactions
Post by: QMcKay on October 14, 2013, 02:25:24 pm
New Question, or Problem - maybe a little of both...

We support 2 currencies here: default is Lempira (L), and foreign is USD ($).  This set up works fine for the POS/Ticket side of things (http://doc.sambapos.org/doku.php/en/v3/working_with_foreign_currencies (http://doc.sambapos.org/doku.php/en/v3/working_with_foreign_currencies)) to be able to accept payment in different currencies, and give change in those currencies.

On the other side of things (Supplier Payouts/Expenses), it is a bit strange, and doesn't appear to be intuitive when using Foreign currencies.  I recently configured many Supplier/Expense Accounts, along with Transactions and Document Types for moving money from one Account to another, for example: paying a Supplier with Cash from the Drawer.

This works well for Accounts that are in the default currency, but the behavior is odd when doing the same when paying with Foreign Currency Cash from the Drawer (or moving money from any account to another using Foreign Currency).

Some Suppliers/Expenses prefer payment in the foreign currency (USD), so I've configured those accounts as USD.  I also have a Cash USD account representing the foreign currency in the drawer.  I've set up separate Transactions and Documents to enable "Drawer Payout" and "Drawer Payout USD"... here is where the issue lies: when I pay to a USD Supplier account from the "Cash USD" account, the currency isn't correctly represented, and an exchange rate (L20=$1) calculation is taking place when it shouldn't be.  Also, different areas showing the Balance in Account is contradictory.

I submit a transaction for 112.00 (should be USD).
The balance of the 2 accounts involved becomes $5.60 (a 20-to-1 conversion is taking place).  I don't think this should be the case, considering both accounts are configured as USD.
Further, the balance shown on different screens contradicts itself: one will say 112.00, while another says 5.60.

Please see the screenshots for more detail.

Regards,
Q
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: emre on November 12, 2013, 11:35:18 am
Hello. I fact I implemented currency feature just to track cash under different currencies but what you requested sounds great. Is it possible to send me a backup of your data? so I can test it on your setup.
emre@sambapos.com
Title: Re: Configuring Payouts to Suppliers from Cash
Post by: QMcKay on November 17, 2013, 11:51:12 am
Version 3.0.31 is working great for this new feature.

Thanks much Emre!