unit price caluclation in different way

lallylally Member Posts: 323
Hi,

I got a problem to define unit price for an item. Our client manufacturing water pipes. In generally we in sales order or purchase order we caluclate unit price per KG, Per MT(metric tone),per Box, per PCS........like that we caluclate. But our client calucate their unit price per 1000 pipes.I will explain.

Item Pipe
qty 123000
uom pcs
Unit price 445.00(per1000 pcs)
amount 54735(123*445)
why (123*445)because in 123000 u have 123 thousands (123*1000)=123000.
Finally what clent is asking when enter qty, unit price per 1000pcs in sales order he needs to get line amount.
how to sove this issue.

i think u may give advise that is in item unit of measure u can define some x=1000pcs. Then u can enter 123in qty in uom x then u can caluclate easily. I know this solution.but they dont want like that. And they dont want to enter per piece rate also.they enter only per1000pcs.
because they sell like 123456 pcs, 456789 pcs,987654 pcs......
that 's y they caluclate per 1000.
please provide solution how to solve this issue.
finally what my problem is just i enter qty , uom, unitprice(per1000 pcs).i need to get line amount.
please provide solution.
thanks in advance.
lally

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Create a new unit price field in the table. This field you put on the form. You hide the other field (or even remove it from the form).
    In the table you put some code in the OnValidate-trigger that puts the Navision price into the standard Navision Unit Price field.
    Something like :
    VALIDATE("Unit Price","Unit Price per 1000" / 1000);
    
    In this way, the user keeps his quantity in pieces and can fill in the unit price per 1000.
    Be careful to do some testing with the rounding!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • lallylally Member Posts: 323
    Thanks Kriki,

    I am very glad to got the answer from u (Kriki(MODERATOR))for me at first time.I would like to say special thanks to u.
    Thanks for u r solution . But i forgot to put one more problem to my query.Actually we used that above process for some customers.Our client has 344 customers in india. our client follow above process what i mentioned above for 198 customers.For remaining customers client uses per KG ,Per MT(metric tone),Per piece.......like that.
    If i put that Unit price field in report what u told above, what about remaining customers unit price.U know they cannot go to designer mode.
    But i dont know much about coding. But my advise is i will put one field which is option. In that option field put two codes X, Y.
    Then if select customer , X code in sales header i want get unit price like waht u told.
    if select customer, Y code in sales header it should update unit price per kg, per piece.....
    So finally u should u have two fields in report. But it should overwrite when client select customer code, X code.

    So I dont know much coding. Please provide solution for me.
    I hope u will provide solution.
    Thanks in advance.
    lally
  • krikikriki Member, Moderator Posts: 9,110
    First another question:
    Is it possible that a customer uses tons for 1 item and then meters for another item?
    The implementation depends largely on your answer to this question.

    In short : if a customer uses ALWAYS the same UoM for ALL items, you can put it on the customer card. If this is not the case, you need to keep a UoM per item per customer.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • David_CoxDavid_Cox Member Posts: 509
    lally wrote:
    Hi,
    i think u may give advise that is in item unit of measure u can define some x=1000pcs. Then u can enter 123in qty in uom x then u can caluclate easily. I know this solution.but they dont want like that. And they dont want to enter per piece rate also.they enter only per1000pcs.
    because they sell like 123456 pcs, 456789 pcs,987654 pcs......
    that 's y they caluclate per 1000.

    This is still the best way but there is a work around.

    You will need to do some small code changes at table level and good testing, but you then could do this by adding the quantity base fields, to the form, reports etc:
    Look at the Quantity (Base) Field, from this calculate the Quantity, from the Qty. Per Unit of Measure

    123456 would then validate Quantity as 123456 / 1000 = 123.456
    Quantity (Base) - OnValidate()
    //Existing Code
    TESTFIELD("Qty. per Unit of Measure",1);
    VALIDATE(Quantity,"Quantity (Base)");
    
    //New Code
    TESTFIELD("Qty. per Unit of Measure");
    VALIDATE(Quantity,ROUND("Quantity (Base)"/"Qty. per Unit of Measure",0.00001));
    

    This could also be a new field that you add yourself, so you do not change the standard code.

    The Validate will run the Quantity trigger code and give correct line values



    David
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
Sign In or Register to comment.