KlaMa's picture
Sep 15, 2013
24226 views
Reputation: 8

Adding tipping in SambaPOS3 / Upgrading to 3.0.25

Hello Emre,

I have three questions:

1.) For SambaPOS2 found a nice tutorial that describes how to add a tip button to the menue where products can be assigned to a ticket (in POS: All Tables -> B13 ....), I don't know the correct name for that menu, sorry. The link was:

http://doc.sambapos.org/doku.php/en/tips/how_to_track_and_change_tip_amo...

How does this work in SambaPOS3 ? I didn't find the ServiceTemplates. Is Tipping conceptually different in this version of the software?

2.) Is it possible that the default tip amount when pressing the tip button is 15% of the bill but can be modified, similar as described in the above example? How would this be done.

I greatly appreciate your help and the efforts that you put into this project. If it helps I could write a tutorial for you that explains how to set up the tip feature after I understand how that works.

3.) can i safely upgrade from SambaPOS 3.15 to the current distribution 3.25 or will I have to start from scratch, meaning will I have to create a new SambaPOS SQL database and loose my old data ?

Kind regards,

Klaas

4 answers

JohnSCS's picture
JohnSCS
Sep 15, 2013
Reputation: 271

Hi Klaas,

1. Service Templates have been replaced with Calculation Types (Manage->Settings->Tickets)

 

2. You can not mix both rate and amount for the same Calculation Type. But to get around this, you need to create two Calculation Types and two Actions. You will still need to create the Ticket Tag - Tip as per the V2 instructions.

Calculation Types
- Default Tip -> set to Rate from Ticket Amount
- Tip -> set to Fixed Amount
** Account Transaction will be 'Sale Transaction' for both

Actions
Name : Default Tip
Action : Update Ticket Calculation
Calculation Type : Deafult Tip
Amount : [:Value]

Name : Tip
Action : Update Ticket Calculation
Calculation Type : Tip
Amount : [:Value]

In the Rule 'New Ticket Creating Rule' add the Action Default Tip and value 15
**This will add a default tip of 15% to all new tickets.

Create a Rule - Tip Selected

Name : Tip Selected
Event : Ticket Tag Selected
Constraint : Tag Name Equals Tip
Actions
- Default Tip - Value : 0
- Tip - Value : [:TagValue]

What happens with the above Rule, is if a Tip amount is selected, it removes to Deafult Tip of 15% and adds a Tip value in $

 

3. You can upgrade to the latest version (3.0.26), but as always, backup your database before hand. V3 is still in Beta and upgrading 11 versions in one go may have issues with your setup which we can not predict. If you do have issues, then upgrade one version at a time.
There has been some changes to the database structure in the newer versions which may prevent a direct upgrade from 3.0.15->26.

Hi John, thank you very much for your answer! I managed to introduce an included tip and a selective tip. There was only one point missing in your brief tutorial: In the "Tip selected" rule I had to assign mappings in order to make that rule work.

Now: How do I list the calculated tip amounts to the bill?

In the ticket template I tried to introduce the following lines:

//

{CALCULATIONS}

#... down below in the definition part - this remark line was actually not added ;-)

[CALCULATIONS: Default Tip]

<J00> {CALCULATION Name} | {Calculation Value}

 

[CALCULATIONS: Tip]

<J00> {CALCULATION Name} | {Calculation Value}

//

But this appears not to be the way to do it, since there is not categorie calculations. Still, the tip amounts must be listed on the bill. Any ideas ?

Kind regards,

Klaas

emreeren's picture
emreeren
Sep 21, 2013
Reputation: 595

Yes there is no calculations tag. You'll use {Discounts} for calculations that decreases ticket amount and {Services} for calculations that increases ticket amount. 

edominguez's picture
edominguez
Jan 03, 2014
Reputation: 17

Hi, I follow all the instructions and the default tip works perfect. However with the TIP I have an exception error with the following message:

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

[General Info]

 

Application: SambaPOS

Version:     3.0.34 BETA

Region:      es

DB:          SQ

Machine:     CAJA-PC

User:        edwin

Date:        03/01/2014

Time:        3:44

 

User Explanation:

 

edwin said ""

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

 

[Exception Info 1]

 

Top-level Exception

Type:        System.Reflection.TargetInvocationException

Message:     Se produjo una excepción en el destino de la invocación.

Source:      mscorlib

Stack Trace: en System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

   en System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

   en System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

   en System.Delegate.DynamicInvokeImpl(Object[] args)

   en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

   en System.Windows.Threading.DispatcherOperation.InvokeImpl()

   en System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

   en System.Threading.ExecutionContext.runTryCode(Object userData)

   en System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

   en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   en System.Windows.Threading.DispatcherOperation.Invoke()

   en System.Windows.Threading.Dispatcher.ProcessQueue()

   en System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

   en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

   en System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

   en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

   en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

   en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

   en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

   en System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)

   en System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

   en Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventsubject](TEventsubject eventArgs, String eventTopic, Boolean wait)

   en Samba.Presentation.Common.Services.ApplicationState.<NotifyEvent>b__7(ActionData x)

   en Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)

   en CallSite.Target(Closure , CallSite , Object , Action`1 )

   en Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)

   en Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)

   en Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)

   en Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateTag(Ticket ticket, TicketTagGroup tagGroup, String tagValue)

   en Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateTag(Ticket ticket, TicketTagGroup tagGroup, TicketTag ticketTag)

   en Samba.Modules.ModifierModule.TicketTagEditorViewModel.UpdateTicketTag(Ticket ticket, TicketTagGroup tagGroup, TicketTag ticketTag)

   en Samba.Modules.ModifierModule.TicketTagEditorViewModel.OnTicketTagSelected(TicketTag obj)

   en Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)

   en Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)

   en Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)

   en MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)

   en System.Windows.Controls.Primitives.ButtonBase.OnClick()

   en System.Windows.Controls.Primitives.ToggleButton.OnClick()

   en System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)

   en System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)

   en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)

   en System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)

   en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   en System.Windows.Input.InputManager.ProcessStagingArea()

   en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)

   en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

   en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

   en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

   en System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

   en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

   en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

   en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

   en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

   en System.Windows.Application.RunDispatcher(Object ignore)

   en System.Windows.Application.RunInternal(Window window)

   en System.Windows.Application.Run(Window window)

   en Samba.Presentation.App.Main()

 

Inner Exception 1

Type:        System.InvalidOperationException

Message:     La secuencia no contiene ningún elemento coincidente

Source:      System.Core

Stack Trace: en System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)

   en Samba.Domain.Models.Tickets.Ticket.Recalculate()

   en Samba.Presentation.Services.Implementations.TicketModule.TicketService.RecalculateTicket(Ticket ticket)

   en Samba.Modules.TicketModule.ActionProcessors.UpdateTicketCalculation.Process(ActionData actionData)

   en Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)

   en Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)

   en Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__2(EventParameters`1 x)

   en Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)

   en Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)

   en Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)

   en Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)

   en 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 Ultimate

--CodeSet = 1252

--CSDVersion = Service Pack 1

--CurrentTimeZone = -360

--FreePhysicalMemory = 952628

--OSArchitecture = 32 bits

--OSLanguage = 3082

--ServicePackMajorVersion = 1

--ServicePackMinorVersion = 0

--Version = 6.1.7601

 

Machine

-CAJA-PC

--Manufacturer = Hewlett-Packard

--Model = CQ1-1406LA

--TotalPhysicalMemory = 2137186304

--UserName = CAJA-PC\edwin

 

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

 

emreeren's picture
emreeren
Jan 03, 2014
Reputation: 595

Can you send me a copy of the database to emre@sambapos.com and the exact steps how do you generate this error? Thanks.

We have already answers to
1030 questions
E-Posta Facebook Twitter RSS Skype
Telefon (212) 252 0634