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

fix(Employee Advance): check if return amount is set before validating #36080

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

ruchamahabal
Copy link
Member

Steps to replicate

  1. Create an Employee Advance
  2. Create a Payment Entry against the advance. The advance will be marked as Paid.
  3. Create an Expense Claim against the advance (paid advances are available for claim). The advance will be marked as Claimed.
  4. Cancel the payment entry created in step 2 (maybe for some correction in the reference number, etc.). Advance will be marked as Unpaid.
  5. Now try creating a payment entry against the unpaid advance. This throws a validation error regarding return amount:
image

This expression is True here:

flt(return_amount) > self.paid_amount - self.claimed_amount
= 0 > 0 - 5000

image

Fix

Check if the return amount is set before validating it.

Although canceling payment entry against an already claimed advance shouldn't be allowed IG. That's a separate discussion.

@ruchamahabal ruchamahabal merged commit beaf13e into frappe:version-13-hotfix Jul 11, 2023
frappe-pr-bot pushed a commit that referenced this pull request Jul 11, 2023
## [13.52.4](v13.52.3...v13.52.4) (2023-07-11)

### Bug Fixes

* also check on_hold ([#35910](#35910)) ([5aa02b8](5aa02b8))
* circular dependency during reposting causing timeout error ([ba69be1](ba69be1))
* **Employee Advance:** check if return amount is set before validating ([#36080](#36080)) ([beaf13e](beaf13e))
* error messages while evaluating formulas and handle line boundaries ([#35989](#35989)) ([4af57a7](4af57a7))
* gst_hsn_code is ambiguous on gst reports ([3a00052](3a00052))
* incorrect status in MR created from PP (backport [#36085](#36085)) ([#36087](#36087)) ([e05bb10](e05bb10))
* payment entry `voucher_type` error ([#35779](#35779)) ([9c3ec41](9c3ec41))
* **Payment Entry:** compare rounded amount ([#36011](#36011)) ([b04c190](b04c190))
* precision causing outstanding issue on partly paid invoices ([#36030](#36030)) ([cf3ec93](cf3ec93))
* single column indexes ([#32425](#32425)) ([53f7764](53f7764))

### Reverts

* Revert "perf: improve item wise register reports (backport #35908) (#35912)" ([b992366](b992366)), closes [#35908](#35908) [#35912](#35912)
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 13.52.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants