Remove data.csv file and update README to reflect new features including CSV import and banking account management. Enhance TransactionsTable and KreditorTable components with banking account handling, including UI updates and validation logic. Update SQL schema to support banking accounts and adjust API routes for improved data handling. Implement new document rendering logic for banking transactions and enhance recipient rendering with banking account status. Add new views and indexes for better transaction management.
This commit is contained in:
@@ -149,8 +149,12 @@ class KreditorService {
|
||||
validateKreditorData(kreditorData) {
|
||||
const errors = [];
|
||||
|
||||
if (!kreditorData.iban || kreditorData.iban.trim() === '') {
|
||||
errors.push('IBAN ist erforderlich');
|
||||
// IBAN is only required for non-banking accounts that are not manual assignments
|
||||
const isBanking = kreditorData.is_banking || false;
|
||||
const hasIban = kreditorData.iban && kreditorData.iban.trim() !== '';
|
||||
|
||||
if (!isBanking && !hasIban) {
|
||||
errors.push('IBAN ist erforderlich (außer für Banking-Konten oder manuelle Zuordnungen)');
|
||||
}
|
||||
|
||||
if (!kreditorData.name || kreditorData.name.trim() === '') {
|
||||
@@ -161,14 +165,20 @@ class KreditorService {
|
||||
errors.push('Kreditor-ID ist erforderlich');
|
||||
}
|
||||
|
||||
// Basic IBAN format validation (simplified)
|
||||
if (kreditorData.iban && !/^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/i.test(kreditorData.iban.replace(/\s/g, ''))) {
|
||||
// Basic IBAN format validation (simplified) - only if IBAN is provided
|
||||
if (hasIban && !/^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$/i.test(kreditorData.iban.replace(/\s/g, ''))) {
|
||||
errors.push('IBAN Format ist ungültig');
|
||||
}
|
||||
|
||||
// Validate kreditorId format (should start with 70xxx)
|
||||
if (kreditorData.kreditorId && !/^70\d{3,}$/.test(kreditorData.kreditorId)) {
|
||||
errors.push('Kreditor-ID muss mit 70 beginnen gefolgt von mindestens 3 Ziffern');
|
||||
// Validate kreditorId format (should start with 70xxx for regular kreditors)
|
||||
if (kreditorData.kreditorId && !isBanking && !/^70\d{3,}$/.test(kreditorData.kreditorId)) {
|
||||
errors.push('Kreditor-ID muss mit 70 beginnen gefolgt von mindestens 3 Ziffern (außer für Banking-Konten)');
|
||||
}
|
||||
|
||||
// For banking accounts, warn about special handling
|
||||
if (isBanking && hasIban) {
|
||||
// This is just informational, not an error
|
||||
console.info('Banking-Konto erkannt: Transaktionen benötigen manuelle Kreditor-Zuordnung');
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
||||
Reference in New Issue
Block a user