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); }