Add client-side SAP import UI and printable DT paletization report - #2
Add client-side SAP import UI and printable DT paletization report#2hhhthiti wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5504e07eb9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| tr.innerHTML = ` | ||
| <td>${data.numeroTransporte || ""}</td> | ||
| <td>${item.sku || ""}</td> |
There was a problem hiding this comment.
Escape imported values before assigning
tr.innerHTML
This row template injects item.sku (and nearby fields) directly into innerHTML even though the values come from pasted SAP text. If a pasted field contains HTML with an event handler, it will execute when the DT is rendered, turning import data into script execution in the operator’s browser. Render these values via textContent (or sanitize) instead of interpolating raw strings into HTML.
Useful? React with 👍 / 👎.
| }; | ||
| } | ||
|
|
||
| dtStore[parsed.numeroTransporte].itens.push(parsed.item); |
There was a problem hiding this comment.
Replace existing DT items instead of always appending
For DTs already present in dtStore, imports always append new items and never reconcile old ones. Re-importing the same SAP extract (or importing a corrected extract) therefore duplicates rows and inflates totals in both the summary table and printable report. The update path should clear or de-duplicate the DT item list before adding freshly parsed lines.
Useful? React with 👍 / 👎.
Motivation
numeroTransporte) for paletization reporting and printing.padraofrom a remoteprodutostable when available and computepltFechado/fracaoto help packing decisions.Description
index.html,app.js, andstyles.cssimplementing a tabbed UI, import area, DT summary table, DT search/select, and a print-ready report sheet.app.jsto read TAB-separated columns, computepadrao,pltFechado, andfracao, and group items intodtStorekeyed bynumeroTransportewhich is persisted tolocalStorageunderSTORAGE_KEY.@supabase/supabase-js@2) and abuscarPadraoPorSkufunction that queries theprodutostable forfardos_por_paleteto override the padrao when present, with a publishable URL/key defined at the top ofapp.js.resumo-importacao, DT searching by suffix, loading DT into the printable sheet (#sheet-*elements), print trigger, and a hard-codedSTAR_PRODUCTStable rendered in the UI.Testing
Codex Task