private String uuid;
private String name;
private boolean permitPosting;
+ private String preferredAccountsFilter;
private String url;
private boolean authEnabled;
private String authUserName;
List<MobileLedgerProfile> list = new ArrayList<>();
SQLiteDatabase db = MLDB.getDatabase();
try (Cursor cursor = db.rawQuery("SELECT uuid, name, url, use_authentication, auth_user, " +
- "auth_password, permit_posting, theme, order_no FROM " +
+ "auth_password, permit_posting, theme, order_no, " +
+ "preferred_accounts_filter FROM " +
"profiles order by order_no", null))
{
while (cursor.moveToNext()) {
item.setPostingPermitted(cursor.getInt(6) == 1);
item.setThemeId(cursor.getInt(7));
item.orderNo = cursor.getInt(8);
+ item.setPreferredAccountsFilter(cursor.getString(9));
list.add(item);
if (item.getUuid().equals(currentProfileUUID)) result = item;
}
db.endTransaction();
}
}
+ public String getPreferredAccountsFilter() {
+ return preferredAccountsFilter;
+ }
+ public void setPreferredAccountsFilter(String preferredAccountsFilter) {
+ this.preferredAccountsFilter = preferredAccountsFilter;
+ }
+ public void setPreferredAccountsFilter(CharSequence preferredAccountsFilter) {
+ setPreferredAccountsFilter(String.valueOf(preferredAccountsFilter));
+ }
public boolean isPostingPermitted() {
return permitPosting;
}
// permitPosting ? "TRUE" : "FALSE", authEnabled ? "TRUE" : "FALSE", themeId));
db.execSQL("REPLACE INTO profiles(uuid, name, permit_posting, url, " +
"use_authentication, auth_user, " +
- "auth_password, theme, order_no) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
+ "auth_password, theme, order_no, preferred_accounts_filter) " +
+ "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
new Object[]{uuid, name, permitPosting, url, authEnabled,
authEnabled ? authUserName : null,
- authEnabled ? authPassword : null, themeId, orderNo
+ authEnabled ? authPassword : null, themeId, orderNo,
+ preferredAccountsFilter
});
db.setTransactionSuccessful();
}
create table account_values(profile varchar not null, account varchar not null, currency varchar not null default '', keep boolean, value decimal not null );
create unique index un_account_values on account_values(profile,account,currency);
create table description_history(description varchar not null primary key, keep boolean, description_upper varchar);
-create table profiles(uuid varchar not null primary key, name not null, url not null, use_authentication boolean not null, auth_user varchar, auth_password varchar, order_no integer, permit_posting boolean default 0, theme integer default -1);
+create table profiles(uuid varchar not null primary key, name not null, url not null, use_authentication boolean not null, auth_user varchar, auth_password varchar, order_no integer, permit_posting boolean default 0, theme integer default -1, preferred_accounts_filter varchar);
create table transactions(profile varchar not null, id integer not null, data_hash varchar not null, date varchar not null, description varchar not null, keep boolean not null default 0);
create unique index un_transactions_id on transactions(profile,id);
create unique index un_transactions_data_hash on transactions(profile,data_hash);