Some good questions there Mark.
OK, so we are a motor manufacturer that put a lot of new vehicles on the roads through contracts. After the contracts end the vehicles come back to us. We remarket them and sell them to the dealership network at trade prices (which in turn are sold by the dealerships to consumers at retail prices).
Bonuses programmes are in place obviously to incentivise the dealerships to buy more used vehicles from us than other sources. Bonuses are paid on a per-vehicle basis as long as certain requirements are met for the period. If the dealership does not meet the requirements in that period then none of that bonus is paid on
any vehicle.
For example if a dealership target was 100 vehicles at £150 per vehicle... 99 vehicles purchased = £0 in dealership bonus, and 100 vehicles = £15k in dealership bonus.
We want the database reporting tool to be able to generate a one-page report per dealership summarising their qualifying purchases, how much bonus they have earned in the period so far, and how many more vehicles they need to purchase to reach the next level (in the example above, it would be very incentivising to outline that just one more purchase could earn you £15k extra).
Now when I originially created this database there were two types of bonuses: a 'target' bonus and 'ladder' bonus. Hence my naming convention was TB = TargetBonus, LB = LadderBonus, AB = AllBonus. The rest of my naming convention is based around the
Leszynski naming convention.
The target bonus is a simple "buy X amount of vehicles in Y period" with several targets per dealer, with higher amounts of bonus per vehicle for the higher targets.
The ladder bonus was a complicated accumulator-type bonus with loads of different additional earnings based on which vehicle models the dealer purchased and loads of overlapping periods etc. It was very difficult for the dealerships to keep track of how much bonus they would earn per vehicle in any one month and thus to work out exactly the margin they would make by reselling their vehicles.
This year the ladder bonus was scrapped, the overlapping periods were scrapped, and there was put in place one simple multi-level target bonus with one cyclic period. I started to redesign the database around this. However, one of our brands has yet to catch up with implementing this new bonus scheme and still operates two separate bonus schemes with overlapping periods which needs to be incorporated into the database. Luckily it's not the ladder bonus but it is still a pain in th-- I mean: it still requires some extra development time.
Regarding
tblAB_Periods, yes
MinDate and
MaxDate are the boundaries for each period. However, they are structured 'unique' periods such as 2018-Q1 (quarters), 2018-T1 (trimesters), and 2018-H1 (half-years) and each BonusID will only use one type of period.
Regarding the parameters, yes everything is stored in other tables. The parameters will be changed as new periods come into effect and we set different individual targets and bonus reward amounts. I will not be the end-user of this database so all the parmeter settings will be done in the GUI / userforms created towards the end of the project. For now, I just need the whole thing to work properly with all the differing rules, and indeed the proper structure in place to allow for easy expansion.
---
In other news currently there is one issue that I'm not certain I am solving in the best way. For the catch-up brand's Quarterly bonus there are flat target volumes that apply to every dealership. The first 3 levels are, for lack of a better word, 'overwriting' in that once you reach level 1 the level 1 bonus amount applies to all vehicles; once you reach level 2 the level 2 bonus amount applies to all vehicles (replacing the level 1 bonus amount); up to level 3. However level 4 is 'additional exclusive' in that all vehicles purchased up to level 3 have level 3 bonus applied, but all vehicles purchased at level 4 and above have just the level 4 bonus applied.
For example, let's say that level 2 is 50-74 purchases @ £100pv, level 3 is 75-99 purchases @ £200pv, and level 4 is 100+ purchases @ £300pv.
A dealership purchasing 60 vehicles would be earning £6k (£100pv).
A dealership purchasing 80 vehicles would be earning £16k (£200pv).
A dealership purchasing 120 vehicles would be earning £26.1k (£200pv on 99 vehicles and £300pv on 21 vehicles).
At the moment I have two separate
BonusIDs for "QuarterlyBase" (levels 1-3) and "QuarterlyAdditional" (level 4) and
tblTB_VolumeTargets_FlatVol set up with
BonusPaymentID,
MinVol,
MaxVol. The idea is that if the dealership volume maxes out the QuarterlyBase then the bonus amount will equal
MaxVol of the max level multiplied by that level's bonus amount, PLUS the single level of QuarterlyAdditional minus its
MinVol multiplied by the bonus amount. Does that make sense? I'm not sure if there's a better way to do it than to split it into two bonuses and do a custom calculation.
For the example of 120 purchases... (99 * 200) + [(120-99) * 300] = 26100.
Apologies for the wall of text
