One of our client have a scenario where some of their employees could be working on different pay-scale (contract) at different periods in the same month. So while generating payslip, their salary should be calculated from two different contracts, based on the time they spent in respective projects which will be updated in the timesheet. This is a typical scenario for manpower supply companies in middle-east. Can anybody please tell me how to implement this in openerp or if there is already a functionality available in openerp for this
You can implement this in Odoo 10 like so:
Define multiple contracts for the employees concerned. For example, for a particular employee you might have a "NORMAL" hourly wage of $12/hour and a "SPECIAL" hourly wage of $18/hour (e.g. overtime hours).
Create a salary rule for normal hours. The python code will be something like worked_days.NORMAL.contract_id.wage * worked_days.NORMAL.number_of_hours
Create a salary rule for special hours. The python code will be something like worked_days.SPECIAL.contract_id.wage * worked_days.SPECIAL.number_of_hours
You can optionally have one salary rule incorporating (adding) the two relations above, depending on whether you want to display the normal and special pay separately on the payslip or not.
Create a salary structure incorporating the rules above and other desired rules.
While creating the payslip, create two inputs under Worked Days like so (a) an input with code "NORMAL" linked to the normal contract and (6) another input with code "SPECIAL" linked to the special contract. On the payslip, be sure to select a Contract (any of the ones defined for the employee) and the right Salary Structure, to get the right calculations.
Check that everything else is fine and click on "Compute Sheet".