feat: "Gerar de novo" makes a ready print file again for the part size of now (order #36)
Some checks failed
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled

The first film over 15 m (#36) left a 15 m part of 4,8 GB decoded, which
the FlexiPRINT refuses (#30, 12,3 m and 3,9 GB, printed). PRINT_PART_CM
already sets the part size; an order already generated had no way to get
its new parts.

- POST /orders/{id}/print-files/again (produce): in Arte recebida or Arte
  conferida, without a customer correction, the finals that were the
  generated files stop counting, the order is back in Arte recebida (a
  step back recorded as "Arquivo gerado de novo") and every item is
  generated again; one rendering now is left alone.
- The order's "Próximo passo" offers "Gerar de novo" there, with a
  confirmation that the final must be approved again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-17 17:34:23 -03:00
parent e8931c2818
commit 27b26cd1ae
4 changed files with 80 additions and 1 deletions

View File

@@ -297,6 +297,18 @@ function nextBox(order){
note('Somente consulta: seu perfil não move pedidos.');
return composeNext(title,body,main,more);
}
// A ready file generated again, for the part size of now: a 15 m part is
// more than the FlexiPRINT opens (order #36, 2026-11-17). The approved
// generated final goes, so the order is back in Arte recebida.
if((st==='rec'||st==='tra')&&!order.proof_parent&&!fixed&&may('produce')&&
(order.print_files||[]).some(r=>r.status==='ready'))
more.push(button('Gerar de novo',async()=>{
if(!await ask('Gerar o arquivo de novo?','O sistema gera o arquivo do pedido de novo, com o tamanho de parte de agora. '+
'O arquivo final aprovado sai: o pedido fica em Arte recebida e o arquivo novo precisa ser aprovado.',
'Gerar de novo',{host:$('drawer')}))return;
await api('/orders/'+order.id+'/print-files/again',{});await load();
say('Gerando o arquivo do #'+order.number+' de novo. Aprove quando ficar pronto.');
},'btn quiet lg'));
const fixBtn=()=>{if(!trans.includes('cor')||!can('cor'))return;
const b=node('button','Pedir correção','btn ghost lg');b.type='button';b.dataset.move='cor';b.onclick=()=>correctionDialog(order);more.push(b);};
const proofBtn=(className='btn lg')=>{if(!proofPending(order)||order.proof_card||!may('print'))return null;