Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Price breaks depending on quantity
09-30-2014, 05:06 AM,
Price breaks depending on quantity

is it possible to maintain several purchasing costs for one and the same article depending on quantities ("Price Breaks"), e.g.:

10 pcs: $5/ pc.
20 pcs: $4/pc.
50 pcs. $3/pc.

I tried to set up different prices for the same article with different quantities, but I got a key constraint error (because every article can only be set up once).

How could I set up the above example in both the purchase and the sales module?

Thanks a lot!
Just Core Business Inc.
09-30-2014, 05:19 AM,
RE: Price breaks depending on quantity
You can set this up in the sales side using the discount matrix. However, we don't have the functionality on the purchasing side
Phil Daintree
webERP Admin
Logic Works Ltd
09-30-2014, 05:46 AM,
RE: Price breaks depending on quantity
Hi Phil,

thanks a lot for clarifying.

On my end, it would certainly be "nice to have" (on the purchasing side), but it's not a "killer feature" either. Maybe that's an item for a "wishlist" Smile

Thanks again!

Just Core Business Inc.
05-18-2016, 06:54 PM,
RE: Price breaks depending on quantity
We would like to use WebERP for our electronics manufacturing purchasing hooked up with Octopart and this for us is certainly a killer feature as prices can vary widely across breaks of 10,100,1k pcs.

Phil - to implement purchasing price breaks in a WebERP database friendly way what would need to be done (and we can maybe have a tinker... Smile )
05-19-2016, 08:10 AM, (This post was last modified: 05-20-2016, 03:51 PM by phil.)
RE: Price breaks depending on quantity
Well this is really what the discount matrix is about ... if you get into a 100 prices the general price changes can get quite horrific. However, judicious use of discount matrices can make this whole nightmare much more manageable. The price increases and the discount % remains the same for all customers specific discount matrix set up ... change the 1 price and all customer prices after discount are updated .... VERY cool... but it needs discipline in marketing - yes VERY difficult for such types ... but when explained the virtues of this approach as a way to manage customer net pricing far out weigh the simplistic headline price changes and having a ridiculous number of prices to manage ... that you just can't!!
So more a management philosophy than a specific answer to your question - but I want webERP to be about best business practice. Yes you build in tools to work in a less efficient way.... but me not so interested sorry.

(edit: sorry was thinking about the sales price here)
Phil Daintree
webERP Admin
Logic Works Ltd
05-19-2016, 11:14 AM,
RE: Price breaks depending on quantity
There is a price matrix for each item now. Just check the select product interface.
I think it is each to extend this feature to purchasing side.
Thanks and best regards!


05-20-2016, 01:40 AM,
RE: Price breaks depending on quantity
This came up today at our company. I was considering altering the query on purchdata in PO_Items.php to include check on the Min Quantity field as a short term fix. Only select those where min qty >= qty on order line.
05-27-2016, 04:48 PM,
RE: Price breaks depending on quantity
(05-19-2016, 08:10 AM)phil Wrote: Well this is really what the discount matrix is about ...

Hey Phil any thoughts about the purchasing side of things ?
05-27-2016, 07:58 PM,
RE: Price breaks depending on quantity
It's not too hard to do this, but requires a few changes:

Firstly you need a new field in the purchdata table something like:

ALTER TABLE purchdata ADD COLUMN qtygreaterthan DOUBLE NOT NULL DEFAULT 0.0 AFTER price;

Then you need to change the primary key to include this field

ALTER TABLE purchdata ADD PRIMARY KEY (`supplierno`, `stockid` , `effectivefrom`, `qtygreaterthan`);

Then change the PurchData.php script to enable you to add values to this field. The only gotcha I found here was making sure you deal with the case where you are updating rather than inserting and the qtygreaterthan field was changing, but this is something of an edge case. So now I have data like this:

| supplierno | stockid | price | qtygreaterthan
| 412001 | CB11 | 100.0000 | 0 |
| 412001 | CB11 | 110.0000 | 100 |
| 412001 | CB11 | 120.0000 | 200 |

Then in PO_Items.php you need to alter the sql at about line 586 to be the following:

$SQL = "SELECT price,
MAX(purchdata.effectivefrom) AS latesteffectivefrom
FROM purchdata
WHERE purchdata.supplierno = '" . $_SESSION['PO' . $Identifier]->SupplierID . "'
AND purchdata.effectivefrom <=CURRENT_DATE
AND purchdata.stockid = '" . $ItemCode . "'
AND qtygreaterthan<'" . $Quantity . "'
GROUP BY purchdata.price,
ORDER BY latesteffectivefrom DESC,
qtygreaterthan DESC LIMIT 1";

This should now select the correct the price when you insert a new item. What it doesn't currently do is alter the price if you change the quantity on an order and then update. This obviously depends on the company workflow - should the person entering the order manually alter the price would you want that overridden?

There are a number of reports/inquiries that would then need to be altered but the above should be enough to get you going. If you want the full diff (it's way too big to post here) then contact me privately.

05-28-2016, 12:19 AM,
RE: Price breaks depending on quantity
I got around the issue of updating by adding a "Refresh Prices" button to POItems.php


Forum Jump:

Users browsing this thread: 1 Guest(s)