}
description = cTr.getString(1);
- try (Cursor cAcc = db.rawQuery("SELECT account_name, amount, currency FROM " +
+ try (Cursor cAcc = db.rawQuery("SELECT account_name, amount, currency, comment FROM " +
"transaction_accounts WHERE " +
"profile=? AND transaction_id = ?",
new String[]{profile, String.valueOf(id)}))
// String.format("Loaded %d: %s %1.2f %s", id, cAcc.getString(0),
// cAcc.getFloat(1), cAcc.getString(2)));
addAccount(new LedgerTransactionAccount(cAcc.getString(0), cAcc.getFloat(1),
- cAcc.getString(2)));
+ cAcc.getString(2), cAcc.getString(3)));
}
finishLoading();
private boolean amountSet = false;
private String currency;
private String comment;
- public LedgerTransactionAccount(String accountName, float amount) {
- this(accountName, amount, null);
- }
- public LedgerTransactionAccount(String accountName, float amount, String currency) {
+ public LedgerTransactionAccount(String accountName, float amount, String currency,
+ String comment) {
this.setAccountName(accountName);
this.amount = amount;
this.amountSet = true;
this.currency = currency;
+ this.comment = comment;
}
public LedgerTransactionAccount(String accountName) {
this.accountName = accountName;
for (LedgerTransactionAccount item : tr.getAccounts()) {
db.execSQL("INSERT INTO transaction_accounts(profile, transaction_id, " +
- "account_name, amount, currency) values(?, ?, ?, ?, ?)",
+ "account_name, amount, currency, comment) values(?, ?, ?, ?, ?, ?)",
new Object[]{uuid, tr.getId(), item.getAccountName(), item.getAmount(),
- item.getCurrency()
+ item.getCurrency(), item.getComment()
});
}
// debug("profile", String.format("Transaction %d stored", tr.getId()));