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

Payroll: Fix accrued salary calculation #798

Merged
merged 2 commits into from
Apr 16, 2019

Conversation

facuspagnuolo
Copy link
Contributor

Accrued salary was being capped to max int if it there was an overflow. I'm splitting the way we calculate owed salary in order to:

  • Revert in case the employer tries to set a new salary when the owed salary amount could not be represented as accrued salary due to an overflow
  • Rescue capping to max int in case we are computing a payroll payment to allow employees withdrawing at least a portion of their owed salary

The rest of the scenarios (reimbursements and bonuses) will never overflow since those additions are being calculated with SafeMath.

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2019

CLA assistant check
All committers have signed the CLA.

@aragon aragon deleted a comment from coveralls Apr 16, 2019
@aragon aragon deleted a comment from coveralls Apr 16, 2019
@aragon aragon deleted a comment from coveralls Apr 16, 2019
@facuspagnuolo facuspagnuolo force-pushed the fix_set_employee_salary branch from 1ab5c07 to d5672b5 Compare April 16, 2019 16:17
@facuspagnuolo facuspagnuolo merged commit 475b883 into master Apr 16, 2019
@facuspagnuolo facuspagnuolo deleted the fix_set_employee_salary branch April 16, 2019 20:50
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
* Payroll: Fix accrued salary calculation

* Payroll: Improve casting when calculating last payroll date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants