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: Set right party name in bank transaction #37299

Merged
merged 2 commits into from
Nov 4, 2023

Conversation

marination
Copy link
Collaborator

@marination marination commented Sep 29, 2023

Ref: #34675

Issue

  • The matching is done on employee_name, customer_name, supplier_name, etc.
  • But it also returns this value as the matched party's name and sets it in the Bank Transaction.
  • This works fine if the party's party_name and name fields are identical (the default for Customer and Supplier), but produces wrong data if the party is named by series (the default for Employee).
  • It doesn't fail, it just puts the party_name in the Bank Transaction's link field.
  • The problem surfaces when trying to reconcile the Bank Transaction
Screenshot 2023-09-29 at 4 38 33 PM

2023-09-29 16 43 53

Fix

  • Match using party_name but set party's docname in Bank Transaction
Screenshot 2023-09-29 at 4 39 55 PM

- If party name and docname are different, set the docname in Bank Transaction
@marination marination added the backport version-14-hotfix backport to version 14 label Sep 29, 2023
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Sep 29, 2023
@marination marination removed the needs-tests This PR needs automated unit-tests. label Sep 29, 2023
@marination
Copy link
Collaborator Author

Unrelated ecommerce test failures due to permission issues

Copy link
Collaborator

@barredterra barredterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marination I think we could get process.extract to handle the mapping of party_name to name. My approach would be to pass a list of tuples [(party_name, party), ...] and a custom preprocessor lambda choice: choice[0]. The result should then contain the index of the matched element, so we'll know exactly which one it was without searching the party names again.

Reference: https://maxbachmann.github.io/RapidFuzz/Usage/process.html#extract

@stale
Copy link

stale bot commented Oct 19, 2023

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Oct 19, 2023
… the result

- rapidfuzz accepts an iterable or a dict. dict input gives the dict key and value in the result
@marination
Copy link
Collaborator Author

@ruthra-kumar review? its a pretty small fix

Copy link
Collaborator

@barredterra barredterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM

@barredterra barredterra merged commit 539ff03 into frappe:develop Nov 4, 2023
10 of 11 checks passed
deepeshgarg007 added a commit that referenced this pull request Nov 8, 2023
…-37299

fix: Set right party name in bank transaction (backport #37299)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants