From 9e0d33ef47a95ac6af2276072a3d22fcfa03df4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 30 Nov 2026 12:20:35 -0300 Subject: [PATCH] fix: a pasted list needs the internal customer first, and its stamps with a reference show their picture in the preview (Rodada 5, C4) Co-Authored-By: Claude Opus 5.5 --- web/kanban-montador.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/kanban-montador.js b/web/kanban-montador.js index 04accbb..7eccf8b 100644 --- a/web/kanban-montador.js +++ b/web/kanban-montador.js @@ -433,7 +433,7 @@ async function montarLayout(token){ say('A estampa não pôde ser lida.',true);return; } const cargas=lines.flatMap((line,sourceIndex)=>Array.from({length:line.qty},(_,copyIndex)=>({ - a:{sourceIndex,giro:0,esp:false},img:line.ref?null:line.img,copyIndex,w:line.widthCm,h:line.heightCm,travado:false}))); + a:{sourceIndex,giro:0,esp:false},img:line.ref?null:line.img,foto:line.img,copyIndex,w:line.widthCm,h:line.heightCm,travado:false}))); let enc; try{enc=encaixar(cargas,MONTAR_FILM_CM);} catch(e){ @@ -474,7 +474,9 @@ function montarDrawPreview(layout){ ctx.rotate(giro*Math.PI/180); if(c.a&&c.a.esp)ctx.scale(-1,1); const dw=((giro%180===90)?p.h:p.w)*px, dh=((giro%180===90)?p.w:p.h)*px; - if(c.img)ctx.drawImage(c.img,-dw/2,-dh/2,dw,dh); + // A stamp with a reference packs as a box (img null); it draws its picture. + const picture=c.img||c.foto; + if(picture)ctx.drawImage(picture,-dw/2,-dh/2,dw,dh); else{ctx.fillStyle='#E7E7E3';ctx.fillRect(-dw/2,-dh/2,dw,dh);} ctx.restore(); } @@ -828,6 +830,8 @@ function montarListErrors(valid,skipped){ function montarOpenPaste(){ if(!montarKindNames().includes('interno')) return say('Seu perfil não monta lista colada: ela vira pedido Interno.',true); + // The list is always Interno: without the internal customer it could not be ordered. + if(!montarInternalReady())return say('Peça à Gestão para completar o cliente interno.',true); if(!montarFolderReady())return; const text=node('textarea',undefined,'montar-list-text'); text.id='montar-list-text';text.rows=12;text.spellcheck=false;text.placeholder='NX.226 C 2 ML-4471';