Invoices can be uploaded
This commit is contained in:
23
resources/js/components/InvoiceUploadChecks.js
Normal file
23
resources/js/components/InvoiceUploadChecks.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user