Email procedure (beta), WorkFlow update
This commit is contained in:
+33
-4
@@ -35,6 +35,7 @@ from app.ui.widgets.orders_table import OrdersTableView
|
||||
from app.ui.widgets.dashboard import DashboardWidget
|
||||
from app.ui.widgets.order_detail_dialog import OrderDetailDialog
|
||||
from app.ui.widgets.return_label_dialog import ReturnLabelDialog
|
||||
from app.ui.widgets.pack_ticket_dialog import PackTicketDialog
|
||||
from app.workers import (
|
||||
FetchOrdersWorker,
|
||||
SendToShipStationWorker,
|
||||
@@ -42,6 +43,7 @@ from app.workers import (
|
||||
load_orders_by_view,
|
||||
get_dashboard_stats,
|
||||
mark_shipstation_sent,
|
||||
save_pack_data,
|
||||
reset_local_database,
|
||||
)
|
||||
|
||||
@@ -103,6 +105,11 @@ class MainWindow(QMainWindow):
|
||||
export_action.triggered.connect(self._on_export_clicked)
|
||||
toolbar.addAction(export_action)
|
||||
|
||||
pack_action = QAction("Pack Ticket", self)
|
||||
pack_action.setToolTip("Enter serial numbers and mark packed - select a ticket first")
|
||||
pack_action.triggered.connect(self._on_pack_ticket_clicked)
|
||||
toolbar.addAction(pack_action)
|
||||
|
||||
toolbar.addSeparator()
|
||||
|
||||
emergency_action = QAction("Send to ShipStation", self)
|
||||
@@ -410,14 +417,36 @@ class MainWindow(QMainWindow):
|
||||
self.status_label.setText("Return label creation failed.")
|
||||
QMessageBox.critical(self, "Return label creation failed", message)
|
||||
|
||||
def _on_pack_ticket_clicked(self) -> None:
|
||||
order = self.orders_table.selected_order()
|
||||
if order is None:
|
||||
QMessageBox.information(
|
||||
self,
|
||||
"No ticket selected",
|
||||
"Select a ticket in Active Orders first, then click Pack Ticket.",
|
||||
)
|
||||
return
|
||||
|
||||
dialog = PackTicketDialog(order, self)
|
||||
if dialog.exec() != QDialog.DialogCode.Accepted:
|
||||
return
|
||||
|
||||
ticket_number = order.ticket_number or order.external_id
|
||||
save_pack_data(ticket_number, dialog.get_serial_numbers(), dialog.get_packed())
|
||||
self._refresh_everything()
|
||||
self.status_label.setText(f"Saved pack data for {ticket_number}.")
|
||||
|
||||
def _on_reset_database_clicked(self) -> None:
|
||||
confirm = QMessageBox.warning(
|
||||
self,
|
||||
"Reset Local Database",
|
||||
"This clears every locally cached order (JIRA is still the real source of "
|
||||
"truth, so nothing there is affected). You'll need to click Import from JIRA "
|
||||
"afterward to repopulate, and Pull Tracking Numbers again if you rely on "
|
||||
"today's already-pulled tracking data.\n\n"
|
||||
"This clears every locally cached order, INCLUDING any serial numbers "
|
||||
"and packed status your team has already entered on the Pack Ticket "
|
||||
"dialog - that data doesn't come from JIRA, so a reset does not bring "
|
||||
"it back. JIRA itself is unaffected either way.\n\n"
|
||||
"You'll need to click Import from JIRA afterward to repopulate, and "
|
||||
"Pull Tracking Numbers again if you rely on today's already-pulled "
|
||||
"tracking data.\n\n"
|
||||
"Continue?",
|
||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
|
||||
QMessageBox.StandardButton.No,
|
||||
|
||||
Reference in New Issue
Block a user