From 7a908060fcde96e88fc01d0ceadcb60c92e4e003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 2 Oct 2026 11:25:26 -0300 Subject: [PATCH] fix: the Kanban shows the package's real weight and what Jadlog charges it as MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Frete Jadlog · 4,541 kg" read as if 2,30 m of film weighed 4.5 kg. It now reads "0,47 kg · cobrado como 4,54 kg pela caixa" when the box's cubed weight is what Jadlog charges. Co-Authored-By: Claude Opus 5.5 --- web/kanban.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/kanban.js b/web/kanban.js index ba313e5..c81fbf1 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -120,6 +120,14 @@ function facts(pairs){ } const sheetSize=p=>p?cm(p.film_width_cm)+' × '+cm(p.height_cm)+' cm':null; const hoursSince=v=>Math.floor((Date.now()-new Date(v))/3600000); +// The freight's weight: what the package weighs and, when Jadlog charges the +// box's size instead (the cubed weight), what it is charged as. +function freightWeight(fr){ + const kg=v=>Number(v).toLocaleString('pt-BR',{maximumFractionDigits:2})+' kg'; + if(!fr?.weight_kg)return ''; + if(fr.real_kg&&Number(fr.real_kg)1?'Itens':'Item','eyebrow')); const itemsList=node('div');itemsList.style.display='flex';itemsList.style.flexDirection='column';itemsList.style.gap='10px'; @@ -607,7 +615,7 @@ function review(quote){ const sums=node('div',undefined,'qsums');const fr=quote.approved.freight||{}; const itemsTotal=quote.approved.items.reduce((t,i)=>t+i.total_cents,0); sums.append(node('span','Itens '),node('b',money(itemsTotal)), - node('span',fr.service==='pickup'||!fr.total_cents?' · Retirada ':' · Frete Jadlog'+(fr.weight_kg?' · '+String(fr.weight_kg).replace('.',',')+' kg':'')+' '), + node('span',fr.service==='pickup'||!fr.total_cents?' · Retirada ':' · Frete Jadlog'+(fr.weight_kg?' · '+freightWeight(fr):'')+' '), node('b',fr.total_cents?money(fr.total_cents):'grátis')); content.append(sums); }