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: wrong buying amount if delivered and billed qty varies #40386

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

rtdany10
Copy link
Contributor

Currently, get_buying_amount_from_so_dn, fetches the total amount.
But if the qty is different in delivery note and sales invoice, the amount returned will be wrong.

Fix: Fetch the rate instead of amount and multiply by the invoiced qty.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Mar 12, 2024
@rtdany10
Copy link
Contributor Author

@ruthra-kumar please review and backport

@ruthra-kumar
Copy link
Member

@rtdany10
Can you provide an example scenario?

@rtdany10
Copy link
Contributor Author

@rtdany10
Can you provide an example scenario?

  1. Create a sales order for 10 qty.
  2. Create a delivery note from order for 5 qty
  3. Create another delivery note for 5 qty
  4. Create invoice for 5 qty from sales order (no direct connection with delivery note)

Check GP report.

@rtdany10
Copy link
Contributor Author

@ruthra-kumar

@ruthra-kumar
Copy link
Member

@rtdany10 Fix LGTM.

I've added a test case and will merge once it passes.

@ruthra-kumar ruthra-kumar removed the needs-tests This PR needs automated unit-tests. label Mar 21, 2024
@ruthra-kumar ruthra-kumar self-assigned this Mar 21, 2024
@ruthra-kumar ruthra-kumar merged commit 2bd9c5b into frappe:develop Mar 21, 2024
13 checks passed
ruthra-kumar added a commit that referenced this pull request Mar 22, 2024
…-40386

fix: wrong buying amount if delivered and billed qty varies (backport #40386)
ruthra-kumar added a commit that referenced this pull request Mar 22, 2024
…-40386

fix: wrong buying amount if delivered and billed qty varies (backport #40386)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 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.

None yet

2 participants