      e.preventDefault();
        submitInvoiceSettings();
    });
    
    // Initialize format preview
    updateFormatPreview();
});

function updateFormatPreview() {
    const prefix = document.getElementById('invoiceNumberPrefix').value || 'INV-';
    const format = document.getElementById('invoiceNumberFormat').value;
    const currentDate = new Date();
    const year = currentDate.getFullYear();
    const month = String(currentDate.getMonth() + 1).padStart(2, '0');
    
    let preview = format;
    