I have multiple vendors making gadgets.
These vendors sell these gadgets to a distributor (running Jiwa), who on-sells them to resellers, who on-sell them to consumers.
To keep it interesting, these vendors each offer a range of discount programs for resellers, with the distributor expected to honour the discounts those resellers have signed up for (with the vendor).
Thus, any given reseller may be participating in many discount programs. Possibly even more than one per vendor (a vendor might have multiple product lines, with different lines having different discount programs).
I need to be able to sign up a single debtor to multiple different 'discount programs'.
I'm leaning towards adapting the "List Maintenance" sample plugin to add a "reseller discount programs" list onto the Debtor Maintenance 'Financials" tab - where the 'widgets' being added to a debtor are Debtor Pricing Groups (i.e. the lookup table for things you can put into the list).
I will then adapt the price group matrix stored procedure to incorporate the new custom table (augment the "-- Debtor Group is linked to @DebtorID" bits).
And just in case I wasn't entertained enough - the discount programs I'm immediately dealing with have different discount rates for different product lines within the vendor's suite of products, so I will be building up the (currently unused) group matrix pricing table.