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: Advance payment against payment terms #34872

Merged
merged 1 commit into from Apr 16, 2023

Conversation

deepeshgarg007
Copy link
Member

@deepeshgarg007 deepeshgarg007 commented Apr 15, 2023

In a certain scenario explained below, allocation of payment against the payment terms was not possible.
Note: Please enable "Fetch Payment Terms from Order" in Accounting Settings for this to work

Define a Payment Term Template as follows and use it in a Purchase Order

image

Make an advance payment against the PO against the "Advance" payment term

Now make a Purchase Invoice against the order and allocate the earlier payment as advance

image

Issue 1: Payment terms amount are recalculated after deducting the advance paid, which it should not and keep the same as in order

Issue 2: Even a fully paid payment term showed up in in the Payment Entry against PI

image

This PR solves above mentioned issues

@github-actions github-actions bot added accounts needs-tests This PR needs automated unit-tests. labels Apr 15, 2023
@codecov
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Merging #34872 (7afcde2) into develop (7fabe62) will decrease coverage by 0.01%.
The diff coverage is 86.66%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #34872      +/-   ##
===========================================
- Coverage    63.87%   63.86%   -0.01%     
===========================================
  Files          810      810              
  Lines        59722    59712      -10     
===========================================
- Hits         38146    38138       -8     
+ Misses       21576    21574       -2     
Impacted Files Coverage Δ
erpnext/controllers/accounts_controller.py 85.17% <84.61%> (-0.02%) ⬇️
...xt/accounts/doctype/payment_entry/payment_entry.py 74.49% <100.00%> (-0.01%) ⬇️

... and 2 files with indirect coverage changes

@deepeshgarg007 deepeshgarg007 added the backport version-14-hotfix backport to version 14 label Apr 16, 2023
@deepeshgarg007 deepeshgarg007 merged commit 5c75894 into frappe:develop Apr 16, 2023
15 checks passed
mergify bot pushed a commit that referenced this pull request Apr 16, 2023
(cherry picked from commit 5c75894)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
deepeshgarg007 added a commit that referenced this pull request Apr 17, 2023
* fix: Advance payment against payment terms (#34872)

(cherry picked from commit 5c75894)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Apr 19, 2023
# [14.22.0](v14.21.0...v14.22.0) (2023-04-19)

### Bug Fixes

* Add offers info to website item ([#34873](#34873)) ([f1a1fc6](f1a1fc6))
* Advance payment against payment terms ([#34872](#34872)) ([7461239](7461239))
* change discuss forum url ([#34891](#34891)) ([8f26d62](8f26d62))
* don't show disabled warehouses in the Warehouse Wise Stock Balance report ([461780d](461780d))
* Don't use stale item details ([#34847](#34847)) ([c11aeba](c11aeba))
* for Tree Type item and item group show net amount ([#31776](#31776)) ([7c8194a](7c8194a))
* linters issues ([c53dc06](c53dc06))
* Remove unnecessary checkbox from Accounts doctype ([#34821](#34821)) ([0cf6144](0cf6144))
* selling workspace is not migrating properly ([79fd38c](79fd38c))
* stock reco test case ([2f356dc](2f356dc))
* too many writes error while making backdated stock reconciliation ([a981b79](a981b79))
* unable to change `company` for manual `Serial No` entry ([2e7043c](2e7043c))
* **ux:** don't throw error when company defaults aren't set ([#34825](#34825)) ([15f5e8d](15f5e8d))
* whitelist doc method ([09b92fd](09b92fd))

### Features

* add german sales tax template ([#34823](#34823)) ([3738ea5](3738ea5))
mergify bot pushed a commit that referenced this pull request Apr 19, 2023
(cherry picked from commit 5c75894)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
deepeshgarg007 added a commit that referenced this pull request Apr 21, 2023
* fix: Advance payment against payment terms (#34872)

(cherry picked from commit 5c75894)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py

* chore: resolve conflicts

* chore: fix tests

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Apr 25, 2023
## [13.49.14](v13.49.13...v13.49.14) (2023-04-25)

### Bug Fixes

* `PermissionError` in Work Order ([5680045](5680045))
* Advance payment against payment terms ([#34872](#34872)) ([d215a85](d215a85))
* internal Purchase Receipt GL Entries ([b73422e](b73422e))
* Payment entry with TDS in bank reco statement ([#34961](#34961)) ([5f28b1d](5f28b1d))
* Payment Request flow fixes from Order to Payment Entry ([#33350](#33350)) ([d5a80b5](d5a80b5))
* SLA permissions ([#34981](#34981)) ([c1187be](c1187be))
* **test:** `test_backdated_stock_reco_cancellation_future_negative_stock` ([d010b04](d010b04))
* Unable to allocate advance against invoice ([#35007](#35007)) ([61a3121](61a3121))
* use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (backport [#35031](#35031)) ([#35036](#35036)) ([be2095a](be2095a))
* validation for internal transfer entry ([91b5a33](91b5a33))
* value of depreciable assets not updating after manual depr entry [v14] (backport [#35010](#35010)) ([#35029](#35029)) ([9087ac0](9087ac0))
* wrong qty of remaining work orders to be created when using "Create" > "Work Order" ([#34726](#34726)) ([189b020](189b020))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accounts backport version-13-hotfix backport version-14-hotfix backport to version 14 needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant