Skip to content

fix(stock): recalculate valuation rates on sales returns#57327

Draft
Sudharsanan11 wants to merge 2 commits into
frappe:developfrom
aerele:fix/delivery-note-return-recalculate-valuation-rate
Draft

fix(stock): recalculate valuation rates on sales returns#57327
Sudharsanan11 wants to merge 2 commits into
frappe:developfrom
aerele:fix/delivery-note-return-recalculate-valuation-rate

Conversation

@Sudharsanan11

Copy link
Copy Markdown
Collaborator

Issue

For partial returns of Delivery Notes and Sales Invoices with Update Stock enabled, the incoming valuation rate could remain zero for batched items.

This resulted in:

  • Zero incoming rate
  • Zero Serial and Batch Bundle valuation
  • Incorrect stock value difference in the Stock Ledger Entry

Reposting the voucher did not resolve the issue because Recalculate Valuation Rate only supported Purchase Receipts, Purchase Invoices, and Stock Entries.

Resolution

Extended valuation-rate recalculation to support:

  • Delivery Note returns
  • Sales Invoice returns with Update Stock enabled

Reposting now derives the incoming valuation rate from the original sales voucher and updates the related stock valuation records.

Validation

Added regression tests for partial returns of batched items through:

  • Delivery Notes
  • Sales Invoices with Update Stock enabled

The tests verify that reposting restores the correct incoming rate and stock value difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants