- public void insertInto(SQLiteDatabase db) {
- db.execSQL("INSERT INTO transactions(id, date, " + "description) values(?, ?, ?)",
- new String[]{id, date, description});
+ try (Cursor cAcc = db.rawQuery("SELECT account_name, amount, currency FROM " +
+ "transaction_accounts WHERE " +
+ "profile=? AND transaction_id = ?",
+ new String[]{profile, String.valueOf(id)}))
+ {
+ while (cAcc.moveToNext()) {
+// debug("transactions",
+// 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)));
+ }