Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong CTC in Salary Structure Assignment for case with Opening Balance (2 problems) #2468

Open
1 task done
kittiu opened this issue Nov 30, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@kittiu
Copy link
Contributor

kittiu commented Nov 30, 2024

PR: #2469

Information

We just start using Payroll starting Oct 2024, so in Salary Structure Assignment, we use Opening Balance to record Earning and Tax for Jan 2024 - Sep 2024

image

This way, for Salary Slipt in October, the CTC will include this amount too, which is correct.

image

However, on November, this person has salary raised from 10,000 to 15,000. And so, payroll user create new Salary Structure Assignment (create new, not copy)

image

As you can see, there is no Open Balance here, as my common sense think it was already on the previous SSA and already affect the CTC.

image

1st Problem, when create Salary Slip for November, now CTC is not including the opening banance (just salary from Oct to Dec)

image

OK, now, I know I need to go back SSA and do the copy so that the new SSA also have Opening Balance too (as I know the system will justuse the active SSA.

image

Now, when I create Salary Again for Nov 2024, the CTC is 130,000.00 will be valid. BUT....

2nd Problem, given there is nothing change on salary assignment, the Salary Slip for next year, Jan 2025 will also includes Opening Balance, which is wrong again.

image

The only way to fix this is to go back to the recent SSA and remove the Opening Balance....which no one will knows to do.

Inconclusion, I think the ways system works now is not reasonable.

Module

Payroll

Version

ERPNext: v15.42.0 (version-15)
Frappe Framework: v15.47.2 (version-15)
Frappe HR: v15.35.3 (version-15)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kittiu kittiu added the bug Something isn't working label Nov 30, 2024
@kittiu kittiu changed the title Opening Balances in Salary Structure Assignment is not reasonable (if not a bug) Opening Balances in Salary Structure Assignment is not reasonable (if not 2 bugs) Nov 30, 2024
@kittiu kittiu changed the title Opening Balances in Salary Structure Assignment is not reasonable (if not 2 bugs) Wrong CTC in Salary Structure Assignment for case with Opening Balance (2 bugs) Nov 30, 2024
@kittiu
Copy link
Contributor Author

kittiu commented Nov 30, 2024

Current Problem

As you can see, the above problems is from the way Opening Balance is retrieved, which is to get from the recent SSA.

image

Proposed Solution

get_opening_for() should,

  1. Only use the first active SSA that has Opening Balance
  • There can be many SSA as company wants to keep the historic records. I..e, SSA 2022, SSA 2023 (this on with opening), SSA 2024. System should always use SSA2023 which has the opening
  1. But return 0.0 when the salary slip is not in the first payroll period of this employee
  • Find the paryroll period of this salary slip
  • Find the payroll period of employee's first active salary slip
  • If both not same, then this is not the first payroll period of this employee and so return 0.0

@kittiu kittiu changed the title Wrong CTC in Salary Structure Assignment for case with Opening Balance (2 bugs) Wrong CTC in Salary Structure Assignment for case with Opening Balance (2 problems) Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant