Dear All,
Have any of you encounter the need to display fraction in Navision? If so, how do you handle it?
I understand that the base unit of measure should be the smallest so that there is no need to use fraction. But, consider the following scenario:
if BOM item A, has 2 components, A1 and A2, with 1 each. This is no problem. But when the master carton C is also part of the component, and 3 A fit into 1 C, how would you handle this case?
The case is in the purchase planning, user need to know how much master carton to purchase if there is an order for 30 A.
if the BOM component setup to be like:
A
A1 1
A2 1
C 0.33 or best if can do 1/3.
then when we do the planning for the component level, we would know to purchase
A1 30
A2 30
C 30 *0.33 = 9.9 or best if can do 30*1/3 = 10
Any ideas?
Many thanks,
Laura
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The trick is knowing how many decimal places your number has. I would recommend rounding the number to something finite before doing your calculations.
So say we have 0.125 as our decimal. Since we have 3 decimal places our denominator will be 10^3 or 1000. Our numerator will be 0.125 * 1000 or 125. So now we have 125 / 1000.
Now we have to check if the number is reduced enough. So divide 1000 / 125. In this case we get an integer so it is not reduced. Our resulting answer is (125 / 125) / (1000 / 125) = 1/8. If it was not an integer then it could not be reduced anymore.
If you need sample code let me know, but try and figure it out from what I've provided. You can put the code in the OnFormat trigger of whatever textbox you are trying to show it in.
My Blog - nav.education
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
In this scenario the customer has an item X with 2 UOMs
UOM QTY UOM
CASE 1
PAIR 1/48 = 0.02083
now they break about the case which is the BUOM and take out 2 pairs for samples. They enter the line as 2/48 of a CASE which comes out as 0.04167
The system is unable to handle differences in certain situations so i would agree with Kines statement you would would have to be sure the resultant was exactly what you wanted you may find the decimal precision field on the item card helps you as it is mainly used in manafacturing
what our developer did was creating another field call "denominator" and have the user fill in the packing qty. And when doing the planning calcuation, we will always use qty / denominator, and always round up to integer.
Good thing the client does not mix the master cartons with different items. And you still need to purchase 1 master carton even if you only put 2 out of 3 quantities in there.
Thanks for all your inputs.
Laura