# Unit pricing depends on volume

This is a question concerning domains where people specify the quantity by piece when selling or buying an item. However, the money amount is to be computed according to the “size” of the item, not only the count.

For example, let our item be a “bag of salt” which by spec contains a constant amount, 3.21 Kg of salt. And let the price be 10 dollars per Kg. When entering a Purchase Order, it is desirable that the user enters the number of bags, rather than the number of Kgs. So the user for example would enter 2 bags (rather than 6.42 Kg). In this case, if the price per Kg is 10 dollars, I would like the Purchase Order DocType to compute the dollar amount as 2x3.21x10 = 64.20 dollars.

I know we can do it such that the user enters 6.42 Kg as the quantity, but that is very unnatural. The natural conduct as humans is to enter 2 bags, and then the system would do the calculations: Money Amount = number of bags times how many Kgs in a bag times the price per Kg. In theory, this should be possible if we can just make the system aware that a bag contains how many Kgs.

I hope the above can be done in ERPNext? I could not find the way myself and would appreciate any help.

We can add a new Item “Salt Bag 3.21 Kg” and set the price \$32.1 for 1 bag.

@almuallim you can do that . in the item you specify that the uom is kg . then mention the price of 1kg in the price list . now scroll down in the item itself to the uom table , here you can enter different uom such as bag . you specify how many kg is a bag in the conversion factor . now whenever you buy or sell you can chose to buy 2 bags and the system will do the math for you .

the system knows how many kgs in a bag and accordingly will change the rate when you change the uom.

2 Likes

`The most natural approach is to somehow give the system the weight of the bag` ->you can do this in the item page . please understand that ha you are asking for exists in the system .