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: minor Dr and Cr between Purchase Receipt and Purchase Invoice (backport #41523) #41526

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 17, 2024

With Provisional Accounting for Non-Stock Items enabled, with high precision exchange rates and large qty in Purchase Receipt and Purchase Invoice, there will be minor debit and credit differences between them.

Ex:
For an exchange rate of 0.014783000, Purchase Receipt of 1000 qty with rate 111.11 and then a Purchase Invoice for it will post below ledger entries. There is a slight difference in Dr and Cr - 0.461. This difference is more pronounced in higher precision exchange rates and large quantities of items.

This is due to the different ways the Dr/Cr amounts are calculated. The Provisional ledger entries created by Purchase Invoice use the individual items' base_rate and qty, while the Purchase Receipt first calculates the total in transaction currency and then converts to base currency.

Without fix:

Account Voucher Type Voucher No Debit Credit
Cost of Goods Sold - DSE Purchase Receipt PR-24-00002-3 0 1643 created by Purchase Invoice
Stock Received But Not Billed - DSE Purchase Receipt PR-24-00002-3 1643 0 created by Purchase Invoice
Cost of Goods Sold - DSE Purchase Receipt PR-24-00002-3 1642.539 0
Stock Received But Not Billed - DSE Purchase Receipt PR-24-00002-3 0 1642.539

With fix:

Account Voucher Type Voucher No Debit Credit
Cost of Goods Sold - DSE Purchase Receipt PR-24-00002-3 0 1642.539 created by Purchase Invoice
Stock Received But Not Billed - DSE Purchase Receipt PR-24-00002-3 1642.539 0 created by Purchase Invoice
Cost of Goods Sold - DSE Purchase Receipt PR-24-00002-3 1642.539 0
Stock Received But Not Billed - DSE Purchase Receipt PR-24-00002-3 0 1642.539
This is an automatic backport of pull request #41523 done by Mergify.

Copy link
Contributor Author

mergify bot commented May 17, 2024

Cherry-pick of 1c0a244 has failed:

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

You are currently cherry-picking commit 1c0a24424a.
  (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/purchase_invoice/purchase_invoice.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/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label May 17, 2024
@ruthra-kumar ruthra-kumar force-pushed the mergify/bp/version-15-hotfix/pr-41523 branch from 59da893 to 3872cdc Compare May 20, 2024 03:01
@ruthra-kumar ruthra-kumar merged commit e5e1aad into version-15-hotfix May 20, 2024
11 checks passed
@ruthra-kumar ruthra-kumar deleted the mergify/bp/version-15-hotfix/pr-41523 branch May 20, 2024 03:47
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.25.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-tests This PR needs automated unit-tests. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants