Aggiungi salto UDC nel picking barcode
This commit is contained in:
@@ -115,6 +115,44 @@ class BarcodeService:
|
||||
)
|
||||
return self._state
|
||||
|
||||
async def skip_current_picking_pallet(self) -> BarcodeActionResult:
|
||||
"""Mark the currently proposed picking pallet as skipped and advance."""
|
||||
|
||||
mode = str(self._state.mode or "")
|
||||
if mode not in ("priority_high", "priority_low"):
|
||||
return BarcodeActionResult(False, self._state, "Nessuna picking list attiva.")
|
||||
|
||||
id_stato = 1 if mode == "priority_high" else 0
|
||||
documento = str(self._state.document or "").strip()
|
||||
pallet = str(self._state.expected_pallet or "").strip()
|
||||
if not documento or not pallet:
|
||||
self._state.status_text = "Nessuna UDC da saltare."
|
||||
self._state.status_color = self.RED
|
||||
return BarcodeActionResult(False, self._state, self._state.status_text)
|
||||
|
||||
await self.repository.skip_picking_pallet(
|
||||
documento=documento,
|
||||
pallet=pallet,
|
||||
id_stato=id_stato,
|
||||
operator_id=self.operator_id,
|
||||
)
|
||||
queue_label = "Alta priorita' (F1)" if id_stato == 1 else "Bassa priorita' (F2)"
|
||||
self._current_priority_state = id_stato
|
||||
self._state = BarcodeViewState(
|
||||
mode="confirm",
|
||||
queue_label=queue_label,
|
||||
status_text="UDC saltata - chiusura manuale richiesta",
|
||||
status_color=self.RED,
|
||||
source_location=self._state.source_location,
|
||||
document=documento,
|
||||
customer="UDC non trovata",
|
||||
expected_pallet=pallet,
|
||||
destination_barcode=self.SHIPPED_BARCODE,
|
||||
auto_advance_delay_ms=1500,
|
||||
destination_readonly=True,
|
||||
)
|
||||
return BarcodeActionResult(True, self._state, self._state.status_text)
|
||||
|
||||
async def start_priority_queue(self, id_stato: int) -> BarcodeActionResult:
|
||||
"""Load the next item of the selected legacy priority queue."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user