Download app.js from alcantarm/intento2: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/spaces/alcantarm/intento2/resolve/main/app.js
- Command line
-
hf download hf://spaces/alcantarm/intento2/app.js
-
curl -L -o app.js https://huggingface.co/spaces/alcantarm/intento2/resolve/main/app.js
1.31 kB
| document.addEventListener('DOMContentLoaded', () => { | |
| const CLP = new Intl.NumberFormat('es-CL', { style:'currency', currency:'CLP', maximumFractionDigits:0 }); | |
| const input = document.getElementById('invoice-input'); | |
| const budgetInput = document.getElementById('budget-input'); | |
| const tbody = document.getElementById('tbody'); | |
| const budgetTbody = document.getElementById('budget-tbody-right'); | |
| const total = document.getElementById('total'); | |
| const errorEl = document.getElementById('error'); | |
| const budgetError = document.getElementById('budget-error'); | |
| const processBtn = document.getElementById('process-btn'); | |
| const resetBtn = document.getElementById('reset-btn'); | |
| const summary = document.getElementById('summary'); | |
| const recordsTbody = document.getElementById('records-tbody'); | |
| const docs = []; | |
| const records = []; | |
| let budgetFile = null; | |
| function fmtDate(iso) { return new Date(iso).toLocaleString(); } | |
| function randomAmount(min,max){ return Math.floor(Math.random()*(max-min+1))+min; } | |
| function randomFolio(){ return 'F'+Math.floor(100000+Math.random()*900000); } | |
| function renderDocs(){ | |
| total.textContent = `${docs.length} en total`; | |
| tbody.innerHTML = ''; | |
| if(!docs.length){ | |
| tbody.innerHTML = `<tr><td colspan="5" style="text-align:center;color:var(-- | |