Added a custom checkbox to Warehouse Doctype to easily denote sub-status warehouses.
This commit is contained in:
parent
dc8944a340
commit
d083ddc73e
@ -55,5 +55,62 @@
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "Warehouse",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "custom_is_substatus_warehouse",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "is_rejected_warehouse",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Is Sub-Status Warehouse",
|
||||
"length": 0,
|
||||
"link_filters": null,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2025-10-29 21:25:42.717177",
|
||||
"module": null,
|
||||
"name": "Warehouse-custom_is_substatus_warehouse",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": null,
|
||||
"permlevel": 0,
|
||||
"placeholder": null,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"show_dashboard": 0,
|
||||
"sort_options": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
}
|
||||
]
|
||||
@ -2,12 +2,12 @@
|
||||
{
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom HTML Block",
|
||||
"html": "<div class=inv-workspace id=inv-workspace>\n Hello, World!\n <table class=\"table table-bordered table-condensed\" id=\"item_table\"></table>\n</div>",
|
||||
"modified": "2025-10-29 12:01:13.558369",
|
||||
"html": "<div class=inv-workspace id=inv-workspace>\n <div class=filter-container>\n <h4>Filters</h4>\n <select id=group-select>\n <option value=\"\" disabled selected hidden>Item Group</option>\n </select>\n </div>\n <div class=table-container>\n <h4>Items</h4>\n <table class=\"table table-bordered table-condensed\" id=\"item_table\"></table>\n </div>\n</div>",
|
||||
"modified": "2025-10-30 00:31:58.654374",
|
||||
"name": "Inventory Status Workspace",
|
||||
"private": 0,
|
||||
"roles": [],
|
||||
"script": "frappe.call({\n method: \"uberleben_custom.api.get_item_per_wh\",\n callback: function(r){\n if (r.message) {\n //console.log(r.message);\n populateItemTable(r.message);\n }\n }\n});\n\n function populateItemTable(items) {\n console.log(items);\n console.log(items['Wick and Tindar']);\n var itemTable = root_element.querySelector(\"#item_table\");\n var tableHTML = \"<thead>\";\n tableHTML += \"<thead><tr><th>Item ID</th><th>Item Status</th><th>Number</th></tr></thead>\";\n tableHTML += \"<tbody>\";\n\n for (const[item, warehouse_data] of Object.entries(items)) {\n for (const[warehouse, amount] of Object.entries(warehouse_data))\n {\n if (amount != null) {\n tableHTML += \"<tr>\";\n tableHTML += \"<td><a href='/app/item/\" + item + \"'>\" + item + \"</a></td>\";\n tableHTML += \"<td>\" + warehouse + \"</td>\";\n tableHTML += \"<td>\" + amount + \"</td>\";\n }\n }\n \n //tableHTML += \"<td>\" + item.item_group + \"</td>\";\n\n //var statusColor = task.status === \"Overdue\" ? \"red\" : \"green\";\n //tableHTML += \"<td style='color: \" + statusColor + \";'>\" + task.status + \"</td>\";\n\n //var priorityColor = \"\";\n //switch(task.priority) {\n // case \"Urgent\":\n // priorityColor = \"red\";\n // break;\n // case \"High\":\n // priorityColor = \"orange\";\n // break;\n // case \"Medium\":\n // priorityColor = \"#8B8000\";\n // break;\n // case \"Low\":\n // priorityColor = \"green\";\n // break;\n // default:\n // priorityColor = \"inherit\";\n //}\n //tableHTML += \"<td style='color: \" + priorityColor + \";'>\" + task.priority + \"</td>\";\n\n //tableHTML += \"<td><a href='/app/project/\" + task.project + \"'>\" + task.project + \"</a></td>\";\n //tableHTML += \"</tr>\";\n }\n\n tableHTML += \"</tbody>\";\n\n itemTable.innerHTML = tableHTML;\n }",
|
||||
"style": ""
|
||||
"script": "var warehouse_data;\n\nfrappe.call({\n method: \"uberleben_custom.api.get_warehouse_data\",\n callback: function(r) {\n warehouse_data = r.message;\n }\n});\nfrappe.call({\n method: \"uberleben_custom.api.get_item_per_wh\",\n callback: function(r){\n if (r.message) {\n populateItemTable(r.message);\n }\n }\n});\n\nfunction toggleDetails($rowId) {\n console.log($rowId.attr(\"detail\"));\n if ($rowId.attr(\"detail\")) {\n $rowId.removeAttr(\"detail\");\n }\n else {\n $rowId.attr(\"detail\", true);\n }\n}\n\nfunction toggleInnerTable($tableId) {\n if ($tableId.attr(\"hidden\") != null) {\n $tableId.removeAttr(\"hidden\");\n } else {\n $tableId.attr(\"hidden\", \"\");\n }\n}\n\nfunction generateInnerTableRow(warehouse, number) {\n if (number == 0)\n return \"\"\n return \"<td><em>\"+warehouse+\"</em></td><td>\"+number+\"</td>\";\n}\n\nfunction populateItemTable(items) {\n console.log(\"Prior to building table.\")\n console.log(warehouse_data);\n let $itemTable = $(\"#item_table\", root_element);\n let itemNum = 0;\n let rowNum = 0;\n let tableHTML = \"<thead>\";\n tableHTML += \"</thead>\";\n tableHTML += \"<tbody>\";\n\n for (const[item, stock_data] of Object.entries(items)) {\n let rowId = rowNum + \"-row\";\n let rowButtonId = rowId + \"-button\";\n tableHTML += `<tr class=item-table-row id=${rowId}>`;\n tableHTML += '<td><strong>'+item+'</strong></td>';\n tableHTML += \"</tr>\";\n for (const[warehouse, number] of Object.entries(stock_data)) {\n let wh = warehouse_data[warehouse]\n if (wh.disabled == 1 || number == 0)\n continue;\n rowId = ++rowNum +\"-row\";\n rowButtonId = rowId + \"-button\";\n if (wh.is_substatus_warehouse == 0) {\n tableHTML += `<tr class=outer-table-row id=${rowId}>`;\n tableHTML += '<td>'+warehouse+'</td><td><strong>Total:</strong> '+number;\n if (wh.is_group_warehouse)\n tableHTML += '<button class=\"info-button\" id=' + rowButtonId +' >See Breakdown</button>';\n tableHTML += '</td>'\n tableHTML += '</tr>';\n }\n }\n // Generate Inner Nested Table\n let innerTableId = rowNum + \"-table\";\n let innerHTML = `<thead id=${innerTableId} hidden>`;\n innerHTML += \"<tr><td>Status</td><td>Number</td></tr>\"\n innerHTML += `</thead><tbody id=${innerTableId} hidden>`;\n for (const[warehouse, number] of Object.entries(stock_data)) {\n let wh = warehouse_data[warehouse]\n if (wh.disabled == 1)\n continue;\n if (wh.is_substatus_warehouse == 1 && number > 0) {\n innerHTML += '<tr class=inner-table-row>';\n innerHTML += generateInnerTableRow(warehouse, number);\n innerHTML += '</tr>';\n }\n }\n innerHTML += \"</tbody>\";\n tableHTML += innerHTML;\n console.log(innerHTML);\n itemNum++;\n rowNum++;\n }\n\n tableHTML += \"</tbody>\";\n\n $itemTable.html(tableHTML);\n \n for (let i=0;i<rowNum;i++) {\n let rowId = i+\"-row\";\n let buttonId = i+\"-row-button\";\n let innerTableId = i+\"-table\";\n let $itemRow = $('#'+rowId, $itemTable);\n let $itemButton = $('#'+buttonId, $itemTable);\n let $innerTable = $('#'+innerTableId, $itemTable)\n if ($itemButton){\n $itemButton.on('click', () => {toggleInnerTable($innerTable)});\n }\n }\n }",
|
||||
"style": ".info-button {\n border-radius: 5px;\n}\n.table-container {\n display:flex;\n}\n\n.table {\n display: flex;\n flex-direction: column;\n}\n\n.outer-table-row {\n display: flex;\n}\n\n.inner-table-row {\n display: flex;\n}"
|
||||
}
|
||||
]
|
||||
@ -5,6 +5,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 0,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -29,15 +30,16 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 0,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"disabled": 1,
|
||||
"docstatus": 0,
|
||||
"doctype": "Warehouse",
|
||||
"email_id": null,
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-21 16:01:52.467069",
|
||||
"modified": "2025-10-29 21:56:56.250764",
|
||||
"name": "Stores - U",
|
||||
"old_parent": "All Warehouses - U",
|
||||
"parent_warehouse": "All Warehouses - U",
|
||||
@ -53,6 +55,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -61,7 +64,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:10:23.322030",
|
||||
"modified": "2025-10-29 21:26:39.650350",
|
||||
"name": "Work In Progress - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -77,6 +80,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 0,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -85,31 +89,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:10:12.196648",
|
||||
"name": "Finished Goods - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
"phone_no": null,
|
||||
"pin": null,
|
||||
"state": null,
|
||||
"warehouse_name": "Finished Goods",
|
||||
"warehouse_type": null
|
||||
},
|
||||
{
|
||||
"account": null,
|
||||
"address_line_1": null,
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Warehouse",
|
||||
"email_id": null,
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-21 16:01:52.487226",
|
||||
"modified": "2025-10-29 22:37:26.274236",
|
||||
"name": "Goods In Transit - U",
|
||||
"old_parent": "All Warehouses - U",
|
||||
"parent_warehouse": "All Warehouses - U",
|
||||
@ -125,6 +105,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -133,7 +114,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 1,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:10:00.605806",
|
||||
"modified": "2025-10-29 21:28:48.692452",
|
||||
"name": "Damaged - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -149,6 +130,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -157,7 +139,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:09:54.087306",
|
||||
"modified": "2025-10-29 21:28:57.713876",
|
||||
"name": "Receiving - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -173,6 +155,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -181,7 +164,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:09:46.836850",
|
||||
"modified": "2025-10-29 21:29:05.886880",
|
||||
"name": "QC In Progress - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -197,6 +180,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -205,7 +189,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:09:39.539332",
|
||||
"modified": "2025-10-29 21:29:12.202231",
|
||||
"name": "QC Hold - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -221,6 +205,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -229,7 +214,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:09:12.219956",
|
||||
"modified": "2025-10-29 21:29:18.720725",
|
||||
"name": "Staged - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -245,6 +230,7 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
@ -253,7 +239,7 @@
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-28 12:08:58.548141",
|
||||
"modified": "2025-10-29 21:29:26.476951",
|
||||
"name": "Inbound - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
@ -269,15 +255,41 @@
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 1,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Warehouse",
|
||||
"email_id": null,
|
||||
"is_group": 0,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-29 21:27:40.296954",
|
||||
"name": "Finished Goods - U",
|
||||
"old_parent": "Uberleben HQ - U",
|
||||
"parent_warehouse": "Uberleben HQ - U",
|
||||
"phone_no": null,
|
||||
"pin": null,
|
||||
"state": null,
|
||||
"warehouse_name": "Finished Goods",
|
||||
"warehouse_type": null
|
||||
},
|
||||
{
|
||||
"account": null,
|
||||
"address_line_1": null,
|
||||
"address_line_2": null,
|
||||
"city": null,
|
||||
"company": "Uberleben",
|
||||
"custom_is_substatus_warehouse": 0,
|
||||
"default_in_transit_warehouse": null,
|
||||
"disabled": 1,
|
||||
"docstatus": 0,
|
||||
"doctype": "Warehouse",
|
||||
"email_id": null,
|
||||
"is_group": 1,
|
||||
"is_rejected_warehouse": 0,
|
||||
"mobile_no": null,
|
||||
"modified": "2025-10-21 16:01:52.458015",
|
||||
"modified": "2025-10-29 21:57:07.012733",
|
||||
"name": "All Warehouses - U",
|
||||
"old_parent": "",
|
||||
"parent_warehouse": null,
|
||||
|
||||
@ -26,7 +26,7 @@ add_to_apps_screen = [
|
||||
|
||||
fixtures = [
|
||||
{"doctype": "Client Script", "filters": [["module", "=", "Uberleben Customizations"]]},
|
||||
{"doctype": "Custom Field", "filters": [["dt", "in", "Item"]]},
|
||||
{"doctype": "Custom Field", "filters": [["dt", "in", ["Item", "Warehouse"]]]},
|
||||
"Custom HTML Block",
|
||||
"Warehouse"
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user