document.addEventListener('DOMContentLoaded', function() {
    setTimeout(function() {
        const alerts = document.querySelectorAll('.alert');
        alerts.forEach(alert => {
            alert.style.display = 'none';
        });
    }, 5000);
    
    const customerId = document.getElementById('customer_id');
    const customerName = document.getElementById('customer_name');
    
    if (customerId && customerName) {
        customerId.addEventListener('change', function() {
            if (this.value) {
                customerName.disabled = true;
                customerName.value = '';
            } else {
                customerName.disabled = false;
            }
        });
        
        customerName.addEventListener('input', function() {
            if (this.value) {
                customerId.value = '';
            }
        });
    }
});