-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: update app in str(file path) code to more exact matching * chore: remove unused code * feat: add manufacturing capacity report * tests: start manufacturing capacity report tests * chore: uncomment formatting code * docs: add manufacturing capacity report documentation * fix: div by zero in parts can build calc * docs: update for calculation differences * fix: in stock qty to zero if none from query
- Loading branch information
Showing
13 changed files
with
762 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Manufacturing Capacity Report | ||
|
||
Manufacturing Capacity is a report-based interface that, given a BOM and Warehouse, displays the demand and in-stock quantities for the entire hierarchy of any BOM tree containing that BOM. | ||
|
||
Once the filters are set, the report traverses the BOM tree to find the top-level parents of the given BOM. From there, it finds total demand based on outstanding Sales Orders, Material Requests (of type "Manufacture"), and Work Orders, adjusting for any overlap. In stock quantities for each level are determined based on the selected Warehouse. The Parts Can Build quantity is based on what is in stock (for non-BOM/raw material rows) or the minimum Parts can Build of sub-levels for BOM rows. | ||
|
||
The Parts Can Build Qty is slightly different for non-BOM vs BOM rows. For non-BOM (raw material) rows, it's the In Stock Qty divided by the Qty per Parent BOM. For BOM rows, it's the minimum of the Parts Can Build for all sub-assemblies. So if a BOM row requires a raw material that isn't in stock, it will show 0 Parts Can Build Qty, even if there are other sub assemblies in stock. | ||
|
||
The Difference Qty calculation is also different for non-BOM and BOM rows. Since non-BOM rows account for the In Stock Qty in the Parts Can Build Qty number, the Difference Qty is the Parts Can Build less the Demanded Qty. For BOM rows, since the Parts Can Build Qty is based off available sub-assembly item quantities (and doesn't use the In Stock Qty in that calculation), the Difference Qty is the In Stock Qty plus Parts Can Build Qty less the Demanded Qty. | ||
|
||
![Screen shot showing the Manufacturing Capacity report output for the Ambrosia Pie BOM and all Warehouses. There are rows for all levels of the BOM hierarchy - the Pie itself, sub-level rows for each sub-assembly of the Pie Crust and Pie Filling, with rows below each of those for the raw materials comprising each BOM. Columns include the BOM, Item, Description, Quantity per Parent BOM, BOM UoM, Demanded Quantity, In Stock Quantity, Parts Can Build quantity, and the Difference Quantity (demanded quantity less parts can build quantity).](./assets/manufacturing_capacity_report.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions
30
inventory_tools/inventory_tools/report/manufacturing_capacity/manufacturing_capacity.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2024, AgriTheory and contributors | ||
// For license information, please see license.txt | ||
/* eslint-disable */ | ||
|
||
frappe.query_reports['Manufacturing Capacity'] = { | ||
filters: [ | ||
{ | ||
fieldname: 'bom', | ||
label: __('BOM'), | ||
fieldtype: 'Link', | ||
options: 'BOM', | ||
reqd: 1, | ||
}, | ||
{ | ||
fieldname: 'warehouse', | ||
label: __('Warehouse'), | ||
fieldtype: 'Link', | ||
options: 'Warehouse', | ||
reqd: 1, | ||
}, | ||
], | ||
formatter: function (value, row, column, data, default_formatter) { | ||
value = default_formatter(value, row, column, data) | ||
|
||
if (data && data.is_selected_bom) { | ||
value = value.bold() | ||
} | ||
return value | ||
}, | ||
} |
30 changes: 30 additions & 0 deletions
30
inventory_tools/inventory_tools/report/manufacturing_capacity/manufacturing_capacity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"add_total_row": 0, | ||
"columns": [], | ||
"creation": "2024-02-16 12:17:16.951700", | ||
"disable_prepared_report": 0, | ||
"disabled": 0, | ||
"docstatus": 0, | ||
"doctype": "Report", | ||
"filters": [], | ||
"idx": 0, | ||
"is_standard": "Yes", | ||
"modified": "2024-02-16 12:17:16.951700", | ||
"modified_by": "Administrator", | ||
"module": "Inventory Tools", | ||
"name": "Manufacturing Capacity", | ||
"owner": "Administrator", | ||
"prepared_report": 0, | ||
"query": "", | ||
"ref_doctype": "BOM", | ||
"report_name": "Manufacturing Capacity", | ||
"report_type": "Script Report", | ||
"roles": [ | ||
{ | ||
"role": "Manufacturing Manager" | ||
}, | ||
{ | ||
"role": "Manufacturing User" | ||
} | ||
] | ||
} |
Oops, something went wrong.