export function checkFilesize(fieldId) {
    const maxFileSize = 64;


    if (document.getElementById(fieldId).files[0].size <= maxFileSize * 1024 * 1024) {
        return true;
    } else {
        alert('Die hochzuladende Datei darf die Größe von 64 MB nicht überschreiten');
        return false;
    }
}

export function invoiceCheckContactName() {
    const contact_name_val = document.getElementById('contact_name').value.trim() !== '';
    const payment = document.getElementById('confirm_payment');

    if (contact_name_val && document.getElementById('account_owner').value === '') {
        document.getElementById('account_owner').value = document.getElementById('contact_name').value.trim();

    } else {
        payment.style.display = 'none';
    }
}
