Fix #166: Buchungsnummer und Datum teilen sich eine Spalte in der Belegansicht
This commit is contained in:
parent
e81df45382
commit
5df6c2c9dc
2 changed files with 37 additions and 8 deletions
|
|
@ -218,8 +218,7 @@ $suppliers = $suppliers ?? [];
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Buchungsnr.</th>
|
||||
<th>Datum</th>
|
||||
<th>Buchungsnr.<br>Datum</th>
|
||||
<th>Typ</th>
|
||||
<th>Kategorie</th>
|
||||
<th>Zahlungskonto</th>
|
||||
|
|
@ -235,8 +234,10 @@ $suppliers = $suppliers ?? [];
|
|||
$isReversal = (bool)$bk['is_reversal'];
|
||||
?>
|
||||
<tr style="<?= ($isReversed || $isReversal) ? 'opacity:.55;background:#fff5f5' : '' ?>">
|
||||
<td class="td-mono text-sm"><?= $h($bk['buchungs_nr']) ?></td>
|
||||
<td class="td-muted"><?= View::formatDate($bk['buchungs_datum']) ?></td>
|
||||
<td class="td-mono text-sm">
|
||||
<?= $h($bk['buchungs_nr']) ?><br>
|
||||
<span class="td-muted"><?= View::formatDate($bk['buchungs_datum']) ?></span>
|
||||
</td>
|
||||
<td><span class="badge <?= $bk['buchungstyp'] === 'Einnahme' ? 'badge-green' : 'badge-red' ?>"><?= $h($bk['buchungstyp']) ?></span></td>
|
||||
<td class="td-mono text-sm"><?= $h($bk['kategorie_nr']) ?><br><span class="td-muted"><?= $h($bk['kategorie_name']) ?></span></td>
|
||||
<td class="td-mono text-sm"><?= $h($bk['zahlungs_nr']) ?><br><span class="td-muted"><?= $h($bk['zahlungs_name']) ?></span></td>
|
||||
|
|
@ -299,7 +300,7 @@ $suppliers = $suppliers ?? [];
|
|||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php if (empty($bookings)): ?>
|
||||
<tr><td colspan="9" class="text-center text-muted" style="padding:1rem">Noch keine Buchungen.</td></tr>
|
||||
<tr><td colspan="8" class="text-center text-muted" style="padding:1rem">Noch keine Buchungen.</td></tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ test.describe('Beleg-Upload und Buchung', () => {
|
|||
|
||||
const zeile = page.locator('table tbody tr', { hasText: tag }).first()
|
||||
await expect(zeile).toHaveCount(1)
|
||||
expect(parseMoney(await zeile.locator('td').nth(5).textContent())).toBeCloseTo(100.0, 2)
|
||||
expect(parseMoney(await zeile.locator('td').nth(4).textContent())).toBeCloseTo(100.0, 2)
|
||||
})
|
||||
|
||||
test('Buchung im BRUTTO-Modus wird vor dem Absenden in Netto umgerechnet', async ({ page }) => {
|
||||
|
|
@ -98,7 +98,7 @@ test.describe('Beleg-Upload und Buchung', () => {
|
|||
|
||||
// Kern der Regression: Gespeichert werden muss der Nettobetrag 100,00 —
|
||||
// nicht die eingegebenen 119,00.
|
||||
const gespeichert = parseMoney(await zeile.locator('td').nth(5).textContent())
|
||||
const gespeichert = parseMoney(await zeile.locator('td').nth(4).textContent())
|
||||
expect(gespeichert, 'Bruttoeingabe wurde nicht in Netto umgerechnet').toBeCloseTo(100.0, 2)
|
||||
})
|
||||
|
||||
|
|
@ -131,7 +131,35 @@ test.describe('Beleg-Upload und Buchung', () => {
|
|||
|
||||
const zeile = page.locator('table tbody tr', { hasText: tag }).first()
|
||||
await expect(zeile).toHaveCount(1)
|
||||
expect(parseMoney(await zeile.locator('td').nth(5).textContent())).toBeCloseTo(100.0, 2)
|
||||
expect(parseMoney(await zeile.locator('td').nth(4).textContent())).toBeCloseTo(100.0, 2)
|
||||
})
|
||||
|
||||
// Issue #166: Buchungsnummer und Buchungsdatum teilen sich eine Spalte,
|
||||
// damit die Tabelle ohne waagerechtes Scrollen lesbar bleibt. Prüfbar nur
|
||||
// am gerenderten DOM — die Zellaufteilung existiert nur in der View.
|
||||
test('Buchungsnummer und Datum stehen in einer gemeinsamen Spalte', async ({ page }) => {
|
||||
const { id, tag } = await uploadBeleg(page)
|
||||
belegId = id
|
||||
|
||||
await buchungsmaskeVorbereiten(page, { buchungstext: tag })
|
||||
await page.fill('#betrag_netto_input', '100.00')
|
||||
await page.click('#buchung_form button[type="submit"]')
|
||||
await page.waitForLoadState('networkidle')
|
||||
|
||||
const zeile = page.locator('table tbody tr', { hasText: tag }).first()
|
||||
await expect(zeile).toHaveCount(1)
|
||||
|
||||
// Erste Zelle trägt beides: Buchungsnummer (BU-JAHR-NNNNNN) und Datum.
|
||||
const ersteZelle = await zeile.locator('td').nth(0).textContent()
|
||||
expect(ersteZelle).toMatch(/BU-\d{4}-\d+/)
|
||||
expect(ersteZelle).toMatch(/\d{2}\.\d{2}\.\d{4}/)
|
||||
|
||||
// Die Kopfzeile führt beide Bezeichnungen in einer einzigen Spalte.
|
||||
const kopf = page.locator('table thead tr').first()
|
||||
const ersteKopfzelle = await kopf.locator('th').nth(0).textContent()
|
||||
expect(ersteKopfzelle).toContain('Buchungsnr.')
|
||||
expect(ersteKopfzelle).toContain('Datum')
|
||||
await expect(kopf.locator('th')).toHaveCount(8)
|
||||
})
|
||||
|
||||
// Hinweis: Dass ein Beleg mit Buchungen nicht löschbar ist, ist reine
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue