Исправление глобального баланса: иногда попадал общий баланс по расчёту Essentials

This commit is contained in:
justuser-31 2025-11-26 09:56:37 +03:00
parent be9a394c7f
commit 8fb7f4f6c5

View File

@ -22,18 +22,20 @@ class TotalBalanceModules {
for (el in output) {
LOGGER.info("Processing line: $el")
LOGGER.info("Total balance before process: $total")
if (startOfList) {
LOGGER.info("Parsing balance entry")
val balance = el.split(" ")[2].replace(Regex("[^0-9.]"), "")
LOGGER.info("Extracted balance: $balance")
total += balance.toFloat()
} else if (el.contains("1.")) {
} else if (el.contains("1. ") && el.contains(", ")) {
startOfList = true
LOGGER.info("Found first entry, starting balance calculation")
val balance = el.split(" ")[2].replace(Regex("[^0-9.]"), "")
LOGGER.info("First balance extracted: $balance")
total += balance.toFloat()
}
LOGGER.info("Total after process: $total")
}
LOGGER.info("Total balance calculated: $total")