Updated to new data model

This commit is contained in:
dankito 2024-09-12 11:09:03 +02:00
parent c80b4389aa
commit 1d58a3b9e2
2 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package net.codinux.banking.ui.service
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import kotlinx.datetime.* import kotlinx.datetime.*
import net.codinux.banking.client.model.Amount import net.codinux.banking.client.model.Amount
import net.codinux.banking.client.model.isNegative
import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.Colors
import net.codinux.banking.ui.model.TransactionsGrouping import net.codinux.banking.ui.model.TransactionsGrouping
@ -66,7 +67,7 @@ class FormatUtil {
fun getColorForAmount(amount: Amount, showColoredAmounts: Boolean = true): Color = when { fun getColorForAmount(amount: Amount, showColoredAmounts: Boolean = true): Color = when {
showColoredAmounts == false -> Color.Unspecified showColoredAmounts == false -> Color.Unspecified
amount.toString().startsWith("-") -> Colors.Red600 amount.isNegative -> Colors.Red600
else -> Colors.Green600 else -> Colors.Green600
} }

View File

@ -99,7 +99,7 @@ CREATE TABLE IF NOT EXISTS BankAccount (
balance TEXT NOT NULL, balance TEXT NOT NULL,
serverTransactionsRetentionDays INTEGER, serverTransactionsRetentionDays INTEGER,
lastTransactionsRetrievalTime TEXT, lastAccountUpdateTime TEXT,
retrievedTransactionsFrom TEXT, retrievedTransactionsFrom TEXT,
userSetDisplayName TEXT, userSetDisplayName TEXT,
@ -121,7 +121,7 @@ INSERT INTO BankAccount(
isAccountTypeSupportedByApplication, features, isAccountTypeSupportedByApplication, features,
serverTransactionsRetentionDays, lastTransactionsRetrievalTime, retrievedTransactionsFrom, serverTransactionsRetentionDays, lastAccountUpdateTime, retrievedTransactionsFrom,
userSetDisplayName, displayIndex, userSetDisplayName, displayIndex,