frappe.pages["load-detail"].on_page_load = function(wrapper) { var page = frappe.ui.make_app_page({ parent: wrapper, title: "Load Detail", single_column: true }); var loadName = frappe.utils.get_url_arg("load"); if (!loadName) { $(page.body).html("

No load specified

Use ?load=MMDDYYYY-XXXX

"); return; } frappe.call({ method: "frappe.client.get", args: { doctype: "Load", name: loadName }, callback: function(r) { if (r.message) { showLoad(page, r.message); } else { $(page.body).html("

Load not found

"); } } }); function showLoad(page, load) { var h = "
"; h += "
"; h += "

Load: " + load.name + "

"; h += "
In Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "
"; h += "
Devices: " + (load.total_devices || 0) + " | Weight: " + (load.total_weight || 0) + " lbs
"; h += "
"; h += " "; h += "Open Form View "; h += "Edit Load"; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; if (load.material_items && load.material_items.length > 0) { load.material_items.forEach(function(item) { h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; }); } h += "
Material TypeCountRcv StatusSend ToRecv'dHDD OutDis Send ToSanitizedTest StatusTest SendR2 SentPhysHDD NeedHDD PhysHDD Logic
" + (item.material_type || "") + "" + (item.total_count || 0) + "" + (item.initial_data_status || "") + "" + (item.send_to || "") + "" + (item.devices_received || 0) + "" + (item.hdd_removed || 0) + "" + (item.disassembly_send_to || "") + "" + (item.units_sanitized_software || 0) + "" + (item.test_data_status || "") + "" + (item.test_send_to || "") + "" + (item.r2_units_sent || 0) + "" + (item.units_physical_destruction || 0) + "" + (item.hdd_needs_sanitize || 0) + "" + (item.hdd_physical_destruction || 0) + "" + (item.hdd_logical_sanitization || 0) + "
"; $(page.body).html(h); } };