From 057643e16727350a5cf20efe240feb169be1dca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Thu, 12 Nov 2026 15:20:12 -0300 Subject: [PATCH] fix: approving a reviewed quote no longer sends the acceptance stamps back A quote held for review whose customer accepted the residue or the stroke warning failed with "Confira os campos (422)" (DTF-WEB-8): the server stamps residue_accepted_at and stroke_choice_at on the draft's items, the Kanban sent the items back whole, and the item model forbids extra fields. The metres field also showed the float noise of the draft (212,32800000000012); it now shows up to three decimals. Co-Authored-By: Claude Opus 5.5 (1M context) --- web/kanban-quotes.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/kanban-quotes.js b/web/kanban-quotes.js index 399c6fc..8a8f849 100644 --- a/web/kanban-quotes.js +++ b/web/kanban-quotes.js @@ -185,7 +185,10 @@ function review(quote){ } const form=node('form',undefined,'rform'); const edits=quote.draft.items.map((item,index)=>{const fields={};body.append(quoteItem(item,fields,null,index,count)); - return ()=>({...item,metres:fields.metres.value,grade:Number(fields.grade.value)});}); + // The times the customer accepted a warning are stamped by the server + // (app/api/quotes.py) and not part of an item sent back (DTF-WEB-8). + const {residue_accepted_at,stroke_choice_at,...sent}=item; + return ()=>({...sent,metres:fields.metres.value,grade:Number(fields.grade.value)});}); const check=node('input');check.required=true; const submit=node('button','Aprovar cotação','btn pri lg'); foot.append(checkbox('Arquivos, metragem e nota conferidos',check),discardButton(quote),submit); @@ -258,7 +261,7 @@ function quoteItem(item,fields,priced,index=0,count=1){ info.append(notes); if(fields){ const grid=node('div',undefined,'inputs'); - fields.metres=node('input');Object.assign(fields.metres,{type:'number',min:'0.001',max:'12000',step:'any',value:item.metres,required:true}); + fields.metres=node('input');Object.assign(fields.metres,{type:'number',min:'0.001',max:'12000',step:'any',value:String(Number(Number(item.metres).toFixed(3))),required:true}); fields.grade=node('input');Object.assign(fields.grade,{type:'number',min:'0',max:'100',step:'1',value:item.grade,required:true}); const m=field('Metros conferidos',fields.metres,'O cliente pediu '+metres(item.metres)); const low=Number(item.grade)<60;