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:
sebseb7
2025-08-01 13:26:26 +02:00
parent 6cde543938
commit fbfd918d81
13 changed files with 1774 additions and 1409 deletions

View File

@@ -18,6 +18,8 @@ import {
Typography,
Alert,
CircularProgress,
Checkbox,
FormControlLabel,
} from '@mui/material';
import {
Add as AddIcon,
@@ -41,6 +43,7 @@ class KreditorTable extends Component {
iban: '',
name: '',
kreditorId: '',
is_banking: false,
},
};
this.authService = new AuthService();
@@ -78,13 +81,15 @@ class KreditorTable extends Component {
dialogOpen: true,
editingKreditor: kreditor,
formData: kreditor ? {
iban: kreditor.iban,
iban: kreditor.iban || '',
name: kreditor.name,
kreditorId: kreditor.kreditorId,
is_banking: Boolean(kreditor.is_banking),
} : {
iban: '',
name: '',
kreditorId: '',
is_banking: false,
},
});
};
@@ -97,6 +102,7 @@ class KreditorTable extends Component {
iban: '',
name: '',
kreditorId: '',
is_banking: false,
},
});
@@ -117,11 +123,24 @@ class KreditorTable extends Component {
});
};
handleCheckboxChange = (field) => (event) => {
this.setState({
formData: {
...this.state.formData,
[field]: event.target.checked,
},
});
};
isFormValid = () => {
const { formData } = this.state;
return formData.iban.trim() !== '' &&
formData.name.trim() !== '' &&
formData.kreditorId.trim() !== '';
// Name and kreditorId are always required
const basicFieldsValid = formData.name.trim() !== '' && formData.kreditorId.trim() !== '';
// IBAN is optional for banking accounts, required for regular kreditors
const ibanValid = formData.is_banking || formData.iban.trim() !== '';
return basicFieldsValid && ibanValid;
};
handleSave = async () => {
@@ -244,6 +263,7 @@ class KreditorTable extends Component {
<TableCell>Kreditor ID</TableCell>
<TableCell>Name</TableCell>
<TableCell>IBAN</TableCell>
<TableCell>Typ</TableCell>
<TableCell align="right">Aktionen</TableCell>
</TableRow>
</TableHead>
@@ -252,7 +272,18 @@ class KreditorTable extends Component {
<TableRow key={kreditor.id}>
<TableCell>{kreditor.kreditorId}</TableCell>
<TableCell>{kreditor.name}</TableCell>
<TableCell>{kreditor.iban}</TableCell>
<TableCell style={{
color: kreditor.is_banking ? '#ff5722' : 'inherit',
fontWeight: kreditor.is_banking ? 'bold' : 'normal'
}}>
{kreditor.iban || 'Keine IBAN'}
</TableCell>
<TableCell>
{kreditor.is_banking ?
<span style={{ color: '#ff5722', fontWeight: 'bold' }}>Banking</span> :
'Kreditor'
}
</TableCell>
<TableCell align="right">
<IconButton
size="small"
@@ -316,6 +347,18 @@ class KreditorTable extends Component {
variant="outlined"
value={formData.iban}
onChange={this.handleInputChange('iban')}
helperText={formData.is_banking ? "IBAN ist optional für Banking-Konten" : ""}
sx={{ mb: 2 }}
/>
<FormControlLabel
control={
<Checkbox
checked={formData.is_banking}
onChange={this.handleCheckboxChange('is_banking')}
color="primary"
/>
}
label="Banking-Konto (z.B. PayPal) - benötigt manuelle Kreditor-Zuordnung"
/>
</DialogContent>
<DialogActions>