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

refactor(UX): Salary Slip creation and submission via background job in Payroll Entry #31074

Merged
merged 12 commits into from
Jun 2, 2022

Conversation

ruchamahabal
Copy link
Member

Problem:

  • If Salary Slips to be created/submitted via a Payroll Entry are > 30, a job is queued for the operation.
  • While running payroll there are a couple of configurations and setups validated like accounts linked against salary components, the correctness of component formulae in the structures, etc.
  • If salary slips are less than 30, such errors are shown right away. For queued jobs, the creation/submission fails without showing any error to the user and most of the errors here are configuration level errors.
submission-before.mp4

Solution

  • Add a status field to Payroll Entry: Draft/Queued/Failed/Submitted/Cancelled

  • Inform the user that the creation/submission is queued

    image
  • On failure, show the error message for corrective actions within the payroll entry

    failure-correction.mp4

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label May 19, 2022
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #31074 (956a803) into develop (77dcdff) will increase coverage by 0.20%.
The diff coverage is 85.36%.

@@             Coverage Diff             @@
##           develop   #31074      +/-   ##
===========================================
+ Coverage    63.25%   63.46%   +0.20%     
===========================================
  Files          986      986              
  Lines        67372    67406      +34     
===========================================
+ Hits         42619    42781     +162     
+ Misses       24753    24625     -128     
Impacted Files Coverage Δ
...ext/payroll/doctype/payroll_entry/payroll_entry.py 77.49% <85.36%> (+5.05%) ⬆️
erpnext/accounts/doctype/bank/bank.py 71.42% <0.00%> (-14.29%) ⬇️
...rial_no_valuation/incorrect_serial_no_valuation.py 85.96% <0.00%> (-10.53%) ⬇️
...pnext/stock/doctype/delivery_note/delivery_note.py 66.21% <0.00%> (-2.71%) ⬇️
erpnext/portal/utils.py 27.69% <0.00%> (-1.54%) ⬇️
erpnext/stock/report/stock_ledger/stock_ledger.py 84.92% <0.00%> (-0.80%) ⬇️
erpnext/stock/doctype/batch/batch.py 83.33% <0.00%> (-0.62%) ⬇️
erpnext/stock/report/stock_ageing/stock_ageing.py 95.19% <0.00%> (-0.49%) ⬇️
...xt/e_commerce/doctype/website_item/website_item.py 47.52% <0.00%> (-0.42%) ⬇️
erpnext/payroll/doctype/salary_slip/salary_slip.py 86.63% <0.00%> (-0.26%) ⬇️
... and 24 more

@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch 4 times, most recently from af0b1c8 to 1d3427c Compare May 31, 2022 08:47
@ruchamahabal ruchamahabal removed the needs-tests This PR needs automated unit-tests. label May 31, 2022
@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch 2 times, most recently from 4a18102 to 3593277 Compare June 1, 2022 06:38
@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch from d543eb9 to 653d634 Compare June 1, 2022 06:44
@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch from 924a1be to 247c6a2 Compare June 1, 2022 08:43
@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch 2 times, most recently from 91deb8c to 3e28f9e Compare June 2, 2022 09:35
- remove savepoints since submission should stop if any error occurs

- refactor variable naming and msgprints

- test Salary Slip creation failure

- fix(test): explicitly commit after payroll entry creation so that the first salary slip creation failure does not rollback the Payroll Entry insert
@ruchamahabal ruchamahabal force-pushed the fix-salary-slip-bg-job branch from 3e28f9e to d641f26 Compare June 2, 2022 09:39
@ruchamahabal ruchamahabal marked this pull request as ready for review June 2, 2022 12:11
@ruchamahabal ruchamahabal merged commit 12edddb into frappe:develop Jun 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant