feat: each product's metres are summed and rounded once, and the 1 m minimum is once per order (Marcus, 2026-12-03)
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 8m24s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m14s
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 8m24s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m14s
Marcus: "o pedido mínimo de um metro deve ser somente para o primeiro metro, após isso deve se somar a metragem de cada arquivo", "Soma tudo e arredonda uma vez só", and for different products "Pode ser sim": each product apart at its price, the minimum for the whole order. Order #246 (three ready sheets of 3,74, 0,24 and 0,22 m) was 5,80 m with 1 m per item; it is now 4,20 m. pricing.bill_order replaces the per-item minimum and bill_splits: per product the exact lengths (a ready sheet without its gaps) are rounded once with the 8 mm grace, the minimum's difference goes to the first item's product, and each product's total is shared back to its items in 10 cm steps (each its length rounded down, the missing steps to the largest fractions, the minimum to the product's first item), for Tiny's 10 cm SKUs and the cards. A share of 0 m adds no Tiny line. The print file's guard allows an item one 10 cm step under its length. The Site cart shares the same way (cobrarPedido), split sheets round once, the buy box says the items of a product are summed and rounded once, and the Montador's estimate rounds its sum once. Contract: output/revisao/contrato-minimo-pedido.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,8 +65,13 @@
|
||||
// 10 cm, e até 8 mm a mais ficam por nossa conta.
|
||||
const exata=n1(base*100)+' cm';
|
||||
const aMais=Math.round((base-it.cob)*1000);
|
||||
$('cObs').textContent =
|
||||
it.cob===MINIMO_M && base<MINIMO_M
|
||||
// Com outros itens do mesmo produto no carrinho, a metragem é a da soma,
|
||||
// arredondada uma vez só (Marcus, 03/12/2026).
|
||||
const juntos=itensAPagar().some(x=>x!==it && x.modo===it.modo);
|
||||
$('cObs').textContent = juntos
|
||||
? (ehFolha(it.modo)?'A folha tem ':'A montagem tem ')+exata+
|
||||
'. No carrinho, os itens deste produto somam e arredondam uma vez só, a cada 10 cm.'
|
||||
: it.cob===MINIMO_M && base<MINIMO_M
|
||||
? (ehFolha(it.modo) ? 'Pedido mínimo de 1 m.'
|
||||
: 'Pedido mínimo de 1 m: ainda cabem '+sobraCm+' cm de artes sem custo.')
|
||||
: it.cob<base-1e-6
|
||||
|
||||
Reference in New Issue
Block a user