Okay, so, in existing stuff that we wish to migrate to Blesta, we have line items, and every line item can have its own discount. And if the amount of a thing changes (something like storage usage or bandwidth), discounts apply to that change.
In Blesta, the only discounting option I'm seeing is coupons. Coupons apply per-package, so I can't have one discount rate for one line item, and another discount rate for another.
But possibly more concerningly, coupons are applied instantaneously at the time of invoice creation, and don't adjust to reflect future changes to the invoice. There's some data gathering that's gonna take time to get properly integrated/automated, meaning in some cases we'll want to edit an invoice to change the quantity of an item. But if the item's discounted, this... doesn't work.
So what I'm looking for is an alternative path. I think I could make a plugin which adds a table that can record discount rates associated with services, or individual line items... But I don't see any obvious way to then override an invoice's calculations about how much it thinks is owed. I suppose I could do it the other way around, and have the plugin do the computation and set price overrides, maybe?
Basically, I don't understand the architecture well enough to be sure even what I should be asking. My ideal goal would be, when creating a service subscription, to be able to enter a discount percentage for each line item separately (say, addons within a package, one customer could get 20% off package option A and 25% off option B, another could get 30% off A and 0% off B, so discounts are unique to a specific customer/option pair), and any edits to the invoice that affect quantities would still correctly reflect the discount.
I'm pretty sure that the coupon system is entirely irrelevant to the intended use case here, honestly; it's at the wrong granularity and it's a one-time computation. But I don't immediately see any hooks in the plugin architecture to let me override an invoice's computation of totals.
Question
seebs
Okay, so, in existing stuff that we wish to migrate to Blesta, we have line items, and every line item can have its own discount. And if the amount of a thing changes (something like storage usage or bandwidth), discounts apply to that change.
In Blesta, the only discounting option I'm seeing is coupons. Coupons apply per-package, so I can't have one discount rate for one line item, and another discount rate for another.
But possibly more concerningly, coupons are applied instantaneously at the time of invoice creation, and don't adjust to reflect future changes to the invoice. There's some data gathering that's gonna take time to get properly integrated/automated, meaning in some cases we'll want to edit an invoice to change the quantity of an item. But if the item's discounted, this... doesn't work.
So what I'm looking for is an alternative path. I think I could make a plugin which adds a table that can record discount rates associated with services, or individual line items... But I don't see any obvious way to then override an invoice's calculations about how much it thinks is owed. I suppose I could do it the other way around, and have the plugin do the computation and set price overrides, maybe?
Basically, I don't understand the architecture well enough to be sure even what I should be asking. My ideal goal would be, when creating a service subscription, to be able to enter a discount percentage for each line item separately (say, addons within a package, one customer could get 20% off package option A and 25% off option B, another could get 30% off A and 0% off B, so discounts are unique to a specific customer/option pair), and any edits to the invoice that affect quantities would still correctly reflect the discount.
I'm pretty sure that the coupon system is entirely irrelevant to the intended use case here, honestly; it's at the wrong granularity and it's a one-time computation. But I don't immediately see any hooks in the plugin architecture to let me override an invoice's computation of totals.
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.