diff --git a/westech_r2/page/ebay-pricing/ebay-pricing.html b/westech_r2/page/ebay-pricing/ebay-pricing.html index a67cd3e..4015bfb 100644 --- a/westech_r2/page/ebay-pricing/ebay-pricing.html +++ b/westech_r2/page/ebay-pricing/ebay-pricing.html @@ -1,6 +1,3 @@ -{% extends "templates/web.html" %} -{% block style %} - -{% endblock %} -{% block page_content %}
-{% endblock %} diff --git a/westech_r2/page/ebay-pricing/ebay_pricing.css b/westech_r2/page/ebay-pricing/ebay_pricing.css new file mode 100644 index 0000000..8b27534 --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay_pricing.css @@ -0,0 +1,5 @@ +.badge-fresh { background-color: #28a745; } +.badge-aging { background-color: #ffc107; color: #212529; } +.badge-expired { background-color: #dc3545; } +.badge-needs { background-color: #fd7e14; } +.badge-error { background-color: #6c757d; } diff --git a/westech_r2/page/ebay-pricing/ebay_pricing.html b/westech_r2/page/ebay-pricing/ebay_pricing.html new file mode 100644 index 0000000..4015bfb --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay_pricing.html @@ -0,0 +1,8 @@ + +
diff --git a/westech_r2/page/ebay-pricing/ebay_pricing.js b/westech_r2/page/ebay-pricing/ebay_pricing.js new file mode 120000 index 0000000..8cd44b0 --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay_pricing.js @@ -0,0 +1 @@ +ebay-pricing.js \ No newline at end of file diff --git a/westech_r2/page/ebay-pricing/ebay_pricing.json b/westech_r2/page/ebay-pricing/ebay_pricing.json new file mode 120000 index 0000000..d388217 --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay_pricing.json @@ -0,0 +1 @@ +ebay-pricing.json \ No newline at end of file diff --git a/westech_r2/page/ebay-pricing/ebay_pricing.py b/westech_r2/page/ebay-pricing/ebay_pricing.py new file mode 100644 index 0000000..4053179 --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay_pricing.py @@ -0,0 +1 @@ +# eBay Pricing desk page diff --git a/westech_r2/page/load-detail/__init__.py b/westech_r2/page/load-detail/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/page/load-detail/load-detail.js b/westech_r2/page/load-detail/load-detail.js deleted file mode 100644 index 7b02407..0000000 --- a/westech_r2/page/load-detail/load-detail.js +++ /dev/null @@ -1,38 +0,0 @@ -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 += "

Load: " + load.name + "

"; - h += "

Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "

"; - h += "

Total Devices: " + (load.total_devices || 0) + "

"; - h += ""; - if (load.material_items && load.material_items.length > 0) { - load.material_items.forEach(function(item) { - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - }); - } - h += "
Material TypeCountStatusSend To
" + (item.material_type || "") + "" + (item.total_count || "") + "" + (item.initial_data_status || "") + "" + (item.send_to || "") + "
"; - $(page.body).html(h); - } -}; diff --git a/westech_r2/page/load-detail/load_detail.css b/westech_r2/page/load-detail/load_detail.css deleted file mode 100644 index fd15dfe..0000000 --- a/westech_r2/page/load-detail/load_detail.css +++ /dev/null @@ -1 +0,0 @@ -/* Load Detail page CSS */ diff --git a/westech_r2/page/load-detail/load_detail.html b/westech_r2/page/load-detail/load_detail.html deleted file mode 100644 index ec9f8f8..0000000 --- a/westech_r2/page/load-detail/load_detail.html +++ /dev/null @@ -1,53 +0,0 @@ -
- - -
-

Load:

-
In Date: | Customer: | Devices: | Weight: lbs
-
- -
- Receiving - HDR / Disassembly - Test - R2 Downstream - Destruction -
- - - - - - - - - - - - - - - - - - - - - - - -
Material TypeReceivingHDR / DisassemblyTestR2Destruction
CountStatusSend ToRecv'dHDD OutSend ToSanitizedStatusSend ToSentPhysHDD NeedHDD PhysHDD Logic
-
\ No newline at end of file diff --git a/westech_r2/page/load-detail/load_detail.js b/westech_r2/page/load-detail/load_detail.js deleted file mode 100644 index b13cdca..0000000 --- a/westech_r2/page/load-detail/load_detail.js +++ /dev/null @@ -1,65 +0,0 @@ -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); - } -}; diff --git a/westech_r2/page/load-update/__init__.py b/westech_r2/page/load-update/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/page/load-update/load-update.html b/westech_r2/page/load-update/load-update.html deleted file mode 100644 index 6e7e05e..0000000 --- a/westech_r2/page/load-update/load-update.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Load Update

-

Use the form below to update load material items.

-
diff --git a/westech_r2/page/load-update/load-update.js b/westech_r2/page/load-update/load-update.js deleted file mode 100644 index ed8b54b..0000000 --- a/westech_r2/page/load-update/load-update.js +++ /dev/null @@ -1,105 +0,0 @@ -frappe.pages["load-update"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Load Update", - single_column: true - }); - var loadName = frappe.utils.get_url_arg("load"); - if (!loadName) { - $(page.body).html("

No load specified

Use ?load=MMDDYYYY-XXXX

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

Load not found

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

Update Load: " + load.name + "

"; - h += "

Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "

"; - h += "
"; - h += ""; - h += " "; - h += " Open Form View"; - h += "
"; - - h += ""; - h += ""; - h += ""; - - if (load.material_items && load.material_items.length > 0) { - load.material_items.forEach(function(item, idx) { - var prefix = "item_" + idx + "_"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - }); - } - h += "
Material TypeCountRecv StatusSend ToRecv'dHDD OutDis Send ToSanitizedTest StatusTest SendR2 SentPhysHDD NeedHDD PhysHDD Logic
" + (item.material_type || "") + "
"; - $(page.body).html(h); - - $("#lu-save").on("click", function() { - var items = []; - load.material_items.forEach(function(item, idx) { - var prefix = "#item_" + idx + "_"; - items.push({ - name: item.name, - total_count: parseInt($(prefix + "total_count").val()) || 0, - initial_data_status: $(prefix + "initial_data_status").val(), - send_to: $(prefix + "send_to").val(), - devices_received: parseInt($(prefix + "devices_received").val()) || 0, - hdd_removed: parseInt($(prefix + "hdd_removed").val()) || 0, - disassembly_send_to: $(prefix + "disassembly_send_to").val(), - units_sanitized_software: parseInt($(prefix + "units_sanitized_software").val()) || 0, - test_data_status: $(prefix + "test_data_status").val(), - test_send_to: $(prefix + "test_send_to").val(), - r2_units_sent: parseInt($(prefix + "r2_units_sent").val()) || 0, - units_physical_destruction: parseInt($(prefix + "units_physical_destruction").val()) || 0, - hdd_needs_sanitize: parseInt($(prefix + "hdd_needs_sanitize").val()) || 0, - hdd_physical_destruction: parseInt($(prefix + "hdd_physical_destruction").val()) || 0, - hdd_logical_sanitization: parseInt($(prefix + "hdd_logical_sanitization").val()) || 0 - }); - }); - frappe.call({ - method: "westech_r2.page.load-update.load-update.save_load_items", - args: { load_name: loadName, items: JSON.stringify(items) }, - callback: function(r) { - if (r.message && r.message.status === "ok") { - frappe.show_alert({message: "Saved", indicator: "green"}); - loadLoad(); - } else { - frappe.show_alert({message: "Save failed", indicator: "red"}); - } - } - }); - }); - - $("#lu-print").on("click", function() { - window.print(); - }); - } - - loadLoad(); -}; diff --git a/westech_r2/page/load-update/load-update.py b/westech_r2/page/load-update/load-update.py deleted file mode 100644 index 4afaf5e..0000000 --- a/westech_r2/page/load-update/load-update.py +++ /dev/null @@ -1,17 +0,0 @@ -import frappe -import json - -@frappe.whitelist() -def save_load_items(load_name, items): - items = json.loads(items) - load_doc = frappe.get_doc("Load", load_name) - for item_data in items: - for row in load_doc.material_items: - if row.name == item_data["name"]: - for field, value in item_data.items(): - if field != "name": - row.set(field, value) - break - load_doc.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Saved " + str(len(items)) + " items"} diff --git a/westech_r2/page/load-update/load_update.html b/westech_r2/page/load-update/load_update.html deleted file mode 100644 index 6e7e05e..0000000 --- a/westech_r2/page/load-update/load_update.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Load Update

-

Use the form below to update load material items.

-
diff --git a/westech_r2/page/load-update/load_update.js b/westech_r2/page/load-update/load_update.js deleted file mode 100644 index 5c03738..0000000 --- a/westech_r2/page/load-update/load_update.js +++ /dev/null @@ -1,109 +0,0 @@ -frappe.pages["load-update"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Load Update", - single_column: true - }); - - var loadName = frappe.utils.get_url_arg("load"); - if (!loadName) { - $(page.body).html("

No load specified

Use ?load=MMDDYYYY-XXXX

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

Load not found

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

Update Load: " + load.name + "

"; - h += "

Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "

"; - h += "
"; - h += " "; - h += " "; - h += "Open Form View"; - h += "
"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - - if (load.material_items && load.material_items.length > 0) { - load.material_items.forEach(function(item, idx) { - var prefix = "item_" + idx + "_"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - }); - } - h += "
Material TypeCountRecv StatusSend ToRecv'dHDD OutDis Send ToSanitizedTest StatusTest SendR2 SentPhysHDD NeedHDD PhysHDD Logic
" + (item.material_type || "") + "
"; - $(page.body).html(h); - - $("#lu-save").on("click", function() { - var items = []; - load.material_items.forEach(function(item, idx) { - var prefix = "#item_" + idx + "_"; - items.push({ - name: item.name, - total_count: parseInt($(prefix + "total_count").val()) || 0, - initial_data_status: $(prefix + "initial_data_status").val(), - send_to: $(prefix + "send_to").val(), - devices_received: parseInt($(prefix + "devices_received").val()) || 0, - hdd_removed: parseInt($(prefix + "hdd_removed").val()) || 0, - disassembly_send_to: $(prefix + "disassembly_send_to").val(), - units_sanitized_software: parseInt($(prefix + "units_sanitized_software").val()) || 0, - test_data_status: $(prefix + "test_data_status").val(), - test_send_to: $(prefix + "test_send_to").val(), - r2_units_sent: parseInt($(prefix + "r2_units_sent").val()) || 0, - units_physical_destruction: parseInt($(prefix + "units_physical_destruction").val()) || 0, - hdd_needs_sanitize: parseInt($(prefix + "hdd_needs_sanitize").val()) || 0, - hdd_physical_destruction: parseInt($(prefix + "hdd_physical_destruction").val()) || 0, - hdd_logical_sanitization: parseInt($(prefix + "hdd_logical_sanitization").val()) || 0 - }); - }); - frappe.call({ - method: "westech_r2.page.load-update.load-update.save_load_items", - args: { load_name: loadName, items: JSON.stringify(items) }, - callback: function(r) { - if (r.message && r.message.status === "ok") { - frappe.show_alert({message: "Saved", indicator: "green"}); - loadLoad(); - } else { - frappe.show_alert({message: "Save failed", indicator: "red"}); - } - } - }); - }); - - $("#lu-print").on("click", function() { - window.print(); - }); - } - - loadLoad(); -}; diff --git a/westech_r2/page/load-update/load_update.py b/westech_r2/page/load-update/load_update.py deleted file mode 100644 index 4afaf5e..0000000 --- a/westech_r2/page/load-update/load_update.py +++ /dev/null @@ -1,17 +0,0 @@ -import frappe -import json - -@frappe.whitelist() -def save_load_items(load_name, items): - items = json.loads(items) - load_doc = frappe.get_doc("Load", load_name) - for item_data in items: - for row in load_doc.material_items: - if row.name == item_data["name"]: - for field, value in item_data.items(): - if field != "name": - row.set(field, value) - break - load_doc.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Saved " + str(len(items)) + " items"} diff --git a/westech_r2/page/load-detail/load-detail.css b/westech_r2/page/load_detail/load-detail.css similarity index 100% rename from westech_r2/page/load-detail/load-detail.css rename to westech_r2/page/load_detail/load-detail.css diff --git a/westech_r2/page/load-detail/load-detail.html b/westech_r2/page/load_detail/load-detail.html similarity index 100% rename from westech_r2/page/load-detail/load-detail.html rename to westech_r2/page/load_detail/load-detail.html diff --git a/westech_r2/page/load-detail/load_detail.json b/westech_r2/page/load_detail/load-detail.json similarity index 100% rename from westech_r2/page/load-detail/load_detail.json rename to westech_r2/page/load_detail/load-detail.json diff --git a/westech_r2/page/load-update/load_update.css b/westech_r2/page/load_update/load-update.css similarity index 100% rename from westech_r2/page/load-update/load_update.css rename to westech_r2/page/load_update/load-update.css diff --git a/westech_r2/page/load-update/load_update.json b/westech_r2/page/load_update/load-update.json similarity index 100% rename from westech_r2/page/load-update/load_update.json rename to westech_r2/page/load_update/load-update.json diff --git a/westech_r2/page/pallet-list/__init__.py b/westech_r2/page/pallet-list/__init__.py deleted file mode 100644 index eb0d74d..0000000 --- a/westech_r2/page/pallet-list/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Pallet List page for Westech R2 diff --git a/westech_r2/page/pallet-list/__pycache__/__init__.cpython-312.pyc b/westech_r2/page/pallet-list/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 338fb5b..0000000 Binary files a/westech_r2/page/pallet-list/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/westech_r2/page/pallet-list/__pycache__/pallet-list.cpython-312.pyc b/westech_r2/page/pallet-list/__pycache__/pallet-list.cpython-312.pyc deleted file mode 100644 index 5b60feb..0000000 Binary files a/westech_r2/page/pallet-list/__pycache__/pallet-list.cpython-312.pyc and /dev/null differ diff --git a/westech_r2/page/pallet-list/pallet-list.html b/westech_r2/page/pallet-list/pallet-list.html deleted file mode 100644 index c3ac405..0000000 --- a/westech_r2/page/pallet-list/pallet-list.html +++ /dev/null @@ -1,82 +0,0 @@ - - -
-

📦 Pallet List

- - - -
- - - - - - - - - - - - - - - - - - - - -
Pallet # ⇅Date Reserved ⇅Rec. Date ⇅Customer # ⇅Lbs ⇅Who ⇅Items Tested ⇅QTY Sale ⇅Lbs Sale ⇅Finish Date ⇅StatusNotes
Loading...
-
- -
-
diff --git a/westech_r2/page/pallet-list/pallet-list.js b/westech_r2/page/pallet-list/pallet-list.js deleted file mode 100644 index 0c3f9c1..0000000 --- a/westech_r2/page/pallet-list/pallet-list.js +++ /dev/null @@ -1,128 +0,0 @@ -frappe.pages["pallet-list"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: __("Pallet List"), - single_column: true - }); - - var content = frappe.render_template("pallet-list", {}); - $(page.body).append(content); - - var currentPage = 1; - var pageSize = 100; - var currentSort = "pallet_number"; - var sortDir = "desc"; - var searchTerm = ""; - var statusFilter = ""; - - function loadPallets() { - frappe.call({ - method: "westech_r2.page.pallet-list.pallet-list.get_pallets", - args: { - page: currentPage, - page_size: pageSize, - sort_field: currentSort, - sort_dir: sortDir, - status_filter: statusFilter, - search: searchTerm - }, - callback: function(r) { - if (r.message) { - renderPallets(r.message.pallets, r.message.total); - } - } - }); - } - - function renderPallets(pallets, total) { - var tbody = $("#pallet-tbody"); - tbody.empty(); - - if (!pallets || pallets.length === 0) { - tbody.append('No pallets found'); - return; - } - - pallets.forEach(function(p) { - var statusClass = "status-" + (p.status || "").toLowerCase().replace(/\s+/g, "-"); - var link = "/app/pallet/" + encodeURIComponent(p.name); - var pn = (p.pallet_number || "").replace(//g, ">"); - - var row = '' + - '' + pn + '' + - '' + fmtDate(p.date_reserved) + '' + - '' + fmtDate(p.received_date) + '' + - '' + (p.customer_number || "") + '' + - '' + (p.company_name || "") + '' + - '' + (p.inbound_weight || "") + '' + - '' + (p.tester || "") + '' + - '' + (p.description || "") + '' + - '' + (p.qty_to_sales || "") + '' + - '' + (p.weight_to_sales || "") + '' + - '' + fmtDate(p.finish_date) + '' + - '' + (p.status || "") + '' + - '' + (p.notes || "").substring(0, 50) + '' + - ''; - tbody.append(row); - }); - - renderPagination(total); - } - - function renderPagination(total) { - var totalPages = Math.ceil(total / pageSize); - var pagination = $("#pallet-pagination"); - pagination.empty(); - - if (totalPages <= 1) return; - - var prevBtn = $('').attr("disabled", currentPage === 1) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage > 1) { currentPage--; loadPallets(); } - }); - pagination.append(prevBtn); - - var startPage = Math.max(1, currentPage - 2); - var endPage = Math.min(totalPages, startPage + 4); - - for (var i = startPage; i <= endPage; i++) { - var btn = $('') - .css({padding: "5px 12px", border: "1px solid #ddd", background: i === currentPage ? "#3cc062" : "white", - color: i === currentPage ? "white" : "#333", cursor: "pointer", marginRight: "5px"}) - .on("click", function(page) { - return function() { currentPage = page; loadPallets(); }; - }(i)); - pagination.append(btn); - } - - var nextBtn = $('').attr("disabled", currentPage === totalPages) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage < totalPages) { currentPage++; loadPallets(); } - }); - pagination.append(nextBtn); - } - - function fmtDate(v) { - if (!v) return ""; - var s = String(v); - if (s.indexOf("T") > -1) s = s.split("T")[0]; - if (s.indexOf(" ") > -1) s = s.split(" ")[0]; - return s; - } - - $("#pallet-search").on("input", function() { - searchTerm = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - $("#status-filter").on("change", function() { - statusFilter = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - loadPallets(); -}; diff --git a/westech_r2/page/pallet-list/pallet-list.json b/westech_r2/page/pallet-list/pallet-list.json deleted file mode 100644 index d7304c4..0000000 --- a/westech_r2/page/pallet-list/pallet-list.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - content: null, - creation: 2026-05-19 13:00:00.000000, - docstatus: 0, - doctype: Page, - idx: 0, - modified: 2026-05-19 13:00:00.000000, - modified_by: Administrator, - module: Westech R2, - name: pallet-list, - owner: Administrator, - page_name: pallet-list, - roles: [], - script: null, - standard: Yes, - style: null, - system_page: 0, - title: Pallet List -} diff --git a/westech_r2/page/pallet-list/pallet-list.py b/westech_r2/page/pallet-list/pallet-list.py deleted file mode 100644 index 0a0e433..0000000 --- a/westech_r2/page/pallet-list/pallet-list.py +++ /dev/null @@ -1,64 +0,0 @@ -import frappe - -@frappe.whitelist() -def get_pallets(page=1, page_size=100, sort_field="pallet_number", sort_dir="desc", status_filter="", search=""): - page = int(page) - page_size = int(page_size) - offset = (page - 1) * page_size - - conditions = [ - "pallet_number IS NOT NULL", - "pallet_number != ''", - "date_reserved IS NOT NULL", - "customer_number IS NOT NULL", - "customer_number != ''" - ] - - junk = ["", "0", "0000", "N/A", "TBD", "null", "999990", "999995"] - junk_list = "', '".join(junk) - conditions.append("pallet_number NOT IN ('" + junk_list + "')") - conditions.append("pallet_number NOT LIKE '999%'") - conditions.append("pallet_number REGEXP '^[0-9]'") - - if status_filter: - conditions.append("status = '" + frappe.db.escape(status_filter) + "'") - if search: - conditions.append("pallet_number LIKE '%" + frappe.db.escape(search) + "%'") - - where_clause = " AND ".join(conditions) - - total = frappe.db.sql("SELECT COUNT(*) FROM tabPallet WHERE " + where_clause)[0][0] - - pallets = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE " + where_clause + " ORDER BY CAST(pallet_number AS UNSIGNED) " + sort_dir + " LIMIT " + str(page_size) + " OFFSET " + str(offset), as_dict=True) - - empty_pallet = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE date_reserved IS NULL AND (customer_number IS NULL OR customer_number = '') AND pallet_number NOT IN ('" + junk_list + "') AND pallet_number NOT LIKE '999%' AND pallet_number REGEXP '^[0-9]' ORDER BY CAST(pallet_number AS UNSIGNED) DESC LIMIT 1", as_dict=True) - - result = [] - if empty_pallet: - empty_pallet[0]["_is_new"] = True - result.append(empty_pallet[0]) - result.extend(pallets) - - return {"pallets": result, "total": total, "page": page, "page_size": page_size} - -@frappe.whitelist() -def update_pallet(docname, field, value): - pallet = frappe.get_doc("Pallet", docname) - pallet.set(field, value) - pallet.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Updated " + field} - -@frappe.whitelist() -def create_pallet(data): - data = frappe.parse_json(data) - pallet = frappe.new_doc("Pallet") - pallet.pallet_number = data.get("pallet_number") - pallet.status = data.get("status", "Received") - pallet.date_reserved = data.get("date_reserved") - for field, value in data.items(): - if field not in ["pallet_number", "status", "date_reserved"] and value: - pallet.set(field, value) - pallet.insert(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "name": pallet.name} diff --git a/westech_r2/page/pallet-list/pallet_list.html b/westech_r2/page/pallet-list/pallet_list.html deleted file mode 100644 index c3ac405..0000000 --- a/westech_r2/page/pallet-list/pallet_list.html +++ /dev/null @@ -1,82 +0,0 @@ - - -
-

📦 Pallet List

- - - -
- - - - - - - - - - - - - - - - - - - - -
Pallet # ⇅Date Reserved ⇅Rec. Date ⇅Customer # ⇅Lbs ⇅Who ⇅Items Tested ⇅QTY Sale ⇅Lbs Sale ⇅Finish Date ⇅StatusNotes
Loading...
-
- -
-
diff --git a/westech_r2/page/pallet-list/pallet_list.js b/westech_r2/page/pallet-list/pallet_list.js deleted file mode 100644 index 0c3f9c1..0000000 --- a/westech_r2/page/pallet-list/pallet_list.js +++ /dev/null @@ -1,128 +0,0 @@ -frappe.pages["pallet-list"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: __("Pallet List"), - single_column: true - }); - - var content = frappe.render_template("pallet-list", {}); - $(page.body).append(content); - - var currentPage = 1; - var pageSize = 100; - var currentSort = "pallet_number"; - var sortDir = "desc"; - var searchTerm = ""; - var statusFilter = ""; - - function loadPallets() { - frappe.call({ - method: "westech_r2.page.pallet-list.pallet-list.get_pallets", - args: { - page: currentPage, - page_size: pageSize, - sort_field: currentSort, - sort_dir: sortDir, - status_filter: statusFilter, - search: searchTerm - }, - callback: function(r) { - if (r.message) { - renderPallets(r.message.pallets, r.message.total); - } - } - }); - } - - function renderPallets(pallets, total) { - var tbody = $("#pallet-tbody"); - tbody.empty(); - - if (!pallets || pallets.length === 0) { - tbody.append('No pallets found'); - return; - } - - pallets.forEach(function(p) { - var statusClass = "status-" + (p.status || "").toLowerCase().replace(/\s+/g, "-"); - var link = "/app/pallet/" + encodeURIComponent(p.name); - var pn = (p.pallet_number || "").replace(//g, ">"); - - var row = '' + - '' + pn + '' + - '' + fmtDate(p.date_reserved) + '' + - '' + fmtDate(p.received_date) + '' + - '' + (p.customer_number || "") + '' + - '' + (p.company_name || "") + '' + - '' + (p.inbound_weight || "") + '' + - '' + (p.tester || "") + '' + - '' + (p.description || "") + '' + - '' + (p.qty_to_sales || "") + '' + - '' + (p.weight_to_sales || "") + '' + - '' + fmtDate(p.finish_date) + '' + - '' + (p.status || "") + '' + - '' + (p.notes || "").substring(0, 50) + '' + - ''; - tbody.append(row); - }); - - renderPagination(total); - } - - function renderPagination(total) { - var totalPages = Math.ceil(total / pageSize); - var pagination = $("#pallet-pagination"); - pagination.empty(); - - if (totalPages <= 1) return; - - var prevBtn = $('').attr("disabled", currentPage === 1) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage > 1) { currentPage--; loadPallets(); } - }); - pagination.append(prevBtn); - - var startPage = Math.max(1, currentPage - 2); - var endPage = Math.min(totalPages, startPage + 4); - - for (var i = startPage; i <= endPage; i++) { - var btn = $('') - .css({padding: "5px 12px", border: "1px solid #ddd", background: i === currentPage ? "#3cc062" : "white", - color: i === currentPage ? "white" : "#333", cursor: "pointer", marginRight: "5px"}) - .on("click", function(page) { - return function() { currentPage = page; loadPallets(); }; - }(i)); - pagination.append(btn); - } - - var nextBtn = $('').attr("disabled", currentPage === totalPages) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage < totalPages) { currentPage++; loadPallets(); } - }); - pagination.append(nextBtn); - } - - function fmtDate(v) { - if (!v) return ""; - var s = String(v); - if (s.indexOf("T") > -1) s = s.split("T")[0]; - if (s.indexOf(" ") > -1) s = s.split(" ")[0]; - return s; - } - - $("#pallet-search").on("input", function() { - searchTerm = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - $("#status-filter").on("change", function() { - statusFilter = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - loadPallets(); -}; diff --git a/westech_r2/page/pallet-list/pallet_list.py b/westech_r2/page/pallet-list/pallet_list.py deleted file mode 100644 index 0a0e433..0000000 --- a/westech_r2/page/pallet-list/pallet_list.py +++ /dev/null @@ -1,64 +0,0 @@ -import frappe - -@frappe.whitelist() -def get_pallets(page=1, page_size=100, sort_field="pallet_number", sort_dir="desc", status_filter="", search=""): - page = int(page) - page_size = int(page_size) - offset = (page - 1) * page_size - - conditions = [ - "pallet_number IS NOT NULL", - "pallet_number != ''", - "date_reserved IS NOT NULL", - "customer_number IS NOT NULL", - "customer_number != ''" - ] - - junk = ["", "0", "0000", "N/A", "TBD", "null", "999990", "999995"] - junk_list = "', '".join(junk) - conditions.append("pallet_number NOT IN ('" + junk_list + "')") - conditions.append("pallet_number NOT LIKE '999%'") - conditions.append("pallet_number REGEXP '^[0-9]'") - - if status_filter: - conditions.append("status = '" + frappe.db.escape(status_filter) + "'") - if search: - conditions.append("pallet_number LIKE '%" + frappe.db.escape(search) + "%'") - - where_clause = " AND ".join(conditions) - - total = frappe.db.sql("SELECT COUNT(*) FROM tabPallet WHERE " + where_clause)[0][0] - - pallets = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE " + where_clause + " ORDER BY CAST(pallet_number AS UNSIGNED) " + sort_dir + " LIMIT " + str(page_size) + " OFFSET " + str(offset), as_dict=True) - - empty_pallet = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE date_reserved IS NULL AND (customer_number IS NULL OR customer_number = '') AND pallet_number NOT IN ('" + junk_list + "') AND pallet_number NOT LIKE '999%' AND pallet_number REGEXP '^[0-9]' ORDER BY CAST(pallet_number AS UNSIGNED) DESC LIMIT 1", as_dict=True) - - result = [] - if empty_pallet: - empty_pallet[0]["_is_new"] = True - result.append(empty_pallet[0]) - result.extend(pallets) - - return {"pallets": result, "total": total, "page": page, "page_size": page_size} - -@frappe.whitelist() -def update_pallet(docname, field, value): - pallet = frappe.get_doc("Pallet", docname) - pallet.set(field, value) - pallet.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Updated " + field} - -@frappe.whitelist() -def create_pallet(data): - data = frappe.parse_json(data) - pallet = frappe.new_doc("Pallet") - pallet.pallet_number = data.get("pallet_number") - pallet.status = data.get("status", "Received") - pallet.date_reserved = data.get("date_reserved") - for field, value in data.items(): - if field not in ["pallet_number", "status", "date_reserved"] and value: - pallet.set(field, value) - pallet.insert(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "name": pallet.name} diff --git a/westech_r2/page/route-planner/route_planner.html b/westech_r2/page/route-planner/route_planner.html deleted file mode 100644 index 0116139..0000000 --- a/westech_r2/page/route-planner/route_planner.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Route Planner

-

Optimize pickup routes for scheduled pickups.

-
diff --git a/westech_r2/page/route-planner/route_planner.js b/westech_r2/page/route-planner/route_planner.js deleted file mode 100644 index 9d8ff74..0000000 --- a/westech_r2/page/route-planner/route_planner.js +++ /dev/null @@ -1,38 +0,0 @@ -frappe.pages["route-planner"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Route Planner", - single_column: true - }); - - frappe.call({ - method: "westech_r2.api.optimize_routes.get_scheduled_pickups", - callback: function(r) { - if (r.message) { - renderRoutePlanner(page, r.message); - } - } - }); - - function renderRoutePlanner(page, data) { - var h = "
"; - h += "

Route Planner

"; - h += "

Schedule and optimize pickup routes.

"; - h += "
"; - h += ""; - h += "
"; - h += "
"; - $(page.body).html(h); - - $("#optimize-btn").on("click", function() { - frappe.call({ - method: "westech_r2.api.optimize_routes.optimize_routes", - callback: function(r) { - if (r.message) { - frappe.show_alert({message: "Routes optimized", indicator: "green"}); - } - } - }); - }); - } -}; diff --git a/westech_r2/page/route-planner/route-planner.html b/westech_r2/page/route_planner/route-planner.html similarity index 100% rename from westech_r2/page/route-planner/route-planner.html rename to westech_r2/page/route_planner/route-planner.html diff --git a/westech_r2/page/route-planner/route-planner.js b/westech_r2/page/route_planner/route-planner.js similarity index 100% rename from westech_r2/page/route-planner/route-planner.js rename to westech_r2/page/route_planner/route-planner.js diff --git a/westech_r2/page/route-planner/route-planner.json b/westech_r2/page/route_planner/route-planner.json similarity index 100% rename from westech_r2/page/route-planner/route-planner.json rename to westech_r2/page/route_planner/route-planner.json diff --git a/westech_r2/westech_r2/page/__init__.py b/westech_r2/westech_r2/page/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/westech_r2/page/load-detail/load-detail.json b/westech_r2/westech_r2/page/load-detail/load-detail.json deleted file mode 100644 index fdf173c..0000000 --- a/westech_r2/westech_r2/page/load-detail/load-detail.json +++ /dev/null @@ -1 +0,0 @@ -{"content": "
\n\n\n
\n

Load:

\n
In Date: | Customer: | Devices: | Weight: lbs
\n
\n\n
\n Receiving\n HDR / Disassembly\n Test\n R2 Downstream\n Destruction\n
\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Material TypeReceivingHDR / DisassemblyTestR2Destruction
CountStatusSend ToRecv'dHDD OutSend ToSanitizedStatusSend ToSentPhysHDD NeedHDD PhysHDD Logic
\n\n\n
\n", "title": "Load Detail", "route": "load-detail"} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load-detail/load_detail.json b/westech_r2/westech_r2/page/load-detail/load_detail.json deleted file mode 100644 index fdf173c..0000000 --- a/westech_r2/westech_r2/page/load-detail/load_detail.json +++ /dev/null @@ -1 +0,0 @@ -{"content": "
\n\n\n
\n

Load:

\n
In Date: | Customer: | Devices: | Weight: lbs
\n
\n\n
\n Receiving\n HDR / Disassembly\n Test\n R2 Downstream\n Destruction\n
\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Material TypeReceivingHDR / DisassemblyTestR2Destruction
CountStatusSend ToRecv'dHDD OutSend ToSanitizedStatusSend ToSentPhysHDD NeedHDD PhysHDD Logic
\n\n\n
\n", "title": "Load Detail", "route": "load-detail"} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load-update/__init__.py b/westech_r2/westech_r2/page/load-update/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/westech_r2/page/load-update/load_update.js b/westech_r2/westech_r2/page/load-update/load_update.js deleted file mode 100644 index bd7fac9..0000000 --- a/westech_r2/westech_r2/page/load-update/load_update.js +++ /dev/null @@ -1,7 +0,0 @@ -frappe.pages['load-update'].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: 'Load Update', - single_column: true - }); -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load-update/load_update.json b/westech_r2/westech_r2/page/load-update/load_update.json deleted file mode 100644 index 59ee53b..0000000 --- a/westech_r2/westech_r2/page/load-update/load_update.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "content": null, - "creation": "2026-05-19 19:43:48.962424", - "docstatus": 0, - "doctype": "Page", - "idx": 0, - "modified": "2026-05-19 19:43:48.962424", - "modified_by": "Administrator", - "module": "Westech R2", - "name": "load-update", - "owner": "Administrator", - "page_name": "load-update", - "roles": [ - { - "role": "All" - } - ], - "script": null, - "standard": "Yes", - "style": null, - "system_page": 0, - "title": "Load Update" -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load_detail/__init__.py b/westech_r2/westech_r2/page/load_detail/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/westech_r2/page/load_detail/load-detail.js b/westech_r2/westech_r2/page/load_detail/load-detail.js deleted file mode 100644 index b13cdca..0000000 --- a/westech_r2/westech_r2/page/load_detail/load-detail.js +++ /dev/null @@ -1,65 +0,0 @@ -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); - } -}; diff --git a/westech_r2/westech_r2/page/load_detail/load-detail.json b/westech_r2/westech_r2/page/load_detail/load-detail.json deleted file mode 100644 index fdf173c..0000000 --- a/westech_r2/westech_r2/page/load_detail/load-detail.json +++ /dev/null @@ -1 +0,0 @@ -{"content": "
\n\n\n
\n

Load:

\n
In Date: | Customer: | Devices: | Weight: lbs
\n
\n\n
\n Receiving\n HDR / Disassembly\n Test\n R2 Downstream\n Destruction\n
\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Material TypeReceivingHDR / DisassemblyTestR2Destruction
CountStatusSend ToRecv'dHDD OutSend ToSanitizedStatusSend ToSentPhysHDD NeedHDD PhysHDD Logic
\n\n\n
\n", "title": "Load Detail", "route": "load-detail"} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load_detail/load_detail.html b/westech_r2/westech_r2/page/load_detail/load_detail.html deleted file mode 100644 index ec9f8f8..0000000 --- a/westech_r2/westech_r2/page/load_detail/load_detail.html +++ /dev/null @@ -1,53 +0,0 @@ -
- - -
-

Load:

-
In Date: | Customer: | Devices: | Weight: lbs
-
- -
- Receiving - HDR / Disassembly - Test - R2 Downstream - Destruction -
- - - - - - - - - - - - - - - - - - - - - - - -
Material TypeReceivingHDR / DisassemblyTestR2Destruction
CountStatusSend ToRecv'dHDD OutSend ToSanitizedStatusSend ToSentPhysHDD NeedHDD PhysHDD Logic
-
\ No newline at end of file diff --git a/westech_r2/westech_r2/page/load_detail/load_detail.js b/westech_r2/westech_r2/page/load_detail/load_detail.js deleted file mode 100644 index b13cdca..0000000 --- a/westech_r2/westech_r2/page/load_detail/load_detail.js +++ /dev/null @@ -1,65 +0,0 @@ -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); - } -}; diff --git a/westech_r2/westech_r2/page/load_detail/load_detail.json b/westech_r2/westech_r2/page/load_detail/load_detail.json deleted file mode 100644 index b907099..0000000 --- a/westech_r2/westech_r2/page/load_detail/load_detail.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "content": null, - "creation": "2026-05-19 19:43:48.923372", - "docstatus": 0, - "doctype": "Page", - "idx": 0, - "modified": "2026-05-19 19:43:48.923372", - "modified_by": "Administrator", - "module": "Westech R2", - "name": "load-detail", - "owner": "Administrator", - "page_name": "load-detail", - "roles": [ - { - "role": "All" - } - ], - "script": null, - "standard": "Yes", - "style": null, - "system_page": 0, - "title": "Load Detail" -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load_update/__init__.py b/westech_r2/westech_r2/page/load_update/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/westech_r2/westech_r2/page/load_update/load-update.js b/westech_r2/westech_r2/page/load_update/load-update.js deleted file mode 100644 index 5c03738..0000000 --- a/westech_r2/westech_r2/page/load_update/load-update.js +++ /dev/null @@ -1,109 +0,0 @@ -frappe.pages["load-update"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Load Update", - single_column: true - }); - - var loadName = frappe.utils.get_url_arg("load"); - if (!loadName) { - $(page.body).html("

No load specified

Use ?load=MMDDYYYY-XXXX

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

Load not found

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

Update Load: " + load.name + "

"; - h += "

Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "

"; - h += "
"; - h += " "; - h += " "; - h += "Open Form View"; - h += "
"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - - if (load.material_items && load.material_items.length > 0) { - load.material_items.forEach(function(item, idx) { - var prefix = "item_" + idx + "_"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - }); - } - h += "
Material TypeCountRecv StatusSend ToRecv'dHDD OutDis Send ToSanitizedTest StatusTest SendR2 SentPhysHDD NeedHDD PhysHDD Logic
" + (item.material_type || "") + "
"; - $(page.body).html(h); - - $("#lu-save").on("click", function() { - var items = []; - load.material_items.forEach(function(item, idx) { - var prefix = "#item_" + idx + "_"; - items.push({ - name: item.name, - total_count: parseInt($(prefix + "total_count").val()) || 0, - initial_data_status: $(prefix + "initial_data_status").val(), - send_to: $(prefix + "send_to").val(), - devices_received: parseInt($(prefix + "devices_received").val()) || 0, - hdd_removed: parseInt($(prefix + "hdd_removed").val()) || 0, - disassembly_send_to: $(prefix + "disassembly_send_to").val(), - units_sanitized_software: parseInt($(prefix + "units_sanitized_software").val()) || 0, - test_data_status: $(prefix + "test_data_status").val(), - test_send_to: $(prefix + "test_send_to").val(), - r2_units_sent: parseInt($(prefix + "r2_units_sent").val()) || 0, - units_physical_destruction: parseInt($(prefix + "units_physical_destruction").val()) || 0, - hdd_needs_sanitize: parseInt($(prefix + "hdd_needs_sanitize").val()) || 0, - hdd_physical_destruction: parseInt($(prefix + "hdd_physical_destruction").val()) || 0, - hdd_logical_sanitization: parseInt($(prefix + "hdd_logical_sanitization").val()) || 0 - }); - }); - frappe.call({ - method: "westech_r2.page.load-update.load-update.save_load_items", - args: { load_name: loadName, items: JSON.stringify(items) }, - callback: function(r) { - if (r.message && r.message.status === "ok") { - frappe.show_alert({message: "Saved", indicator: "green"}); - loadLoad(); - } else { - frappe.show_alert({message: "Save failed", indicator: "red"}); - } - } - }); - }); - - $("#lu-print").on("click", function() { - window.print(); - }); - } - - loadLoad(); -}; diff --git a/westech_r2/westech_r2/page/load_update/load_update.html b/westech_r2/westech_r2/page/load_update/load_update.html deleted file mode 100644 index 6e7e05e..0000000 --- a/westech_r2/westech_r2/page/load_update/load_update.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Load Update

-

Use the form below to update load material items.

-
diff --git a/westech_r2/westech_r2/page/load_update/load_update.js b/westech_r2/westech_r2/page/load_update/load_update.js deleted file mode 100644 index 5c03738..0000000 --- a/westech_r2/westech_r2/page/load_update/load_update.js +++ /dev/null @@ -1,109 +0,0 @@ -frappe.pages["load-update"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Load Update", - single_column: true - }); - - var loadName = frappe.utils.get_url_arg("load"); - if (!loadName) { - $(page.body).html("

No load specified

Use ?load=MMDDYYYY-XXXX

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

Load not found

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

Update Load: " + load.name + "

"; - h += "

Date: " + (load.incoming_date || "N/A") + " | Customer: " + (load.customer_name || load.customer_number || "N/A") + "

"; - h += "
"; - h += " "; - h += " "; - h += "Open Form View"; - h += "
"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - - if (load.material_items && load.material_items.length > 0) { - load.material_items.forEach(function(item, idx) { - var prefix = "item_" + idx + "_"; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - h += ""; - }); - } - h += "
Material TypeCountRecv StatusSend ToRecv'dHDD OutDis Send ToSanitizedTest StatusTest SendR2 SentPhysHDD NeedHDD PhysHDD Logic
" + (item.material_type || "") + "
"; - $(page.body).html(h); - - $("#lu-save").on("click", function() { - var items = []; - load.material_items.forEach(function(item, idx) { - var prefix = "#item_" + idx + "_"; - items.push({ - name: item.name, - total_count: parseInt($(prefix + "total_count").val()) || 0, - initial_data_status: $(prefix + "initial_data_status").val(), - send_to: $(prefix + "send_to").val(), - devices_received: parseInt($(prefix + "devices_received").val()) || 0, - hdd_removed: parseInt($(prefix + "hdd_removed").val()) || 0, - disassembly_send_to: $(prefix + "disassembly_send_to").val(), - units_sanitized_software: parseInt($(prefix + "units_sanitized_software").val()) || 0, - test_data_status: $(prefix + "test_data_status").val(), - test_send_to: $(prefix + "test_send_to").val(), - r2_units_sent: parseInt($(prefix + "r2_units_sent").val()) || 0, - units_physical_destruction: parseInt($(prefix + "units_physical_destruction").val()) || 0, - hdd_needs_sanitize: parseInt($(prefix + "hdd_needs_sanitize").val()) || 0, - hdd_physical_destruction: parseInt($(prefix + "hdd_physical_destruction").val()) || 0, - hdd_logical_sanitization: parseInt($(prefix + "hdd_logical_sanitization").val()) || 0 - }); - }); - frappe.call({ - method: "westech_r2.page.load-update.load-update.save_load_items", - args: { load_name: loadName, items: JSON.stringify(items) }, - callback: function(r) { - if (r.message && r.message.status === "ok") { - frappe.show_alert({message: "Saved", indicator: "green"}); - loadLoad(); - } else { - frappe.show_alert({message: "Save failed", indicator: "red"}); - } - } - }); - }); - - $("#lu-print").on("click", function() { - window.print(); - }); - } - - loadLoad(); -}; diff --git a/westech_r2/westech_r2/page/load_update/load_update.json b/westech_r2/westech_r2/page/load_update/load_update.json deleted file mode 100644 index 36a0249..0000000 --- a/westech_r2/westech_r2/page/load_update/load_update.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "content": null, - "creation": "2026-05-19 20:47:42.992119", - "docstatus": 0, - "doctype": "Page", - "idx": 0, - "modified": "2026-05-19 20:47:42.992119", - "modified_by": "Administrator", - "module": "Westech R2", - "name": "load-update", - "owner": "Administrator", - "page_name": "load-update", - "roles": [ - { - "role": "All" - } - ], - "script": null, - "standard": "Yes", - "style": null, - "system_page": 0, - "title": "Load Update" -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/load_update/load_update.py b/westech_r2/westech_r2/page/load_update/load_update.py deleted file mode 100644 index 4afaf5e..0000000 --- a/westech_r2/westech_r2/page/load_update/load_update.py +++ /dev/null @@ -1,17 +0,0 @@ -import frappe -import json - -@frappe.whitelist() -def save_load_items(load_name, items): - items = json.loads(items) - load_doc = frappe.get_doc("Load", load_name) - for item_data in items: - for row in load_doc.material_items: - if row.name == item_data["name"]: - for field, value in item_data.items(): - if field != "name": - row.set(field, value) - break - load_doc.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Saved " + str(len(items)) + " items"} diff --git a/westech_r2/westech_r2/page/pallet-list/__init__.py b/westech_r2/westech_r2/page/pallet-list/__init__.py deleted file mode 100644 index eb0d74d..0000000 --- a/westech_r2/westech_r2/page/pallet-list/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Pallet List page for Westech R2 diff --git a/westech_r2/westech_r2/page/pallet-list/pallet-list.html b/westech_r2/westech_r2/page/pallet-list/pallet-list.html deleted file mode 100644 index c3ac405..0000000 --- a/westech_r2/westech_r2/page/pallet-list/pallet-list.html +++ /dev/null @@ -1,82 +0,0 @@ - - -
-

📦 Pallet List

- - - -
- - - - - - - - - - - - - - - - - - - - -
Pallet # ⇅Date Reserved ⇅Rec. Date ⇅Customer # ⇅Lbs ⇅Who ⇅Items Tested ⇅QTY Sale ⇅Lbs Sale ⇅Finish Date ⇅StatusNotes
Loading...
-
- -
-
diff --git a/westech_r2/westech_r2/page/pallet-list/pallet-list.js b/westech_r2/westech_r2/page/pallet-list/pallet-list.js deleted file mode 100644 index 0c3f9c1..0000000 --- a/westech_r2/westech_r2/page/pallet-list/pallet-list.js +++ /dev/null @@ -1,128 +0,0 @@ -frappe.pages["pallet-list"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: __("Pallet List"), - single_column: true - }); - - var content = frappe.render_template("pallet-list", {}); - $(page.body).append(content); - - var currentPage = 1; - var pageSize = 100; - var currentSort = "pallet_number"; - var sortDir = "desc"; - var searchTerm = ""; - var statusFilter = ""; - - function loadPallets() { - frappe.call({ - method: "westech_r2.page.pallet-list.pallet-list.get_pallets", - args: { - page: currentPage, - page_size: pageSize, - sort_field: currentSort, - sort_dir: sortDir, - status_filter: statusFilter, - search: searchTerm - }, - callback: function(r) { - if (r.message) { - renderPallets(r.message.pallets, r.message.total); - } - } - }); - } - - function renderPallets(pallets, total) { - var tbody = $("#pallet-tbody"); - tbody.empty(); - - if (!pallets || pallets.length === 0) { - tbody.append('No pallets found'); - return; - } - - pallets.forEach(function(p) { - var statusClass = "status-" + (p.status || "").toLowerCase().replace(/\s+/g, "-"); - var link = "/app/pallet/" + encodeURIComponent(p.name); - var pn = (p.pallet_number || "").replace(//g, ">"); - - var row = '' + - '' + pn + '' + - '' + fmtDate(p.date_reserved) + '' + - '' + fmtDate(p.received_date) + '' + - '' + (p.customer_number || "") + '' + - '' + (p.company_name || "") + '' + - '' + (p.inbound_weight || "") + '' + - '' + (p.tester || "") + '' + - '' + (p.description || "") + '' + - '' + (p.qty_to_sales || "") + '' + - '' + (p.weight_to_sales || "") + '' + - '' + fmtDate(p.finish_date) + '' + - '' + (p.status || "") + '' + - '' + (p.notes || "").substring(0, 50) + '' + - ''; - tbody.append(row); - }); - - renderPagination(total); - } - - function renderPagination(total) { - var totalPages = Math.ceil(total / pageSize); - var pagination = $("#pallet-pagination"); - pagination.empty(); - - if (totalPages <= 1) return; - - var prevBtn = $('').attr("disabled", currentPage === 1) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage > 1) { currentPage--; loadPallets(); } - }); - pagination.append(prevBtn); - - var startPage = Math.max(1, currentPage - 2); - var endPage = Math.min(totalPages, startPage + 4); - - for (var i = startPage; i <= endPage; i++) { - var btn = $('') - .css({padding: "5px 12px", border: "1px solid #ddd", background: i === currentPage ? "#3cc062" : "white", - color: i === currentPage ? "white" : "#333", cursor: "pointer", marginRight: "5px"}) - .on("click", function(page) { - return function() { currentPage = page; loadPallets(); }; - }(i)); - pagination.append(btn); - } - - var nextBtn = $('').attr("disabled", currentPage === totalPages) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage < totalPages) { currentPage++; loadPallets(); } - }); - pagination.append(nextBtn); - } - - function fmtDate(v) { - if (!v) return ""; - var s = String(v); - if (s.indexOf("T") > -1) s = s.split("T")[0]; - if (s.indexOf(" ") > -1) s = s.split(" ")[0]; - return s; - } - - $("#pallet-search").on("input", function() { - searchTerm = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - $("#status-filter").on("change", function() { - statusFilter = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - loadPallets(); -}; diff --git a/westech_r2/westech_r2/page/pallet-list/pallet-list.json b/westech_r2/westech_r2/page/pallet-list/pallet-list.json deleted file mode 100644 index d7304c4..0000000 --- a/westech_r2/westech_r2/page/pallet-list/pallet-list.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - content: null, - creation: 2026-05-19 13:00:00.000000, - docstatus: 0, - doctype: Page, - idx: 0, - modified: 2026-05-19 13:00:00.000000, - modified_by: Administrator, - module: Westech R2, - name: pallet-list, - owner: Administrator, - page_name: pallet-list, - roles: [], - script: null, - standard: Yes, - style: null, - system_page: 0, - title: Pallet List -} diff --git a/westech_r2/westech_r2/page/pallet-list/pallet-list.py b/westech_r2/westech_r2/page/pallet-list/pallet-list.py deleted file mode 100644 index 0a0e433..0000000 --- a/westech_r2/westech_r2/page/pallet-list/pallet-list.py +++ /dev/null @@ -1,64 +0,0 @@ -import frappe - -@frappe.whitelist() -def get_pallets(page=1, page_size=100, sort_field="pallet_number", sort_dir="desc", status_filter="", search=""): - page = int(page) - page_size = int(page_size) - offset = (page - 1) * page_size - - conditions = [ - "pallet_number IS NOT NULL", - "pallet_number != ''", - "date_reserved IS NOT NULL", - "customer_number IS NOT NULL", - "customer_number != ''" - ] - - junk = ["", "0", "0000", "N/A", "TBD", "null", "999990", "999995"] - junk_list = "', '".join(junk) - conditions.append("pallet_number NOT IN ('" + junk_list + "')") - conditions.append("pallet_number NOT LIKE '999%'") - conditions.append("pallet_number REGEXP '^[0-9]'") - - if status_filter: - conditions.append("status = '" + frappe.db.escape(status_filter) + "'") - if search: - conditions.append("pallet_number LIKE '%" + frappe.db.escape(search) + "%'") - - where_clause = " AND ".join(conditions) - - total = frappe.db.sql("SELECT COUNT(*) FROM tabPallet WHERE " + where_clause)[0][0] - - pallets = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE " + where_clause + " ORDER BY CAST(pallet_number AS UNSIGNED) " + sort_dir + " LIMIT " + str(page_size) + " OFFSET " + str(offset), as_dict=True) - - empty_pallet = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE date_reserved IS NULL AND (customer_number IS NULL OR customer_number = '') AND pallet_number NOT IN ('" + junk_list + "') AND pallet_number NOT LIKE '999%' AND pallet_number REGEXP '^[0-9]' ORDER BY CAST(pallet_number AS UNSIGNED) DESC LIMIT 1", as_dict=True) - - result = [] - if empty_pallet: - empty_pallet[0]["_is_new"] = True - result.append(empty_pallet[0]) - result.extend(pallets) - - return {"pallets": result, "total": total, "page": page, "page_size": page_size} - -@frappe.whitelist() -def update_pallet(docname, field, value): - pallet = frappe.get_doc("Pallet", docname) - pallet.set(field, value) - pallet.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Updated " + field} - -@frappe.whitelist() -def create_pallet(data): - data = frappe.parse_json(data) - pallet = frappe.new_doc("Pallet") - pallet.pallet_number = data.get("pallet_number") - pallet.status = data.get("status", "Received") - pallet.date_reserved = data.get("date_reserved") - for field, value in data.items(): - if field not in ["pallet_number", "status", "date_reserved"] and value: - pallet.set(field, value) - pallet.insert(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "name": pallet.name} diff --git a/westech_r2/westech_r2/page/pallet_list/pallet_list.html b/westech_r2/westech_r2/page/pallet_list/pallet_list.html deleted file mode 100644 index c3ac405..0000000 --- a/westech_r2/westech_r2/page/pallet_list/pallet_list.html +++ /dev/null @@ -1,82 +0,0 @@ - - -
-

📦 Pallet List

- - - -
- - - - - - - - - - - - - - - - - - - - -
Pallet # ⇅Date Reserved ⇅Rec. Date ⇅Customer # ⇅Lbs ⇅Who ⇅Items Tested ⇅QTY Sale ⇅Lbs Sale ⇅Finish Date ⇅StatusNotes
Loading...
-
- -
-
diff --git a/westech_r2/westech_r2/page/pallet_list/pallet_list.js b/westech_r2/westech_r2/page/pallet_list/pallet_list.js deleted file mode 100644 index 0c3f9c1..0000000 --- a/westech_r2/westech_r2/page/pallet_list/pallet_list.js +++ /dev/null @@ -1,128 +0,0 @@ -frappe.pages["pallet-list"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: __("Pallet List"), - single_column: true - }); - - var content = frappe.render_template("pallet-list", {}); - $(page.body).append(content); - - var currentPage = 1; - var pageSize = 100; - var currentSort = "pallet_number"; - var sortDir = "desc"; - var searchTerm = ""; - var statusFilter = ""; - - function loadPallets() { - frappe.call({ - method: "westech_r2.page.pallet-list.pallet-list.get_pallets", - args: { - page: currentPage, - page_size: pageSize, - sort_field: currentSort, - sort_dir: sortDir, - status_filter: statusFilter, - search: searchTerm - }, - callback: function(r) { - if (r.message) { - renderPallets(r.message.pallets, r.message.total); - } - } - }); - } - - function renderPallets(pallets, total) { - var tbody = $("#pallet-tbody"); - tbody.empty(); - - if (!pallets || pallets.length === 0) { - tbody.append('No pallets found'); - return; - } - - pallets.forEach(function(p) { - var statusClass = "status-" + (p.status || "").toLowerCase().replace(/\s+/g, "-"); - var link = "/app/pallet/" + encodeURIComponent(p.name); - var pn = (p.pallet_number || "").replace(//g, ">"); - - var row = '' + - '' + pn + '' + - '' + fmtDate(p.date_reserved) + '' + - '' + fmtDate(p.received_date) + '' + - '' + (p.customer_number || "") + '' + - '' + (p.company_name || "") + '' + - '' + (p.inbound_weight || "") + '' + - '' + (p.tester || "") + '' + - '' + (p.description || "") + '' + - '' + (p.qty_to_sales || "") + '' + - '' + (p.weight_to_sales || "") + '' + - '' + fmtDate(p.finish_date) + '' + - '' + (p.status || "") + '' + - '' + (p.notes || "").substring(0, 50) + '' + - ''; - tbody.append(row); - }); - - renderPagination(total); - } - - function renderPagination(total) { - var totalPages = Math.ceil(total / pageSize); - var pagination = $("#pallet-pagination"); - pagination.empty(); - - if (totalPages <= 1) return; - - var prevBtn = $('').attr("disabled", currentPage === 1) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage > 1) { currentPage--; loadPallets(); } - }); - pagination.append(prevBtn); - - var startPage = Math.max(1, currentPage - 2); - var endPage = Math.min(totalPages, startPage + 4); - - for (var i = startPage; i <= endPage; i++) { - var btn = $('') - .css({padding: "5px 12px", border: "1px solid #ddd", background: i === currentPage ? "#3cc062" : "white", - color: i === currentPage ? "white" : "#333", cursor: "pointer", marginRight: "5px"}) - .on("click", function(page) { - return function() { currentPage = page; loadPallets(); }; - }(i)); - pagination.append(btn); - } - - var nextBtn = $('').attr("disabled", currentPage === totalPages) - .css({padding: "5px 12px", border: "1px solid #ddd", background: "white", cursor: "pointer", marginRight: "5px"}) - .on("click", function() { - if (currentPage < totalPages) { currentPage++; loadPallets(); } - }); - pagination.append(nextBtn); - } - - function fmtDate(v) { - if (!v) return ""; - var s = String(v); - if (s.indexOf("T") > -1) s = s.split("T")[0]; - if (s.indexOf(" ") > -1) s = s.split(" ")[0]; - return s; - } - - $("#pallet-search").on("input", function() { - searchTerm = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - $("#status-filter").on("change", function() { - statusFilter = $(this).val(); - currentPage = 1; - loadPallets(); - }); - - loadPallets(); -}; diff --git a/westech_r2/westech_r2/page/pallet_list/pallet_list.json b/westech_r2/westech_r2/page/pallet_list/pallet_list.json deleted file mode 100644 index d7304c4..0000000 --- a/westech_r2/westech_r2/page/pallet_list/pallet_list.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - content: null, - creation: 2026-05-19 13:00:00.000000, - docstatus: 0, - doctype: Page, - idx: 0, - modified: 2026-05-19 13:00:00.000000, - modified_by: Administrator, - module: Westech R2, - name: pallet-list, - owner: Administrator, - page_name: pallet-list, - roles: [], - script: null, - standard: Yes, - style: null, - system_page: 0, - title: Pallet List -} diff --git a/westech_r2/westech_r2/page/pallet_list/pallet_list.py b/westech_r2/westech_r2/page/pallet_list/pallet_list.py deleted file mode 100644 index 0a0e433..0000000 --- a/westech_r2/westech_r2/page/pallet_list/pallet_list.py +++ /dev/null @@ -1,64 +0,0 @@ -import frappe - -@frappe.whitelist() -def get_pallets(page=1, page_size=100, sort_field="pallet_number", sort_dir="desc", status_filter="", search=""): - page = int(page) - page_size = int(page_size) - offset = (page - 1) * page_size - - conditions = [ - "pallet_number IS NOT NULL", - "pallet_number != ''", - "date_reserved IS NOT NULL", - "customer_number IS NOT NULL", - "customer_number != ''" - ] - - junk = ["", "0", "0000", "N/A", "TBD", "null", "999990", "999995"] - junk_list = "', '".join(junk) - conditions.append("pallet_number NOT IN ('" + junk_list + "')") - conditions.append("pallet_number NOT LIKE '999%'") - conditions.append("pallet_number REGEXP '^[0-9]'") - - if status_filter: - conditions.append("status = '" + frappe.db.escape(status_filter) + "'") - if search: - conditions.append("pallet_number LIKE '%" + frappe.db.escape(search) + "%'") - - where_clause = " AND ".join(conditions) - - total = frappe.db.sql("SELECT COUNT(*) FROM tabPallet WHERE " + where_clause)[0][0] - - pallets = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE " + where_clause + " ORDER BY CAST(pallet_number AS UNSIGNED) " + sort_dir + " LIMIT " + str(page_size) + " OFFSET " + str(offset), as_dict=True) - - empty_pallet = frappe.db.sql("SELECT name, pallet_number, date_reserved, received_date, customer_number, company_name, inbound_weight, tester, description, qty_to_sales, weight_to_sales, finish_date, notes, status FROM tabPallet WHERE date_reserved IS NULL AND (customer_number IS NULL OR customer_number = '') AND pallet_number NOT IN ('" + junk_list + "') AND pallet_number NOT LIKE '999%' AND pallet_number REGEXP '^[0-9]' ORDER BY CAST(pallet_number AS UNSIGNED) DESC LIMIT 1", as_dict=True) - - result = [] - if empty_pallet: - empty_pallet[0]["_is_new"] = True - result.append(empty_pallet[0]) - result.extend(pallets) - - return {"pallets": result, "total": total, "page": page, "page_size": page_size} - -@frappe.whitelist() -def update_pallet(docname, field, value): - pallet = frappe.get_doc("Pallet", docname) - pallet.set(field, value) - pallet.save(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "message": "Updated " + field} - -@frappe.whitelist() -def create_pallet(data): - data = frappe.parse_json(data) - pallet = frappe.new_doc("Pallet") - pallet.pallet_number = data.get("pallet_number") - pallet.status = data.get("status", "Received") - pallet.date_reserved = data.get("date_reserved") - for field, value in data.items(): - if field not in ["pallet_number", "status", "date_reserved"] and value: - pallet.set(field, value) - pallet.insert(ignore_permissions=True) - frappe.db.commit() - return {"status": "ok", "name": pallet.name} diff --git a/westech_r2/westech_r2/page/route-planner/route-planner.html b/westech_r2/westech_r2/page/route-planner/route-planner.html deleted file mode 100644 index 0116139..0000000 --- a/westech_r2/westech_r2/page/route-planner/route-planner.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Route Planner

-

Optimize pickup routes for scheduled pickups.

-
diff --git a/westech_r2/westech_r2/page/route-planner/route-planner.js b/westech_r2/westech_r2/page/route-planner/route-planner.js deleted file mode 100644 index 9d8ff74..0000000 --- a/westech_r2/westech_r2/page/route-planner/route-planner.js +++ /dev/null @@ -1,38 +0,0 @@ -frappe.pages["route-planner"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Route Planner", - single_column: true - }); - - frappe.call({ - method: "westech_r2.api.optimize_routes.get_scheduled_pickups", - callback: function(r) { - if (r.message) { - renderRoutePlanner(page, r.message); - } - } - }); - - function renderRoutePlanner(page, data) { - var h = "
"; - h += "

Route Planner

"; - h += "

Schedule and optimize pickup routes.

"; - h += "
"; - h += ""; - h += "
"; - h += "
"; - $(page.body).html(h); - - $("#optimize-btn").on("click", function() { - frappe.call({ - method: "westech_r2.api.optimize_routes.optimize_routes", - callback: function(r) { - if (r.message) { - frappe.show_alert({message: "Routes optimized", indicator: "green"}); - } - } - }); - }); - } -}; diff --git a/westech_r2/westech_r2/page/route_planner/route_planner.html b/westech_r2/westech_r2/page/route_planner/route_planner.html deleted file mode 100644 index 0116139..0000000 --- a/westech_r2/westech_r2/page/route_planner/route_planner.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

Route Planner

-

Optimize pickup routes for scheduled pickups.

-
diff --git a/westech_r2/westech_r2/page/route_planner/route_planner.js b/westech_r2/westech_r2/page/route_planner/route_planner.js deleted file mode 100644 index 9d8ff74..0000000 --- a/westech_r2/westech_r2/page/route_planner/route_planner.js +++ /dev/null @@ -1,38 +0,0 @@ -frappe.pages["route-planner"].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: "Route Planner", - single_column: true - }); - - frappe.call({ - method: "westech_r2.api.optimize_routes.get_scheduled_pickups", - callback: function(r) { - if (r.message) { - renderRoutePlanner(page, r.message); - } - } - }); - - function renderRoutePlanner(page, data) { - var h = "
"; - h += "

Route Planner

"; - h += "

Schedule and optimize pickup routes.

"; - h += "
"; - h += ""; - h += "
"; - h += "
"; - $(page.body).html(h); - - $("#optimize-btn").on("click", function() { - frappe.call({ - method: "westech_r2.api.optimize_routes.optimize_routes", - callback: function(r) { - if (r.message) { - frappe.show_alert({message: "Routes optimized", indicator: "green"}); - } - } - }); - }); - } -}; diff --git a/westech_r2/westech_r2/page/sales-manager/sales-manager.html b/westech_r2/westech_r2/page/sales-manager/sales-manager.html deleted file mode 100644 index e37f258..0000000 --- a/westech_r2/westech_r2/page/sales-manager/sales-manager.html +++ /dev/null @@ -1,83 +0,0 @@ -
- - -
-
-
-
-
Current
-

0-30 days

-
-
-
-
-
-
-
Stale
-

30-60 days

-
-
-
-
-
-
-
Aging
-

60-90 days

-
-
-
-
-
-
-
Expired
-

90+ days

-
-
-
-
- -
-
-
- - - - - -
- - -
-
- -
- - - - - - - - - - - - - - - - - - -
SerialItemGradeSpecsScoreTierMarket RangeSuggestedAgeFinal PriceActions
-
- - -
diff --git a/westech_r2/westech_r2/page/sales-manager/sales-manager.js b/westech_r2/westech_r2/page/sales-manager/sales-manager.js deleted file mode 100644 index e5b1183..0000000 --- a/westech_r2/westech_r2/page/sales-manager/sales-manager.js +++ /dev/null @@ -1,205 +0,0 @@ -frappe.pages['sales-manager'].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: 'Sales Manager', - single_column: true - }); - - var $content = $(wrapper).find('.page-content'); - $content.empty(); - - var html = ` -
- - -
-
-
-
-
Current
-

0-30 days

-
-
-
-
-
-
-
Stale
-

30-60 days

-
-
-
-
-
-
-
Aging
-

60-90 days

-
-
-
-
-
-
-
Expired
-

90+ days

-
-
-
-
- -
-
-
- - - - - -
- - -
-
- -
- - - - - - - - - - - - - - - - - -
SerialItemGradeSpecsScoreTierMarket RangeSuggestedAgeFinal PriceActions
-
- - -
- `; - - $content.html(html); - loadPricingData(); - - $('#btn-refresh').on('click', function() { - loadPricingData(); - }); - - $('#btn-batch-score').on('click', function() { - frappe.confirm('Calculate scores for all serials?', function() { - frappe.call({ - method: 'westech_r2.api.scoring.batch_calculate_scores', - args: {batch_size: 500}, - callback: function(r) { - if (r.message) { - frappe.msgprint('Updated: ' + r.message.updated + - ', Scrap: ' + r.message.scrap + - ', Errors: ' + r.message.errors); - loadPricingData(); - } - } - }); - }); - }); - - $('#btn-all, #btn-current, #btn-stale, #btn-aging, #btn-expired').on('click', function() { - var filter = $(this).attr('id').replace('btn-', ''); - filterTable(filter); - }); -}; - -function loadPricingData() { - $('#loading').show(); - $('#pricing-tbody').empty(); - - frappe.call({ - method: 'westech_r2.api.scoring.get_sales_pricing_data', - args: {limit: 100}, - callback: function(r) { - $('#loading').hide(); - if (r.message && r.message.serials) { - renderPricingTable(r.message.serials); - } - } - }); -} - -function renderPricingTable(serials) { - var tbody = $('#pricing-tbody'); - tbody.empty(); - - serials.forEach(function(s) { - var ageBadge = '' + - (s.age.status || 'unknown') + ''; - var tierBadge = '' + (s.tier || 'N/A') + ''; - var specs = []; - if (s.processor) specs.push(s.processor); - if (s.ram) specs.push(s.ram); - var marketRange = '$' + (s.market.low || 0).toFixed(0) + ' - $' + (s.market.high || 0).toFixed(0); - - var row = '' + - '' + s.serial_no + '' + - '' + (s.item_name || s.item_code) + '' + - '' + (s.cosmetic_grade || '') + '' + - '' + specs.join(' / ') + '' + - '' + (s.score || 0) + '' + - '' + tierBadge + '' + - '' + marketRange + '' + - '$' + (s.suggested_price || 0).toFixed(2) + '' + - '' + ageBadge + '
' + s.age.days + 'd' + - '' + - '' + - ''; - tbody.append(row); - }); - - $('.btn-save-price').on('click', function() { - var serial = $(this).data('serial'); - var price = $(this).closest('tr').find('.final-price').val(); - saveFinalPrice(serial, price); - }); -} - -function filterTable(filter) { - if (filter === 'all') { - $('#pricing-tbody tr').show(); - } else { - $('#pricing-tbody tr').hide(); - $('#pricing-tbody tr[data-age="' + filter + '"]').show(); - } -} - -function saveFinalPrice(serial_no, price) { - frappe.call({ - method: 'frappe.client.set_value', - args: { - doctype: 'Serial No', - name: serial_no, - fieldname: { - 'assigned_price': price, - 'pricing_status': 'Manual Override' - } - }, - callback: function(r) { - if (!r.exc) { - frappe.show_alert({message: 'Price saved for ' + serial_no, indicator: 'green'}); - } - } - }); -} diff --git a/westech_r2/westech_r2/page/sales-manager/sales-manager.json b/westech_r2/westech_r2/page/sales-manager/sales-manager.json deleted file mode 100644 index e1d3477..0000000 --- a/westech_r2/westech_r2/page/sales-manager/sales-manager.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "title": "Sales Manager", - "route": "sales-manager", - "icon": "fa fa-dollar-sign", - "roles": [ - { - "role": "System Manager" - }, - { - "role": "Sales User" - } - ], - "standard": "Yes", - "type": "page", - "module": "Westech R2", - "doctype": "Page", - "name": "sales-manager" -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/sales-manager/sales_manager.py b/westech_r2/westech_r2/page/sales-manager/sales_manager.py deleted file mode 100644 index d2aad02..0000000 --- a/westech_r2/westech_r2/page/sales-manager/sales_manager.py +++ /dev/null @@ -1,6 +0,0 @@ -import frappe -from frappe import _ - -def get_context(context): - context.no_cache = 1 - return context diff --git a/westech_r2/westech_r2/page/sales_manager/sales_manager.html b/westech_r2/westech_r2/page/sales_manager/sales_manager.html deleted file mode 100644 index e37f258..0000000 --- a/westech_r2/westech_r2/page/sales_manager/sales_manager.html +++ /dev/null @@ -1,83 +0,0 @@ -
- - -
-
-
-
-
Current
-

0-30 days

-
-
-
-
-
-
-
Stale
-

30-60 days

-
-
-
-
-
-
-
Aging
-

60-90 days

-
-
-
-
-
-
-
Expired
-

90+ days

-
-
-
-
- -
-
-
- - - - - -
- - -
-
- -
- - - - - - - - - - - - - - - - - - -
SerialItemGradeSpecsScoreTierMarket RangeSuggestedAgeFinal PriceActions
-
- - -
diff --git a/westech_r2/westech_r2/page/sales_manager/sales_manager.js b/westech_r2/westech_r2/page/sales_manager/sales_manager.js deleted file mode 100644 index e5b1183..0000000 --- a/westech_r2/westech_r2/page/sales_manager/sales_manager.js +++ /dev/null @@ -1,205 +0,0 @@ -frappe.pages['sales-manager'].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: 'Sales Manager', - single_column: true - }); - - var $content = $(wrapper).find('.page-content'); - $content.empty(); - - var html = ` -
- - -
-
-
-
-
Current
-

0-30 days

-
-
-
-
-
-
-
Stale
-

30-60 days

-
-
-
-
-
-
-
Aging
-

60-90 days

-
-
-
-
-
-
-
Expired
-

90+ days

-
-
-
-
- -
-
-
- - - - - -
- - -
-
- -
- - - - - - - - - - - - - - - - - -
SerialItemGradeSpecsScoreTierMarket RangeSuggestedAgeFinal PriceActions
-
- - -
- `; - - $content.html(html); - loadPricingData(); - - $('#btn-refresh').on('click', function() { - loadPricingData(); - }); - - $('#btn-batch-score').on('click', function() { - frappe.confirm('Calculate scores for all serials?', function() { - frappe.call({ - method: 'westech_r2.api.scoring.batch_calculate_scores', - args: {batch_size: 500}, - callback: function(r) { - if (r.message) { - frappe.msgprint('Updated: ' + r.message.updated + - ', Scrap: ' + r.message.scrap + - ', Errors: ' + r.message.errors); - loadPricingData(); - } - } - }); - }); - }); - - $('#btn-all, #btn-current, #btn-stale, #btn-aging, #btn-expired').on('click', function() { - var filter = $(this).attr('id').replace('btn-', ''); - filterTable(filter); - }); -}; - -function loadPricingData() { - $('#loading').show(); - $('#pricing-tbody').empty(); - - frappe.call({ - method: 'westech_r2.api.scoring.get_sales_pricing_data', - args: {limit: 100}, - callback: function(r) { - $('#loading').hide(); - if (r.message && r.message.serials) { - renderPricingTable(r.message.serials); - } - } - }); -} - -function renderPricingTable(serials) { - var tbody = $('#pricing-tbody'); - tbody.empty(); - - serials.forEach(function(s) { - var ageBadge = '' + - (s.age.status || 'unknown') + ''; - var tierBadge = '' + (s.tier || 'N/A') + ''; - var specs = []; - if (s.processor) specs.push(s.processor); - if (s.ram) specs.push(s.ram); - var marketRange = '$' + (s.market.low || 0).toFixed(0) + ' - $' + (s.market.high || 0).toFixed(0); - - var row = '' + - '' + s.serial_no + '' + - '' + (s.item_name || s.item_code) + '' + - '' + (s.cosmetic_grade || '') + '' + - '' + specs.join(' / ') + '' + - '' + (s.score || 0) + '' + - '' + tierBadge + '' + - '' + marketRange + '' + - '$' + (s.suggested_price || 0).toFixed(2) + '' + - '' + ageBadge + '
' + s.age.days + 'd' + - '' + - '' + - ''; - tbody.append(row); - }); - - $('.btn-save-price').on('click', function() { - var serial = $(this).data('serial'); - var price = $(this).closest('tr').find('.final-price').val(); - saveFinalPrice(serial, price); - }); -} - -function filterTable(filter) { - if (filter === 'all') { - $('#pricing-tbody tr').show(); - } else { - $('#pricing-tbody tr').hide(); - $('#pricing-tbody tr[data-age="' + filter + '"]').show(); - } -} - -function saveFinalPrice(serial_no, price) { - frappe.call({ - method: 'frappe.client.set_value', - args: { - doctype: 'Serial No', - name: serial_no, - fieldname: { - 'assigned_price': price, - 'pricing_status': 'Manual Override' - } - }, - callback: function(r) { - if (!r.exc) { - frappe.show_alert({message: 'Price saved for ' + serial_no, indicator: 'green'}); - } - } - }); -} diff --git a/westech_r2/westech_r2/page/sales_manager/sales_manager.json b/westech_r2/westech_r2/page/sales_manager/sales_manager.json deleted file mode 100644 index e1d3477..0000000 --- a/westech_r2/westech_r2/page/sales_manager/sales_manager.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "title": "Sales Manager", - "route": "sales-manager", - "icon": "fa fa-dollar-sign", - "roles": [ - { - "role": "System Manager" - }, - { - "role": "Sales User" - } - ], - "standard": "Yes", - "type": "page", - "module": "Westech R2", - "doctype": "Page", - "name": "sales-manager" -} \ No newline at end of file diff --git a/westech_r2/westech_r2/page/sales_manager/sales_manager.py b/westech_r2/westech_r2/page/sales_manager/sales_manager.py deleted file mode 100644 index d2aad02..0000000 --- a/westech_r2/westech_r2/page/sales_manager/sales_manager.py +++ /dev/null @@ -1,6 +0,0 @@ -import frappe -from frappe import _ - -def get_context(context): - context.no_cache = 1 - return context