콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
11471 화면

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?

아바타
취소
베스트 답변

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?

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.

관련 게시물 답글 화면 활동
12
12월 23
33006
0
7월 15
7739
0
3월 15
4538
0
3월 15
4038
0
5월 17
4519