Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. POS discount headache

POS discount headache

Scheduled Pinned Locked Moved Design and Architecture
salesdesignquestion
8 Posts 5 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dazfuller
    wrote on last edited by
    #1

    Hi, I'm currently writing an internal system at my employer which handles sales and we need to handle discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations. Has anyone come across trying to design a solution for this before and how did you get started? Thanks

    L O A 3 Replies Last reply
    0
    • D dazfuller

      Hi, I'm currently writing an internal system at my employer which handles sales and we need to handle discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations. Has anyone come across trying to design a solution for this before and how did you get started? Thanks

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      RavensCry wrote:

      for this

      RavensCry wrote:

      discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations.

      *sigh* Geez maybe you should put that in as your Google search phrase, what could go wrong?

      D 1 Reply Last reply
      0
      • D dazfuller

        Hi, I'm currently writing an internal system at my employer which handles sales and we need to handle discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations. Has anyone come across trying to design a solution for this before and how did you get started? Thanks

        O Offline
        O Offline
        originSH
        wrote on last edited by
        #3

        Yep, I worked on an epos system a few years ago. The way we did it was to find out each 'type' of discount scheme they wanted i.e. Buy one get one free, collection of specific products for specific price. We couldn't think of a way to do it dynamically at the time so we just coded each seperate type, and yeah that was a lot of work :P

        D 1 Reply Last reply
        0
        • L led mike

          RavensCry wrote:

          for this

          RavensCry wrote:

          discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations.

          *sigh* Geez maybe you should put that in as your Google search phrase, what could go wrong?

          D Offline
          D Offline
          dazfuller
          wrote on last edited by
          #4

          Probably should have mentioned that I'd done that already and couldn't find any useful leads, I wouldn't dare think of posting here without doing a Google search first :)

          1 Reply Last reply
          0
          • O originSH

            Yep, I worked on an epos system a few years ago. The way we did it was to find out each 'type' of discount scheme they wanted i.e. Buy one get one free, collection of specific products for specific price. We couldn't think of a way to do it dynamically at the time so we just coded each seperate type, and yeah that was a lot of work :P

            D Offline
            D Offline
            dazfuller
            wrote on last edited by
            #5

            We've just had one idea about holding all the discount scheme's in an XML file with a description of how to determine if the discount applies but haven't gotten as far as figuring out how to load the code in or if it's even practical yet. So something like this: <discount> <discount:Template> <rules> <rule> <name>Rule1</name> <value>IsSubscriber(id)</value> </rule> ... </rules> </discount:Template> <discount:Query> <![CDATA[ bool param1 = {Rule1}; bool param2 = {Rule2}; double fee = GetStandardFee; if (param1 && param2) { fee = fee * 0.6; } return fee; ]]> </discount:Query> </discount>

            L 1 Reply Last reply
            0
            • D dazfuller

              We've just had one idea about holding all the discount scheme's in an XML file with a description of how to determine if the discount applies but haven't gotten as far as figuring out how to load the code in or if it's even practical yet. So something like this: <discount> <discount:Template> <rules> <rule> <name>Rule1</name> <value>IsSubscriber(id)</value> </rule> ... </rules> </discount:Template> <discount:Query> <![CDATA[ bool param1 = {Rule1}; bool param2 = {Rule2}; double fee = GetStandardFee; if (param1 && param2) { fee = fee * 0.6; } return fee; ]]> </discount:Query> </discount>

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              RavensCry wrote:

              how to load the code in

              interface and factory

              RavensCry wrote:

              or if it's even practical yet.

              Yes it is

              R 1 Reply Last reply
              0
              • D dazfuller

                Hi, I'm currently writing an internal system at my employer which handles sales and we need to handle discount schemes which are subscriber, customer, purchased based and with some weird and wonderful variations. Has anyone come across trying to design a solution for this before and how did you get started? Thanks

                A Offline
                A Offline
                amit arora
                wrote on last edited by
                #7

                HI , I had worked on something similar like this , in our case the promotions were flowing from SAP ( eg : buy one get one free , combo , etc ) .There were combination of 5-6 of these ,which covers nearly most of the promotions which are given mostly at POS , so we coded each of them . amit

                1 Reply Last reply
                0
                • L led mike

                  RavensCry wrote:

                  how to load the code in

                  interface and factory

                  RavensCry wrote:

                  or if it's even practical yet.

                  Yes it is

                  R Offline
                  R Offline
                  Robson Felix
                  wrote on last edited by
                  #8

                  Well, I've done POS systems in the past - my first one was probably 13 years ago, in Clipper - and what I would do is create a hierarchy database of formulas that should be evaluated according to the chain of events in your hierarchy. You can use that not only to discounts, but to other stuff. I come from Brazil and we're know to have the most complex tax systems in the world (do a search on Google and you would understand what I am talking about - even SAP has an engine specifically created to work with our out-of-this-world tax rules). So, on the top of hierarchy you would have the more general items (for example, State, if you want people from out of state to have a different discount, for example) and go down the "tree". The formula you're going to use is the one that goes to the utmost item (further down the tree). Then you can use any expression evaluator available in the internet (there are tons of them for C# and other languages). You can even create your own language - supporting IF statements, for example - to accomplish more complicated tasks. I've done this successfully in a pretty interesting project in the company I currently work for. Hope this helps. Robson Siqueira Enterprise Architect

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups