Automatic discount based on customer discount-level with set amounts per product

Hey! What have we here??? Will need to play with tomorrow… 4am here now…

Wow… Interesting… That could be very useful…
I doubt we’ll be able to use this to loop through the orders though?

The tables screen is behaving differently with my setup. When I go to it it behaves exactly like the “move table” button…

I just tried out Select orders with Select All set to “True”. I assumed it would select all orders on the ticket, but it doesn’t seem to do anything.
Tried with “Gift” in Order State, it also doesn’t do anything.
Adding Refresh Cache doesn’t help either.

Maybe it’s just an empty shell, and @emre is still working on this?

Wow… It is very hard to handle all possible ticket changes and update discounts accordingly.

Ticket states can be useful for that. When ticket brought to a state (something like Locked state) you can execute update order state action. When there is no order selected on ticket that action will trigger for all orders one by one so you’ll be able to update orders.

1 Like

I’ve created something working. It will give some idea about implementation details.

SambaPOS49_201411021844SQM.zip (444.0 KB)

Use Activate Ticket Discount & Deactivate Ticket Discount actions to enable/disable (refresh) discounts.
Use Activate / Deactivate Order Discount actions to enable disable discounts for specific orders.

Important Note: I’ve added Hard Refresh Ticket action to refresh order display but it won’t work for new created tickets and we shouldn’t refresh tickets as demonstrated there as it basically closes & reopens ticket. On next version it will automatically update order lines after entity selection so no refresh will be needed.

Note 2: Displaying custom fields issue is related with screen customization feature. I’ll try to improve that too. To display them right click on screen, enable customization and drag new fields from Available Fields section.

2 Likes

Ok, I see… I managed to get the field to appear, however Screen Customization should not be affecting the visible fields in Manage > Entities > Entity, so I hope to see a specific improvement there.

I forgot about the following as well, which works just fine either way, and I probably should be editing Entities this way to begin with… Batch Entity Editor:

Not really sure what to do with this?

Means he used 2014 looks like. I know 2014 is version 12 … 2012 is version 11

I have the same problem here… Cannot restore the file (SQL Server 2012).

You need to upgrade to 2014 or convert it to 2012. It worked fine on 2014 I just tested it.

1 Like

Convert it? How do I do that? Is there a tool for that?

Okie dokie… downloading now!

http://www.microsoft.com/en-us/download/details.aspx?id=42299

Which Package you ask?

  • I like the one with everything which is SQLEXPRADV_x64_ENU (1.1 GB)
  • At the very least I recommend the one with Tools, (Management Studio) which is SQLEXPRWT_x64_ENU (833.2 MB)
  • but you can get away with no tools (still multi-user) which is SQLEXPR_x64_ENU (196.7 MB)
  • or the LocalDB install (small, single-user) which is SqlLocalDB (43.1 MB)

I don’t have a 64 bit system, so I’m downloading SQLEXPR_x86_ENU.exe.
Will this work with SQL Server 2012 Management studio, or will I have to download this separately?

It should work with it yes. It wouldn’t hurt to download a newer version though.

1 Like

I use the advanced one with everything I disabled a lot I did not need but I like having it all available.

1 Like

Alternatively you can install SQL Server Local DB 2014 next to your SQL Server install. Local DB is very handy for testing purposes. After installing set connection string as

Data Source=(localdb)\MSSqlLocalDb; Database=SambaPOSWhatever;

… and it will work. After doing that you can restore backup file to test that setup.

Download links:

2 Likes

I just updated to SQL Server 2014, imported @emre’s database into the instance, then changed the connection string to the new instance and database, and I can’t start SambaPOS anymore. It shows:

[General Info]

Application: SambaPOS
Version: 4.1.73
Region: en
DB: SQ
Machine: RUBEN-PC
User: ruben
Date: 11/3/2014
Time: 1:16 AM

User Explanation:

ruben said “”

[Exception Info 1]

Top-level Exception
Type: System.InvalidOperationException
Message: Cannot serialize a generic type 'System.Collections.Generic.List1[Samba.Domain.Models.Accounts.AccountTransaction]'. Source: PresentationFramework Stack Trace: at System.Windows.Markup.Primitives.MarkupWriter.VerifyTypeIsSerializable(Type type) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope) at System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item) at System.Windows.Markup.Primitives.MarkupWriter.SaveAsXml(XmlWriter writer, MarkupObject item) at System.Windows.Markup.Primitives.MarkupWriter.SaveAsXml(XmlWriter writer, Object instance) at System.Windows.Markup.XamlWriter.Save(Object obj, TextWriter writer) at System.Windows.Markup.XamlWriter.Save(Object obj) at MS.Internal.Ink.ClipboardProcessor.CopySelectionInXAML(IDataObject dataObject, StrokeCollection strokes, List1 elements, Matrix transform, Size size)
at MS.Internal.Ink.ClipboardProcessor.CopySelectedData(IDataObject dataObject)
at System.Windows.Controls.InkCanvas.CopyToDataObject()
at System.Windows.Controls.InkCanvas.PrivateCopySelection()
at System.Windows.Controls.InkCanvas._OnCommandExecuted(Object sender, ExecutedRoutedEventArgs args)
at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
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.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
at System.Windows.Input.KeyEventArgs.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.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
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.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
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()


[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.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
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.6.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.6.0
PresentationCore, Version=4.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
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
PropertyTools, Version=2012.4.14.1


[System Info]

Operating System
-Microsoft Windows 7 Ultimate
–CodeSet = 1252
–CSDVersion = Service Pack 1
–CurrentTimeZone = 480
–FreePhysicalMemory = 132248
–OSArchitecture = 32-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 1
–ServicePackMinorVersion = 0
–Version = 6.1.7601

Machine
-RUBEN-PC
–Manufacturer = Gigabyte Technology Co., Ltd.
–Model = M52L-S3P
–TotalPhysicalMemory = 2145968128
–UserName = ruben-PC\ruben

That error means his file was made on a newer version than you have installed. I see your using 4.1.73 try installing 4.1.74 then start it. It looks like its off by just 1 version according to number sequence in the error.

Thanks, got it working now…