POS discount headache
-
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
-
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
-
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
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
-
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?
-
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
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>
-
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>
-
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
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
-
RavensCry wrote:
how to load the code in
interface and factory
RavensCry wrote:
or if it's even practical yet.
Yes it is
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