how can I configure the order creation process to have the product quantity calculated automatically based on a value I input? Generally, when creating a sales order, directly input the qty of items is needed. However, in my use case I sell plank, where each plank covers 0.238 square meters, customers will tell me how much square meters of plank they need. Since planks cannot be divided, I need to
Calculate the corresponding number of planks required
Round up to the nearest whole number to obtain the actual quantity to be sold
Use this plank count to determine the actual square meters being sold
Multiply by the price per square meter to calculate the total amount
I want to know how can I let erpnext calculate the actual square meters will be sold according to the square meters I input. Any advice will be greatly appreciate.
Thanks for your advice, I tried, but it didn’t work for my use case. I created an item named ‘plank’, set ‘Nos’ (which must be a whole number) as the default UoM, and added ‘SQ Meter’ with the conversion fraction set to 1/0.238. Then, I added the sale price for ‘plank’ with both ‘SQ Meter’ and ‘Nos’. However, when I created a sale order and entered ‘SQ Meter’ for ‘plank’, the ‘QTY as per stock’ field still showed a fractional number.
I’m not an expert in this workflow. Perhaps others can chime in. It looks like you may need a custom script to update the quanty sold by the conversion factor to bring stock UOM to a whole number.
After trying custom script, I find out a workaround solution.
set the plank default UoM as SQ Meter, and selling UoM as Nos. Then added the following client script to erp system. Then, every item belonging to plank category or it’s descendant category when it’s added to sales order items, the script will automatically transform the inputted SQ Meter qty customer wanted Nos qty.