-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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: Stock Ageing Transfer Bucket logic for Repack Entry with split batch rows #29816
fix: Stock Ageing Transfer Bucket logic for Repack Entry with split batch rows #29816
Conversation
- Maintain only positive values in transfer bucket - Use it to neutralize/add stock to fifo queue
…ows, balance precision
Unrelated |
@Mergifyio backport version-13-hotfix |
@Mergifyio backport version-13-pre-release |
✅ Backports have been created
|
✅ Backports have been created
|
…-29816 fix: Stock Ageing Transfer Bucket logic for Repack Entry with split batch rows (backport #29816)
…se/pr-29816 fix: Stock Ageing Transfer Bucket logic for Repack Entry with split batch rows (backport #29816)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on the tests + docs btw
@@ -12,6 +12,7 @@ | |||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos | |||
|
|||
Filters = frappe._dict | |||
precision = cint(frappe.db.get_single_value("System Settings", "float_precision")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks multi-tenancy!
Issue:
Consider Repack Entry with Same Item-Warehouse:
transferred_item_details
inFIFOSlots
.transferred_item_details
. Which is then re-added to the FIFO Queue and adjusted intransferred_item_details
transferred_item_details
looks like :[[50, date], [50, date]]
transferred_item_details
, thus making it :[[50, date]]
and only adding 50 to the FIFO Queuetransferred_item_details
, which caused a difference of 50 in the generated FIFO Queue.Fix:
transferred_item_details
just like outgoing stock is consumed in the FIFO Queue (ref:__compute_outgoing_stock()
)transferred_item_details
:[[50, date], [50, date]]
is consumed given there's equivalent incoming stockTo Test:
Consider Ledger below (note voucher nos):

Before:

After:

More Cases:
You can check the test file and simulate similar ledgers if you want to