Jump to content

Anyone done much with Core/Pricing?


seebs

Recommended Posts

So I'm trying to add a thing allowing discounts to be incorporated into services, line items, etcetera. A discount is a percentage discount multiplier, which is not a coupon or coupon code. It applies to a single specific line item, and it's a percentage multiplier that stays a distinct feature of the line, rather than being turned into a separate line item with a fixed dollar value. And I have this working for a lot of stuff, but services continue showing unmodified values.

On study, it appears that services, and services alone (??), are using an entire new pricing infrastructure, Core/Pricing, which has things like UnitPrice and ItemPrice and so on.

Concern #1: It doesn't appear universally true that a service's computed price total will match the computed price total for a generated invoice. Even without the new feature I added to invoices, there's simply no guarantee that the math will be identical. Invoices are, in current Blesta (without my patch) computing the sum in SQL, not in PHP, so there's no real control over the rounding, etc, going on. For items with many package items with sub-cent prices, or pro-ration, I could see this producing unexpected values.

Concern #2: I am not very clear on how I'd have to modify this to add a different kind of discount, where the discount is a per-item value innate to the item, not associated with a coupon, but I really want to.

But once you get into the coupons, and taxes, and so on, it worries me that so far as I can tell, there's two completely independent implementations of all the pricing logic now. Unless all the old stuff is deprecated and I failed to spot that in comments. But I know that my discount code which modifies invoices/services/etc. appears to work for everything else in the system, just not for the costs shown in service editing or service lists. So I'm guessing nothing else is using this yet.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...