Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

HR Payroll salry calculation based on inputs field

By
Atul Kumar jain
on 8/12/15, 2:03 PM 635 views

Hello ,


I am calculating salry based on  this rule but can someone tell me whats wrong with this code


        result = ((float("{0:.2f}".format(contract.wage/(inputs.MD and inputs.MD.amount)))*(inputs.TD and inputs.TD.amount))+    (float("  {0:.2f}".format(contract.wage/(inputs.MD and inputs.MD.amount)/8)*(inputs.OT and inputs.OT.amount)*1.25)))


even this code is working without using float


    result = ((contract.wage/(inputs.MD and inputs.MD.amount))*(inputs.TD and inputs.TD.amount))+((contract.wage/(inputs.MD and #inputs.MD.amount)/8.0)*(inputs.OT and #inputs.OT.amount)*1.25)


but there is differences in output  , i want to use first one

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/12/15, 2:03 PM
Seen: 635 times
Last updated: 8/16/15, 12:31 AM