/*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 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
this.recyclerView = null;
}
public void descriptionSelected(String description) {
- debug("descr selected", description);
+ debug("description selected", description);
if (!accountListIsEmpty())
return;
params.add(accFilter);
}
- sb.append(" ORDER BY t.date DESC LIMIT 1");
+ sb.append(" ORDER BY t.year desc, t.month desc, t.day desc LIMIT 1");
final String sql = sb.toString();
- debug("descr", sql);
- debug("descr", params.toString());
+ debug("description", sql);
+ debug("description", params.toString());
Activity activity = (Activity) recyclerView.getContext();
// FIXME: handle exceptions?
if (Misc.isEmptyOrNull(accFilter))
return;
- debug("descr", "Trying transaction search without preferred account filter");
+ debug("description", "Trying transaction search without preferred account filter");
final String broaderSql =
"select t.profile, t.id from transactions t where t.description=?" +
- " ORDER BY date desc LIMIT 1";
+ " ORDER BY year desc, month desc, day desc LIMIT 1";
params.remove(1);
- debug("descr", broaderSql);
- debug("descr", description);
+ debug("description", broaderSql);
+ debug("description", description);
activity.runOnUiThread(() -> {
Snackbar.make(recyclerView, R.string.ignoring_preferred_account,
itemsWithAccountForCurrency.add(currName, item);
}
- if (acc.isAmountSet()) {
+ if (!acc.isAmountValid()) {
+ Logger.debug("submittable",
+ String.format("Not submittable: row %d has an invalid amount", i + 1));
+ submittable = false;
+ }
+ else if (acc.isAmountSet()) {
itemsWithAmountForCurrency.add(currName, item);
balance.add(currName, acc.getAmount());
}