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

feat: Auto set Party in Bank Transaction (backport #34675) #35802

Closed

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 20, 2023

This is an automatic backport of pull request #34675 done by Mergify.
Cherry-pick of eb1db5e has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is up to date with 'origin/version-14-hotfix'.

You are currently cherry-picking commit eb1db5eaa3.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 752a92b has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 752a92bd8b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.json
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py
	both modified:   erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of dbf7a47 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit dbf7a479b6.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/buying/doctype/supplier/supplier.json
	both modified:   erpnext/selling/doctype/customer/customer.json

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 4a14e9e has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 3 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 4a14e9ea4e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 4364fb9 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 4 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 4364fb9628.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/accounts_settings/accounts_settings.json
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.json

Cherry-pick of 7ed8f59 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 5 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 7ed8f59dc8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both added:      erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 430b247 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 6 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 430b247dfc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/shareholder/shareholder.json

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of aea4315 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 7 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit aea4315435.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/accounts_settings/accounts_settings.json
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of d7bc192 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 8 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit d7bc192804.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 37c1331 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 9 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 37c1331aba.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 27ce789 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 10 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 27ce789023.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.js
	deleted by us:   erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.json
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.json
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py
	both modified:   erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 3360455 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 11 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 33604550ce.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of ad31e02 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 12 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit ad31e02616.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py
	modified:   erpnext/setup/doctype/employee/employee.json

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.json
	both modified:   erpnext/accounts/doctype/shareholder/shareholder.json
	both modified:   erpnext/buying/doctype/supplier/supplier.json
	both modified:   erpnext/selling/doctype/customer/customer.json

Cherry-pick of e774503 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 13 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit e7745033df.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   erpnext/accounts/doctype/bank_party_mapper/__init__.py
	new file:   erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.py
	new file:   erpnext/accounts/doctype/bank_party_mapper/test_bank_party_mapper.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both added:      erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.js
	both added:      erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.json
	both added:      erpnext/accounts/doctype/bank_transaction/auto_match_party.py
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.json
	both modified:   erpnext/accounts/doctype/bank_transaction/bank_transaction.py
	both modified:   pyproject.toml

Cherry-pick of 3a89828 has failed:

On branch mergify/bp/version-14-hotfix/pr-34675
Your branch is ahead of 'origin/version-14-hotfix' by 14 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 3a898289b0.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/accounts/doctype/bank_transaction/auto_match_party.py

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

(cherry picked from commit eb1db5e)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py
- Matching by Acc No/IBAN can easily happen with Bank Accounts. It's not a tedious query
- Historical lookups for  Party Name/Desc match are very tricky. The user could have manually set a match and we would not know. Also this leaves the Bank Party Mapper only useful for Party Name/Desc lookups, which feels excessive.
- We want to reduce the number of places the same data is stored and reduce confusion
- The Party Name/Desc will optionally happen fuzzily, or not at all
- There will be no Mapper lookups

(cherry picked from commit 752a92b)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
#	erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py
- Remove newly added fields in Party doctypes to store bank details
- Use Bank Account's fields to match against account no/iban
- For employee, if Bank Account does not exist, find in Employee doctype against account no/iban

(cherry picked from commit dbf7a47)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/buying/doctype/supplier/supplier.json
#	erpnext/selling/doctype/customer/customer.json
(cherry picked from commit 4a14e9e)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py
…ches

- Fuzzy matching can be enabled optionally in the settings
- If a query gets multiple matches with the same score, do not set a party as it is an extremely close call
- misc: Add 'cancelled' status to Bank transaction
- Test for skipping matching with extremely close matches

(cherry picked from commit 4364fb9)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
(cherry picked from commit 7ed8f59)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py
(cherry picked from commit 430b247)

# Conflicts:
#	erpnext/accounts/doctype/shareholder/shareholder.json
- Checkbox in Accounts settings "Enable Automatic Party Matching"
- Check before invoking automatching methods
- misc: Remove TODO comments

(cherry picked from commit aea4315)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
- A BT could have both account and iban, and a Supplier could have only IBAN set
- In this case, matching by either (only account) gives no match
- Match by Account OR IBAN, use `or_filters`
- If matched, set both account no. and IBAN in Bank Party Mapper

- Explain AutoMatchParty
- Add type hints to return values
- Use `set_value` to set values in BT after matching since its an after submit event

(cherry picked from commit d7bc192)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
…tion

- Description is volatile and will keep changing
- It will lead to multiple Bank Party Mapper docs for the same party that will never be referenced again
- Parts of the descripton keep changing which is why it will never match a mapper record
- If matched by desc, dont create mapper record.

(cherry picked from commit 37c1331)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
- On updating bank trans.n party after submit, the corresponding mapper doc will be updated too
- The mapper doc in turn will update all linked bank transactions that do not have this updated value
- Added Bank Party Mapper hidden link in Bank Transaction
- Rename field in BPM to `Party Name` as it does not hold description data
- If a BT matches with a BPM record, link that record in the BT

(cherry picked from commit 27ce789)

# Conflicts:
#	erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.js
#	erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.json
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
#	erpnext/accounts/doctype/process_payment_reconciliation_log/process_payment_reconciliation_log.py
- misc: Clearer naming

(cherry picked from commit 3360455)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
…ployee/Shareholder)

(cherry picked from commit ad31e02)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
#	erpnext/accounts/doctype/shareholder/shareholder.json
#	erpnext/buying/doctype/supplier/supplier.json
#	erpnext/selling/doctype/customer/customer.json
- Created Bank Party Mapper
- Created class to auto match by account/iban or party name/description(fuzzy)
- Automatch and set in transaction or create mapper
- `rapidfuzz` introduced

(cherry picked from commit e774503)

# Conflicts:
#	erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.js
#	erpnext/accounts/doctype/bank_party_mapper/bank_party_mapper.json
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
#	pyproject.toml
(cherry picked from commit 3a89828)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
@mergify mergify bot added the conflicts label Jun 20, 2023
@marination marination closed this Jun 20, 2023
@mergify mergify bot deleted the mergify/bp/version-14-hotfix/pr-34675 branch June 20, 2023 09:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant