 else {
            alert('Invoice settings updated successfully!');
            // Optionally redirect or reload
            // window.location.href = '/invoices';
        }
    })
    .catch(error => {
        console.error('Error:', error);
        alert('Failed to update invoice settings');
    });
}

function resetToDefaults() {
    if (confirm('Are you sure you want to reset all settings to their default values?')) {
        // Reset form to default values
        document.getElementById('invoiceNumbe