feat: "Arte tratada" flags the orders whose final the team prepared, counted in Números
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 58s
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 58s
Dropstar's internal rules (2026-10-26) asked how to tell art that arrived ready from art the designer had to fix, and Marcus agreed on 2026-10-27 to mark it automatically, for the designer's productivity. - an order whose approved final is not the customer's art (not the file the system generated from it, not one of their originals, not a correction they sent) shows "Arte tratada" on its card and in the order, with who approved it - Números counts the period's treated orders, the share of all orders, and how many each person approved - the Kanban's cancel text: the money stays as the customer's credit, in Dropstar's financial control (rule D-15), no longer a refund - Números' machine table shows the orders waiting in Arte conferida again; it still looked for the old print queue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,9 @@
|
||||
Metros por hora: sobre o tempo em Imprimindo; pedidos imprimindo juntos na mesma máquina contam esse tempo uma vez.</p>
|
||||
<table class="log"><thead><tr><th scope="col">Máquina</th><th scope="col">Impresso</th><th scope="col">Metros por hora</th><th scope="col">Último finalizado</th><th scope="col">Agora</th></tr></thead><tbody id="stats-machines"></tbody></table>
|
||||
</section>
|
||||
<section class="statbox"><h2>Artes tratadas</h2>
|
||||
<p class="faint stats-hint">Pedidos do período em que o arquivo final aprovado não é a arte do cliente: alguém da equipe preparou. Por quem aprovou o arquivo.</p>
|
||||
<table class="log"><thead><tr><th scope="col">Quem aprovou</th><th scope="col">Pedidos</th></tr></thead><tbody id="stats-treated"></tbody></table></section>
|
||||
<section class="statbox"><h2>Tempo em cada etapa</h2>
|
||||
<p class="faint stats-hint">Tempo mediano por pedido: um pedido que voltou para a etapa soma o tempo de cada passagem.</p>
|
||||
<table class="log"><thead><tr><th scope="col">Etapa</th><th scope="col">Tempo mediano</th><th scope="col">Pedidos que passaram</th><th scope="col">Agora</th></tr></thead><tbody id="stats-stages"></tbody></table>
|
||||
|
||||
@@ -577,6 +577,7 @@ const PROOF_ABOVE_METRES=10;
|
||||
const PROOF_RULE='Até 30 cm, do trecho de traço mais fino, um pedaço de cada arte diferente; no máximo 3 provas por pedido, sem cobrança.';
|
||||
const needsProof=order=>!!order.snapshot.proof||order.snapshot.items.reduce((t,i)=>t+Number(i.billed_metres),0)>PROOF_ABOVE_METRES;
|
||||
const proofPending=order=>needsProof(order)&&!order.proof_ok_at&&order.state!=='fin'&&!order.cancelled_at;
|
||||
const TREATED_NOTE='O arquivo final foi preparado pela equipe, não é a arte que o cliente mandou.';
|
||||
// Mirrored by the customer (UV only, web/site-pdf.js): the room checks it before printing.
|
||||
const mirroredItem=item=>!!item.production?.sources?.some(source=>source.mirrored);
|
||||
const MIRROR_NOTE='O cliente espelhou a arte: confira antes de imprimir';
|
||||
@@ -737,6 +738,8 @@ function card(order){
|
||||
? badge('✓ Prova OK','ok','Conferida por '+order.proof_ok_by+' em '+when(order.proof_ok_at))
|
||||
: badge('Prova','warn',order.snapshot.proof?'O cliente pediu uma prova antes de imprimir':'Pedido acima de 10 m: prova antes do resto'));
|
||||
}
|
||||
// Arte tratada (Dropstar, 2026-10-27): the final is not the customer's art, someone prepared it.
|
||||
if(!order.cancelled_at&&order.treated)flags.append(badge('Arte tratada','info',TREATED_NOTE+' Aprovado por '+order.treated.by+'.'));
|
||||
c.append(artBox(s.items,'card-art'),top,buyerBlock(s,'cust'),meta,place(s.destination));
|
||||
if(order.machine&&order.state!=='fin'){const m=node('div',undefined,'place machine');m.append(icon(ICON_PRINTER),order.machine.name);c.append(m);}
|
||||
if(flags.children.length)c.append(flags);
|
||||
@@ -987,7 +990,7 @@ function moves(order){
|
||||
b.onclick=()=>{menu.hidden=true;toggle(cancelForm);};menu.append(b);
|
||||
const why=node('input');why.placeholder='Motivo do cancelamento';why.setAttribute('aria-label','Motivo do cancelamento');why.required=true;why.minLength=3;why.maxLength=1000;
|
||||
const go=node('button','Cancelar pedido #'+order.number,'btn danger');
|
||||
cancelForm.append(node('span','O pedido sai do quadro e fica em "Cancelados", com o pagamento e o histórico. O estorno, se houver, é feito no Mercado Pago, e o pedido no Tiny se cancela lá.','muted'),why,go);
|
||||
cancelForm.append(node('span','O pedido sai do quadro e fica em "Cancelados", com o pagamento e o histórico. O valor fica como crédito do cliente, no controle financeiro, e o pedido no Tiny se cancela lá.','muted'),why,go);
|
||||
cancelForm.onsubmit=async e=>{e.preventDefault();go.disabled=true;
|
||||
try{await api('/orders/'+order.id+'/cancel',{note:why.value.trim()});say('Pedido #'+order.number+' cancelado.');await load();}
|
||||
catch(error){say(error.message,true);go.disabled=false;}};
|
||||
@@ -1144,6 +1147,11 @@ function itemCard(order,item,index){
|
||||
status.append(icon(done?ICON_OK:ICON_WARN),node('span',done?'Arquivo final aprovado':'Falta aprovar o arquivo final',done?'ok':'warn'));
|
||||
body.append(status);
|
||||
}
|
||||
if(order.treated?.items.includes(index)){
|
||||
const treated=node('div',undefined,'file');
|
||||
treated.append(icon(ICON_OK),node('span','Arte tratada: '+TREATED_NOTE.charAt(0).toLowerCase()+TREATED_NOTE.slice(1)+' Aprovado por '+order.treated.by+'.'));
|
||||
body.append(treated);
|
||||
}
|
||||
const buttons=node('div',undefined,'buttons');
|
||||
if(fix&&!fix.expired)buttons.append(downloadButton('Correção',download(fix.upload_id)));
|
||||
else if(row?.status==='ready'&&row.detail?.source!=='original')buttons.append(downloadButton('PDF',download(row.upload_id)));
|
||||
@@ -1385,11 +1393,12 @@ async function loadStats(){
|
||||
kpi('Recebido',money(data.cents),'com frete'),
|
||||
kpi('Ticket médio',data.orders?money(Math.round(data.cents/data.orders)):'—'),
|
||||
kpi('Pedidos com correção',String(data.corrected),data.orders?pct+'% dos pedidos':null),
|
||||
kpi('Artes tratadas',String(data.treated.orders),data.orders?Math.round(100*data.treated.orders/data.orders)+'% dos pedidos':null),
|
||||
kpi('Do pagamento ao Finalizado',duration(data.lead.median_hours),data.lead.orders?'mediana de '+data.lead.orders+' pedidos':'nenhum finalizado'));
|
||||
statsChart($('stats-chart'),data.daily);
|
||||
const machineRows=data.machines.map(m=>{
|
||||
const tr=node('tr');if(!m.active)tr.classList.add('off');
|
||||
const now=[m.now.imp?m.now.imp+' imprimindo':'',m.now.fil?m.now.fil+' na fila':''].filter(Boolean).join(' · ');
|
||||
const now=[m.now.imp?m.now.imp+' imprimindo':'',m.now.tra?m.now.tra+' na fila':''].filter(Boolean).join(' · ');
|
||||
tr.append(node('td',m.name+(m.active?'':' · desativada')),
|
||||
node('td',m.orders?metres(m.metres)+' · '+m.orders+(m.orders>1?' pedidos':' pedido'):'nada'),
|
||||
node('td',m.metres_per_hour!=null?String(m.metres_per_hour).replace('.',',')+' m/h':'—'),
|
||||
@@ -1398,6 +1407,11 @@ async function loadStats(){
|
||||
return tr;});
|
||||
if(!machineRows.length){const tr=node('tr');const td=node('td','Nenhuma máquina cadastrada.','faint');td.colSpan=5;tr.append(td);machineRows.push(tr);}
|
||||
$('stats-machines').replaceChildren(...machineRows);
|
||||
// Who prepared the finals of the period's orders, for the designer's productivity.
|
||||
const treatedRows=data.treated.by.map(t=>{const tr=node('tr');
|
||||
tr.append(node('td',t.who),node('td',t.orders+(t.orders>1?' pedidos':' pedido')));return tr;});
|
||||
if(!treatedRows.length){const tr=node('tr');const td=node('td','Nenhuma arte tratada no período.','faint');td.colSpan=2;tr.append(td);treatedRows.push(tr);}
|
||||
$('stats-treated').replaceChildren(...treatedRows);
|
||||
const rows=['rec','tra','imp','cor','rev'].map(state=>{
|
||||
const tr=node('tr'),name=node('td'),sw=node('span',undefined,'swatch');sw.style.setProperty('--c',STAGE_COLORS[state]);
|
||||
name.append(sw,board.states[state]);
|
||||
|
||||
Reference in New Issue
Block a user