* fix: incorrect billed_qty when item has multiple Delivery note
sales order analysis report returns incorrect billed_qty value for
an SO item has multiple delivery notes
(cherry picked from commit 0331e37982)
* test: multiple delivery notes and billed quantity
(cherry picked from commit 4f1bfbb93d)
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
* fix(job card): only hold during draft state (#31243)
(cherry picked from commit ee5bc58e9b)
# Conflicts:
# erpnext/patches.txt
* chore: conflicts
Co-authored-by: Ankush Menat <me@ankush.dev>
fix(Sales Register): incorrect query with dimensions
If accounting dimension is also part of the default filters then same
query is repeated with incorrect syntax.
e.g. `item_group = (child1, child2)` instead of `in` query.
fix: don't add default filter if they are part of dimensions to be
added.
(cherry picked from commit c3219ebad1)
Co-authored-by: Ankush Menat <ankush@frappe.io>
- `get_valuation_rate`: if no bins are found return 0, SLEs do not exist either
- `get_valuation_rate`: Compute average valuation rate via query
- `get_rm_rate_map`: set order_by as None to avoid creating sort index (modified) each time query runs (seen in process list)
- BOM Update Batch: add status field and hide `boms_updated` so that users can see progress without loading all updated boms (too much data)
- BOM Update Batch: set batch row status to completed after job runs
- BOM Update Log: remove `parent_boms` field (just pass parent boms to processing function) & remove Paused state (not used)
- Move job to long queue to avoid choking default queue
- `update_cost_in_boms`: use `get_doc` as each BOM is accessed only once. Use `for_update` to lock BOM row
- Commit after every 100 BOMs
- This was done due to stale reads while the background jobs tried updating status of the log
- Added a table where all bom jobs within log will be tracked with what level they are processing
- Cron job will check if table jobs are all processed every 5 mins
- If yes, it will prepare parents and call `process_boms_cost_level_wise` to start next level
- If pending jobs, do nothing
- Current BOM Level is being tracked that helps adding rows to the table
- Individual bom cost jobs (that are queued) will process and update boms > will update BOM Update Batch table row with list of updated BOMs
- If `Update Cost` job is ongoing, then block creation of new ones since all BOMs are updated
- `db_update` in `calculate_rm_cost` only if changed values to reduce redundant row updates
- Misc: Use variable for batch size
Profitability Analysis includes 'is_cancelled' GL Entries which means that the profit numbers are incorrect. This change will ensure that the profit figures ignore cancelled GL Entries.
(cherry picked from commit a0c412a0dd)
* feat: provision to exclude exploded items in the BOM (#29450)
(cherry picked from commit b75b00fefc)
* fix(ux): "New Version" button BOM
"duplicate" technically creates a new version but that's not intuitive
at all.
* fix: only erase BOM when do_not_explode is set
* fix: allow non-explosive recrusive BOMs
Recursion should be allowed as long as child item is not "exploded"
further by a BOM.
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>