/*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
package net.ktnx.mobileledger.model;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import net.ktnx.mobileledger.db.TransactionAccount;
import net.ktnx.mobileledger.utils.Misc;
private String shortAccountName;
private float amount;
private boolean amountSet = false;
+ @Nullable
private String currency;
private String comment;
private boolean amountValid = true;
return amountSet;
}
public boolean isAmountValid() { return amountValid; }
+ @Nullable
public String getCurrency() {
return currency;
}
if (amountSet)
dbo.setAmount(amount);
dbo.setComment(comment);
- dbo.setCurrency(currency);
+ dbo.setCurrency(Misc.nullIsEmpty(currency));
dbo.setId(dbId);
return dbo;