Skip to Content
Menu
This question has been flagged
1 Reply
2685 Views

I want to calculate payslip batch where I take the end date of the contract and if the contract is finished then I calculate the payslip based on the final date of the contract, at this time if I calculate a payslip bacth for example from 1/11/18 to 11/30/18 and the employee's contract ended on 11/15/18 the payslip calculates it all month instead of calculating it until the end date of hes contract

same thing happens when I just hired someone instead of taking the start date of the contract it takes the payslip bacth dates. so if I hire someone on 15/11/18 but the payslip batch date is from 1/11/18 to 30/11/18 it will make as if the employee started working on the 1/11/18 and will pay the entire salary

Help please.

Avatar
Discard
Best Answer

Try this code with your details:

<record id="hr_payroll.hr_rule_basic" model="hr.salary.rule">
  <field name="name">Salary</field>
  <field name="code">BASIC</field>
  <field name="category_id" ref="hr_payroll.BASIC"/>
  <field name="sequence" eval="10"/>
  <field name="amount_select">percentage</field>
  <field name="amount_percentage_base">worked_days.WORK100.number_of_hours * (contract.wage / 160)</field>
  <field name="amount_percentage">100.00</field>
</record>
Avatar
Discard