Download script.js from Sjokode/facturease-pro-invoice-wizard: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/spaces/Sjokode/facturease-pro-invoice-wizard/resolve/main/script.js
- Command line
-
hf download hf://spaces/Sjokode/facturease-pro-invoice-wizard/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Sjokode/facturease-pro-invoice-wizard/resolve/main/script.js
1.8 kB
| // Simple demo functionality (not meant for production) | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // This would be replaced with real functionality in a production environment | |
| console.log('Invoice editor loaded'); | |
| // Example: Calculate line totals when quantity or price changes | |
| const quantityInputs = document.querySelectorAll('input[type="number"][min="0"]'); | |
| quantityInputs.forEach(input => { | |
| input.addEventListener('change', function() { | |
| const row = this.closest('tr'); | |
| if (row) { | |
| const quantity = parseFloat(this.value) || 0; | |
| const priceInput = row.querySelector('input[type="number"][step="0.01"]:not([min="0"])'); | |
| const price = parseFloat(priceInput?.value) || 0; | |
| const totalCell = row.querySelector('td:nth-child(6)'); | |
| if (totalCell) { | |
| totalCell.textContent = (quantity * price).toFixed(2) + ' €'; | |
| } | |
| } | |
| }); | |
| }); | |
| // Similar for price inputs | |
| const priceInputs = document.querySelectorAll('input[type="number"][step="0.01"]:not([min="0"])'); | |
| priceInputs.forEach(input => { | |
| input.addEventListener('change', function() { | |
| const row = this.closest('tr'); | |
| if (row) { | |
| const price = parseFloat(this.value) || 0; | |
| const quantityInput = row.querySelector('input[type="number"][min="0"]'); | |
| const quantity = parseFloat(quantityInput?.value) || 0; | |
| const totalCell = row.querySelector('td:nth-child(6)'); | |
| if (totalCell) { | |
| totalCell.textContent = (quantity * price).toFixed(2) + ' €'; | |
| } | |
| } | |
| }); | |
| }); | |
| }); |