fix: a transfer asks which part the new machine resumes from and names the old machine's .prt to delete (Marcus, 2026-12-01)

The hot folder takes a PNG in about 10 s and the Hoson queues it, so the
last part taken is not the one being ripped. The dialog lists the parts
(already taken or still in the folder) and asks where to resume once any
was taken; the new round starts there, and the parts from there on that
the old machine took are named as Hoson .prt files to delete, in the
toast, the card and the history. The film card no longer claims which part
prints: '2/3 partes com a máquina'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-12-01 09:39:58 -03:00
parent ea05ba6a31
commit 41e905555b
7 changed files with 111 additions and 38 deletions

View File

@@ -86,15 +86,16 @@ const residueBadge=item=>badge('! Resíduo aceito','warn','O cliente aceitou imp
const PRINTING={imprimindo:['Imprimindo','live','Já ripou, está rodando'],
aguardando:['Na vez','wait','Na hot folder, espera os da frente'],
ripando:['Ripando','rip','O Flexi está ripando enquanto o anterior roda']};
// A film in parts on its machine (items 10 and 13, Dropstar 2026-10-30):
// "parte 3/7 imprimindo · 4/7 ripando". Flexi rips the part it took last from
// the hot folder while the one before it prints.
// A film in parts on its machine (items 10 and 13, Dropstar 2026-10-30): how
// many parts the machine has taken. The hot folder takes a PNG in about 10 s
// and the Hoson queues it (Marcus, 2026-12-01), so a part taken is not known
// to be ripping or printing: the card says only what the folder shows.
function partsStep(order){
const hot=order.hot;if(!hot||hot.parts<2)return null;
const n=hot.parts, t=hot.taken;
if(!t)return ['Parte 1/'+n+' na hot folder','wait'];
if(t===1)return ['Parte 1/'+n+' ripando','rip'];
return ['Parte '+(t-1)+'/'+n+' imprimindo · '+t+'/'+n+' ripando','live'];
if(t<n)return [t+'/'+n+' partes com a máquina','live'];
return ['As '+n+' partes com a máquina','live'];
}
async function proofOk(order){
await api('/orders/'+order.id+'/proof',{});say('Prova do pedido #'+order.number+' conferida.');await load();
@@ -436,7 +437,8 @@ function cardFlags(order){
const transfers=order.transfers||[];
if(live&&transfers.length){const t=transfers[transfers.length-1];
out.push(['warn','Transferido · '+t.from_name+' → '+t.to_name,
'Motivo: '+t.reason+' · '+t.created_by+' em '+when(t.created_at)+(t.resumed_from>1?' · recomeçou da parte '+t.resumed_from:'')+'. Confira a emenda de tom.']);}
'Motivo: '+t.reason+' · '+t.created_by+' em '+when(t.created_at)+(t.resumed_from>1?' · recomeçou da parte '+t.resumed_from:'')+
(t.delete_prt?.length?' · apague da pasta do Hoson da '+t.from_name+': '+t.delete_prt.join(', '):'')+'. Confira a emenda de tom.']);}
if(order.snapshot.treatment){
const n=Number(order.snapshot.treatment.arts)||1;
out.push(['warn','Ajuste Fino · '+n+(n===1?' arte':' artes'),