diff --git a/web/kanban-board.js b/web/kanban-board.js index 85644dd..d4352a2 100644 --- a/web/kanban-board.js +++ b/web/kanban-board.js @@ -266,6 +266,9 @@ function renderBoard(){ const order=board.orders.find(o=>o.id===e.dataTransfer.getData('text/plain')); const machine=state==='imp'?dropMachine(column,e.clientY):null;markLane(column,null); if(!order)return; + // The card may have moved to another machine since the drag began (the + // board reloaded in between, Sentry DTF-WEB-1P): said, not refused. + if(!mayAct(order)){say('Pedido da '+(order.machine?.name||'outra máquina')+': só quem está nela move o card.');clearDrop();return;} // Above 1 m Finalizado needs the review photo: the drop opens Revisão // instead of a refused move (Sentry DTF-WEB-B). if(state==='fin'&&order.state==='rev'&&needsReviewPhoto(order)){ diff --git a/web/kanban.js b/web/kanban.js index 19d7402..dde7302 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -669,7 +669,8 @@ async function syncFolder(force=false){ // save goes back for another to take. Written whole, then named .pdf. let printed=0; for(const r of receipts){ - try{await api('/orders/'+r.order+'/receipt/claim',{});}catch(e){if(e.status===409)continue;throw e;} + // Another computer took it first: expected, not reported (Sentry DTF-WEB-1N). + try{await api('/orders/'+r.order+'/receipt/claim',{},{expected:[409]});}catch(e){if(e.status===409)continue;throw e;} await step(r.name,async()=>{try{ const res=await fetchFile('/api/operator/orders/'+r.order+'/receipt'); if(!res.ok||!res.body)throw new Error('não foi possível gerar '+r.name+' (erro '+res.status+').');