diff --git a/client/src/App.js b/client/src/App.js
index c1e18b2..6768d18 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
-import { Container, AppBar, Toolbar, Typography, Button, Box, Tabs, Tab, Badge, Chip, Divider, Snackbar, Alert } from '@mui/material';
+import { Container, AppBar, Toolbar, Typography, Button, Box, Tabs, Tab, Badge, Chip, Divider, Snackbar, Alert, LinearProgress, Tooltip, CircularProgress } from '@mui/material';
import LoginIcon from '@mui/icons-material/Login';
import DashboardIcon from '@mui/icons-material/Dashboard';
import DownloadIcon from '@mui/icons-material/Download';
@@ -302,72 +302,87 @@ class App extends Component {
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
)}
+ {(processingStatus.markdown || processingStatus.extraction || processingStatus.datevSync) && (
+
+ )}
diff --git a/client/src/components/AccountingItemsManager.js b/client/src/components/AccountingItemsManager.js
index 13285f3..332eaab 100644
--- a/client/src/components/AccountingItemsManager.js
+++ b/client/src/components/AccountingItemsManager.js
@@ -44,6 +44,7 @@ class AccountingItemsManager extends Component {
editingItem: null,
showCreateDialog: false,
showCreateKontoDialog: false,
+ jtlKontierung: null,
newItem: {
umsatz_brutto: '',
soll_haben_kz: 'S',
@@ -65,6 +66,7 @@ class AccountingItemsManager extends Component {
componentDidMount() {
this.loadData();
+ this.loadJtlKontierung();
}
loadData = async () => {
@@ -88,6 +90,31 @@ class AccountingItemsManager extends Component {
}
};
+ loadJtlKontierung = async () => {
+ try {
+ const { transaction } = this.props;
+ if (!transaction || !transaction.jtlId) {
+ this.setState({ jtlKontierung: undefined });
+ return;
+ }
+
+ const response = await this.authService.apiCall(`/data/jtl-kontierung/${transaction.jtlId}`);
+ if (!response) return;
+
+ if (response.ok) {
+ const data = await response.json();
+ this.setState({ jtlKontierung: data });
+ } else {
+ const err = await response.json();
+ console.error('Failed to load JTL Kontierung:', err);
+ this.setState({ jtlKontierung: undefined });
+ }
+ } catch (e) {
+ console.error('Error loading JTL Kontierung:', e);
+ this.setState({ jtlKontierung: undefined });
+ }
+ }
+
loadAccountingItems = async () => {
const { transaction } = this.props;
if (!transaction?.id) return;
@@ -319,6 +346,21 @@ class AccountingItemsManager extends Component {
/>
+ {transaction?.jtlId && (
+
+ Debug: tUmsatzKontierung.data
+
+ {this.state.jtlKontierung === undefined
+ ? 'undefined'
+ : this.state.jtlKontierung === null
+ ? 'null'
+ : typeof this.state.jtlKontierung === 'object'
+ ? JSON.stringify(this.state.jtlKontierung, null, 2)
+ : String(this.state.jtlKontierung)}
+
+
+ )}
+
diff --git a/src/routes/data/accountingItems.js b/src/routes/data/accountingItems.js
index 873ee50..d91bccc 100644
--- a/src/routes/data/accountingItems.js
+++ b/src/routes/data/accountingItems.js
@@ -3,6 +3,39 @@ const { authenticateToken } = require('../../middleware/auth');
const router = express.Router();
+// Debug: Get JTL Kontierung data for a specific JTL Umsatz (by kZahlungsabgleichUmsatz)
+router.get('/jtl-kontierung/:jtlId', authenticateToken, async (req, res) => {
+ try {
+ const { executeQuery } = require('../../config/database');
+ const { jtlId } = req.params;
+
+ const query = `
+ SELECT
+ uk.data
+ FROM eazybusiness.dbo.tZahlungsabgleichUmsatz z
+ LEFT JOIN eazybusiness.dbo.tUmsatzKontierung uk
+ ON uk.kZahlungsabgleichUmsatz = z.kZahlungsabgleichUmsatz
+ WHERE z.kZahlungsabgleichUmsatz = @jtlId
+ `;
+
+ const result = await executeQuery(query, { jtlId: parseInt(jtlId, 10) });
+ // Return undefined when no data found (do not lie with empty array/string)
+ if (!result.recordset || result.recordset.length === 0) {
+ return res.json({ data: undefined });
+ }
+
+ // If multiple rows exist, return all; otherwise single object
+ const rows = result.recordset.map(r => ({ data: r.data }));
+ if (rows.length === 1) {
+ return res.json(rows[0]);
+ }
+ return res.json(rows);
+ } catch (error) {
+ console.error('Error fetching JTL Kontierung data:', error);
+ res.status(500).json({ error: 'Failed to fetch JTL Kontierung data' });
+ }
+});
+
// Get accounting items for a specific transaction
router.get('/accounting-items/:transactionId', authenticateToken, async (req, res) => {
try {