From b3b3a2725790c188509ade3f9f223da8d282cec1 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Fri, 21 Aug 2026 01:36:41 +0200 Subject: [PATCH] asdasd --- custom/apps/mining-checker/assets/js/app.js | 8 ++++---- custom/apps/mining-checker/docs/README.md | 2 +- .../mining-checker/src/Domain/AnalyticsService.php | 12 ++++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/custom/apps/mining-checker/assets/js/app.js b/custom/apps/mining-checker/assets/js/app.js index f6fa2750..24b7b58f 100644 --- a/custom/apps/mining-checker/assets/js/app.js +++ b/custom/apps/mining-checker/assets/js/app.js @@ -3331,17 +3331,17 @@ }), h(StatCard, { key: 'break-even-point', - label: 'Cash-Break-even', + label: 'Gesamt-Break-even', value: breakEvenReached ? 'Erreicht' : breakEvenDaysOverall !== null ? `${fmtNumber(breakEvenDaysOverall, 2)} Tage` - : (investedCapital === null ? 'Keine Mietbasis' : 'Nicht erreichbar'), - sub: investedCapital !== null + : ((investedCapital === null && reinvestedCapital === null) ? 'Keine Mietbasis' : 'Nicht erreichbar'), + sub: (investedCapital !== null || reinvestedCapital !== null) ? `${breakEvenEta ? `ETA ${breakEvenEta} · ` : ''}Cash ${fmtMoney(investedCapital, reportCurrency)}${reinvestedCapital !== null ? ` · Reinvest fix ${fmtMoney(reinvestedCapital, reportCurrency)}` : ''}` : (breakEvenPrice !== null ? `Break-even-Kurs ${fmtNumber(breakEvenPrice, 6)} ${reportCurrency}` - : (investedCapital === null + : (investedCapital === null && reinvestedCapital === null ? 'Noch keine Miner als Mietbasis hinterlegt' : 'Keine belastbare Break-even-Basis')), }), diff --git a/custom/apps/mining-checker/docs/README.md b/custom/apps/mining-checker/docs/README.md index 052fc7ad..24a41a1b 100644 --- a/custom/apps/mining-checker/docs/README.md +++ b/custom/apps/mining-checker/docs/README.md @@ -152,7 +152,7 @@ Jede neu gespeicherte Buchung, die einen Kurs oder eine Waehrungsumrechnung beno ## Break-even -Der Cash-Break-even verwendet ausschliesslich Fiat-Investitionen gegen aktuelle, noch gehaltene Miner- und Walletbestaende. Krypto-Reinvestitionen werden daneben als `Reinvest fix` angezeigt und muessen immer den historischen festen Gegenwert aus dem zugeordneten `fx-rates`-Snapshot verwenden; eine Bewertung zum aktuellen Coin-Kurs ist unzulässig. +Der Gesamt-Break-even verwendet die Summe aus Fiat-Investitionen und `Reinvest fix` gegen aktuelle, noch gehaltene Miner- und Walletbestaende. Krypto-Reinvestitionen muessen immer den historischen festen Gegenwert aus dem zugeordneten `fx-rates`-Snapshot verwenden; eine Bewertung zum aktuellen Coin-Kurs ist unzulässig. ## Verbindliche Fachregeln: Zielminer-ETA diff --git a/custom/apps/mining-checker/src/Domain/AnalyticsService.php b/custom/apps/mining-checker/src/Domain/AnalyticsService.php index 03d7dcc4..199acb1d 100644 --- a/custom/apps/mining-checker/src/Domain/AnalyticsService.php +++ b/custom/apps/mining-checker/src/Domain/AnalyticsService.php @@ -471,11 +471,14 @@ final class AnalyticsService ? (float) ($totalHoldingsValue ?? 0.0) + (float) ($settledCryptoSpendValue ?? 0.0) : null; $currentDailyRevenue = is_numeric($latest['theoretical_daily_revenue'] ?? null) ? (float) $latest['theoretical_daily_revenue'] : null; - $breakEvenRemainingAmount = ($cashInvestedCapital !== null && $totalHoldingsValue !== null) - ? max(0.0, $cashInvestedCapital - $totalHoldingsValue) - : $cashInvestedCapital; + $totalInvestedCapital = ($cashInvestedCapital !== null || $reinvestedCapital !== null) + ? (float) ($cashInvestedCapital ?? 0.0) + (float) ($reinvestedCapital ?? 0.0) + : null; + $breakEvenRemainingAmount = ($totalInvestedCapital !== null && $totalHoldingsValue !== null) + ? max(0.0, $totalInvestedCapital - $totalHoldingsValue) + : $totalInvestedCapital; $breakEvenProjection = ( - $cashInvestedCapital !== null && + $totalInvestedCapital !== null && $breakEvenRemainingAmount !== null ) ? $this->projectBreakEvenDate( is_array($settings['cost_plans'] ?? null) ? $settings['cost_plans'] : [], @@ -505,6 +508,7 @@ final class AnalyticsService 'invested_capital' => $this->roundOrNull($cashInvestedCapital, 8), 'cash_invested_capital' => $this->roundOrNull($cashInvestedCapital, 8), 'reinvested_capital' => $this->roundOrNull($reinvestedCapital, 8), + 'total_invested_capital' => $this->roundOrNull($totalInvestedCapital, 8), 'wallet_balance_current_asset' => $this->roundOrNull($walletBalanceCurrentAssetEquivalent, 6), 'wallet_balance_current_asset_direct' => $this->roundOrNull($walletBalanceCurrentAssetDirect, 6), 'holdings_current_asset' => $this->roundOrNull($holdingsCurrentAsset, 6),