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

How can I show sums of previous payslips on the payslip?

By
Torvald B. Bringsvor
on 8/22/13, 4:53 PM 2,531 views

By law, we are required to show sums on the payslip. So for example for gross pay you have to show the amount for this month, and then the sum for the whole year (including this month). The same applies for taxes too.

How can I do this in the payroll?

0
Laura Jarvenpaa
On 8/23/13, 6:17 AM

I think there is no direct way to do this but you can get it to appear in your payslip by defining a salary rule which sums up all previous payslips and after that add current months salary calculation

e.g. result = payslip.sum('GROSS', '2013-01-01', '2013-12-31') + GROSS (I haven't tested this but I have used sum function before and it works fine BUT it can sum up only payslips which status is "done" drafts are not included in this sum).

you can either hardcode the dates like in that example or give them as input values or for the latter date you can test if python's datetime object is available (haven't tested this with salary rules so can't be sure).

Another alternative is that you create your own module which shows payslip different way.

The payslip.sum seems to only take into account the current payslip. I want to sum up all payslips for 2013 for this employee. Is there some other method for that?

Torvald Baade Bringsvor, Torvald B. Bringsvor
on 9/18/13, 8:54 PM

It takes in account current and all APPROVED salaryslips after all there is no point in summing only current salary slip or salaryslips which are draft.

Laura Jarvenpaa
on 9/23/13, 1:27 AM

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/22/13, 4:53 PM
Seen: 2531 times
Last updated: 3/16/15, 8:10 AM