fix: Summenzeile für Umsatz + Kunden, Kunden = Dezember-Wert
- Summenzeile auch für Umsatzerlöse und Kunden - Kunden-Sheets: Jahresspalte zeigt Dezember-Wert (Bestand, nicht Summe) - Bereits existierende Summenzeilen werden nicht doppelt gezählt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -284,13 +284,13 @@ export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
|
|||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
{/* Summenzeile für relevante Sheets */}
|
{/* Summenzeile für relevante Sheets */}
|
||||||
{['personalkosten', 'materialaufwand', 'betriebliche', 'investitionen', 'sonst_ertraege'].includes(activeSheet) && rows.length > 0 && (() => {
|
{['personalkosten', 'materialaufwand', 'betriebliche', 'investitionen', 'sonst_ertraege', 'umsatzerloese', 'kunden', 'kunden_summary'].includes(activeSheet) && rows.length > 0 && (() => {
|
||||||
// Berechne Summe über alle Zeilen die keine Summenzeilen sind
|
// Berechne Summe über alle Zeilen die keine Summenzeilen sind
|
||||||
const sumValues: Record<string, number> = {}
|
const sumValues: Record<string, number> = {}
|
||||||
let sumAnnual = 0
|
let sumAnnual = 0
|
||||||
const nonSumRows = rows.filter(r => {
|
const nonSumRows = rows.filter(r => {
|
||||||
const l = getLabel(r)
|
const l = getLabel(r)
|
||||||
return !(r.is_sum_row || l.includes('GESAMT') || l.includes('Summe') || l.includes('Gesamtkosten'))
|
return !(r.is_sum_row || l.includes('GESAMT') || l.includes('Summe') || l.includes('Gesamtkosten') || l === 'SUMME')
|
||||||
})
|
})
|
||||||
for (let idx = 0; idx < 12; idx++) {
|
for (let idx = 0; idx < 12; idx++) {
|
||||||
const mKey = `m${monthStart + idx}`
|
const mKey = `m${monthStart + idx}`
|
||||||
@@ -309,7 +309,10 @@ export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
|
|||||||
{de ? 'SUMME' : 'TOTAL'}
|
{de ? 'SUMME' : 'TOTAL'}
|
||||||
</td>
|
</td>
|
||||||
<td className={`text-right py-1.5 px-2 font-bold text-xs ${sumAnnual < 0 ? 'text-red-400' : 'text-white/80'}`}>
|
<td className={`text-right py-1.5 px-2 font-bold text-xs ${sumAnnual < 0 ? 'text-red-400' : 'text-white/80'}`}>
|
||||||
{formatCell(sumAnnual)}
|
{['kunden', 'kunden_summary'].includes(activeSheet)
|
||||||
|
? formatCell(sumValues[`m${monthEnd}`] || 0)
|
||||||
|
: formatCell(sumAnnual)
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
{Array.from({ length: 12 }, (_, idx) => {
|
{Array.from({ length: 12 }, (_, idx) => {
|
||||||
const mKey = `m${monthStart + idx}`
|
const mKey = `m${monthStart + idx}`
|
||||||
|
|||||||
Reference in New Issue
Block a user