diff --git a/westech_r2/__pycache__/__init__.cpython-312.pyc b/westech_r2/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 0b2fbe3..0000000 Binary files a/westech_r2/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/westech_r2/api/__pycache__/__init__.cpython-312.pyc b/westech_r2/api/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index 02f0bc7..0000000 Binary files a/westech_r2/api/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/westech_r2/api/__pycache__/ebay_pricing.cpython-312.pyc b/westech_r2/api/__pycache__/ebay_pricing.cpython-312.pyc deleted file mode 100644 index affd8e9..0000000 Binary files a/westech_r2/api/__pycache__/ebay_pricing.cpython-312.pyc and /dev/null differ diff --git a/westech_r2/page/ebay_pricing/__init__.py b/westech_r2/page/ebay-pricing/__init__.py similarity index 100% rename from westech_r2/page/ebay_pricing/__init__.py rename to westech_r2/page/ebay-pricing/__init__.py 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..7b5dc7e --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay-pricing.html @@ -0,0 +1,13 @@ +{% extends "templates/web.html" %} +{% block style %} + +{% endblock %} +{% block page_content %} +
+{% endblock %} diff --git a/westech_r2/page/ebay-pricing/ebay-pricing.js b/westech_r2/page/ebay-pricing/ebay-pricing.js new file mode 100644 index 0000000..9ec7a25 --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay-pricing.js @@ -0,0 +1,8 @@ +frappe.pages['ebay-pricing'].on_page_load = function(wrapper) { + var page = frappe.ui.make_app_page({ + parent: wrapper, + title: __('eBay Pricing'), + single_column: true + }); + $('

eBay Pricing

Search and batch price systems from eBay sold listings.

').appendTo(page.main); +}; diff --git a/westech_r2/page/ebay-pricing/ebay-pricing.json b/westech_r2/page/ebay-pricing/ebay-pricing.json new file mode 100644 index 0000000..ab9d81b --- /dev/null +++ b/westech_r2/page/ebay-pricing/ebay-pricing.json @@ -0,0 +1,26 @@ +{ + "creation": "2026-05-17 05:30:00.000000", + "docstatus": 0, + "doctype": "Page", + "icon": "fa fa-tags", + "modified": "2026-05-17 05:30:00.000000", + "modified_by": "Administrator", + "module": "Westech R2", + "name": "ebay-pricing", + "owner": "Administrator", + "page_name": "ebay-pricing", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Stock User" + }, + { + "role": "Sales User" + } + ], + "standard": "Yes", + "system_page": 0, + "title": "eBay Pricing" +} \ 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/ebay_pricing/ebay_pricing.html b/westech_r2/page/ebay_pricing/ebay_pricing.html deleted file mode 100644 index 1c6ebef..0000000 --- a/westech_r2/page/ebay_pricing/ebay_pricing.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "templates/web.html" %} -{% block style %} - -{% endblock %} -{% block page_content %} -
-{% endblock %} diff --git a/westech_r2/page/ebay_pricing/ebay_pricing.js b/westech_r2/page/ebay_pricing/ebay_pricing.js deleted file mode 100644 index 289a7e8..0000000 --- a/westech_r2/page/ebay_pricing/ebay_pricing.js +++ /dev/null @@ -1,212 +0,0 @@ -frappe.pages['ebay_pricing'].on_page_load = function(wrapper) { - var page = frappe.ui.make_app_page({ - parent: wrapper, - title: __('eBay Pricing'), - single_column: true - }); - - let $container = $(`
-
-
-
- -
- - - - -
-
-
-
-
- - - -
-
-
-
-
-
- -

Search for a model or run batch pricing

-
-
-
`).appendTo(page.main); - - $container.find('#ebay-search-btn').on('click', function() { - let query = $container.find('#ebay-search-input').val().trim(); - if (!query) { - frappe.msgprint(__('Enter a model to search')); - return; - } - search_ebay(query); - }); - - $container.find('#ebay-search-input').on('keypress', function(e) { - if (e.which === 13) { - $container.find('#ebay-search-btn').trigger('click'); - } - }); - - $container.find('#ebay-batch-btn').on('click', function() { - let size = $container.find('#ebay-batch-size').val(); - run_batch(size); - }); - - function search_ebay(query) { - frappe.call({ - method: 'westech_r2.api.ebay_pricing.search_model', - args: { query: query }, - freeze: true, - freeze_message: __('Searching eBay sold listings...'), - callback: function(r) { - if (r.message && r.message.results) { - render_results(r.message); - } else { - let msg = (r.message && r.message.message) || __('No results found'); - frappe.msgprint(msg); - } - } - }); - } - - function run_batch(size) { - frappe.call({ - method: 'westech_r2.api.ebay_pricing.run_batch', - args: { batch_size: size }, - freeze: true, - freeze_message: __('Running batch pricing...'), - callback: function(r) { - if (r.message) { - frappe.msgprint(__('Batch complete: {0} priced, {1} failed, {2} skipped', - [r.message.priced, r.message.failed, r.message.skipped])); - load_recent_pricing(); - } - } - }); - } - - function render_results(data) { - let $area = $container.find('#ebay-results-area').empty(); - if (!data.results || !data.results.length) { - $area.html(`
No results
`); - return; - } - - let html = ` - - - - - - - - `; - data.results.forEach(item => { - html += ` - - - - - - `; - }); - html += `
TitlePriceConditionSoldShipping
${frappe.utils.escape_html(item.title || '')}$${(item.price || 0).toFixed(2)}${frappe.utils.escape_html(item.condition || '')}${item.sold || ''}${item.shipping || ''}
`; - - if (data.pricing) { - html += `
-

Pricing Summary

-
-
Low: $${data.pricing.price_low}
-
High: $${data.pricing.price_high}
-
Average: $${data.pricing.price_average}
-
Median: $${data.pricing.price_auction}
-
-
-
Source: ${data.pricing.source}
-
Samples: ${data.pricing.sample_count}
-
-
`; - } - - $area.html(html); - } - - function load_recent_pricing() { - frappe.call({ - method: 'westech_r2.api.ebay_pricing.get_recent_pricing', - args: { limit: 50 }, - callback: function(r) { - if (r.message) { - render_pricing_grid(r.message); - } - } - }); - } - - function render_pricing_grid(items) { - let $area = $container.find('#ebay-results-area'); - if (!items || !items.length) { - $area.html(`
No pricing data yet
`); - return; - } - - let html = `

Recent Pricing Results

- - - - - - - - - - - - - - `; - - items.forEach(row => { - let status_class = 'status-needs'; - if (row.pricing_status === 'Priced') status_class = 'status-fresh'; - else if (row.pricing_status === 'Manual Override') status_class = 'status-fresh'; - else if (row.pricing_status === 'Expired') status_class = 'status-expired'; - else if (row.pricing_status === 'Error') status_class = 'status-error'; - - let age = row.days_since_pricing || 0; - let age_badge = age < 90 ? 'status-fresh' : (age < 120 ? 'status-aging' : 'status-expired'); - - html += ` - - - - - - - - - - - `; - }); - - html += `
ManufacturerModelStatusAgeLowHighAvgSamplesSourceLast Priced
${frappe.utils.escape_html(row.manufacturer || '')}${frappe.utils.escape_html(row.model || '')}${row.pricing_status}${age} days$${row.price_low || ''}$${row.price_high || ''}$${row.price_average || ''}${row.sample_count || ''}${row.source || ''}${frappe.datetime.str_to_user(row.scraped_at) || ''}
`; - $area.html(html); - } - - load_recent_pricing(); -}; diff --git a/westech_r2/page/ebay_pricing/ebay_pricing.json b/westech_r2/page/ebay_pricing/ebay_pricing.json deleted file mode 100644 index 66ffa03..0000000 --- a/westech_r2/page/ebay_pricing/ebay_pricing.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "creation": "2026-05-17 05:30:00.000000", - "docstatus": 0, - "doctype": "Page", - "icon": "fa fa-tags", - "modified": "2026-05-17 05:30:00.000000", - "modified_by": "Administrator", - "module": "Westech R2", - "name": "ebay_pricing", - "owner": "Administrator", - "page_name": "eBay Pricing", - "roles": [ - {"role": "System Manager"}, - {"role": "Stock User"}, - {"role": "Sales User"} - ], - "standard": "Yes", - "system_page": 0, - "title": "eBay Pricing" -} diff --git a/westech_r2/page/ebay_pricing/ebay_pricing.py b/westech_r2/page/ebay_pricing/ebay_pricing.py deleted file mode 100644 index 5bbfe5e..0000000 --- a/westech_r2/page/ebay_pricing/ebay_pricing.py +++ /dev/null @@ -1,9 +0,0 @@ -import frappe -from frappe import _ - -no_cache = 1 - -def get_context(context): - context.no_cache = 1 - context.title = _("eBay Pricing") - return context diff --git a/westech_r2/westech_r2/workspace/westech/westech.json b/westech_r2/westech_r2/workspace/westech/westech.json index 4d302c2..fd21793 100644 --- a/westech_r2/westech_r2/workspace/westech/westech.json +++ b/westech_r2/westech_r2/workspace/westech/westech.json @@ -1,7 +1,7 @@ { "charts": [], "content": "[{\"type\": \"header\", \"data\": {\"text\": \"Westech Recyclers\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"New Intake\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Pallets\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Pallet List\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Scheduled Pickups\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Route Planner\"}}, {\"type\": \"spacer\", \"data\": {}}, {\"type\": \"header\", \"data\": {\"text\": \"Tools\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"EIM Device Portal\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"R2 Data Tracking\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Wes AI Assistant\"}}, {\"type\": \"spacer\", \"data\": {}}, {\"type\": \"header\", \"data\": {\"text\": \"Records\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Customers\"}}, {\"type\": \"shortcut\", \"data\": {\"shortcut_name\": \"Suppliers\"}}]", - "creation": "2026-05-16 17:36:54.540512", + "creation": "2026-05-17 05:39:20.222818", "custom_blocks": [], "docstatus": 0, "doctype": "Workspace", @@ -100,7 +100,7 @@ "type": "Link" } ], - "modified": "2026-05-16 18:45:11.778496", + "modified": "2026-05-17 06:07:36.785015", "modified_by": "Administrator", "module": "Westech R2", "name": "Westech", @@ -176,10 +176,10 @@ }, { "doc_view": "", - "icon": "truck", - "label": "Truck Profiles", - "link_to": "Truck Profile", - "type": "DocType" + "icon": "fa fa-tags", + "label": "eBay Pricing", + "link_to": "ebay-pricing", + "type": "Page" } ], "title": "Westech"