if (Misc.emptyIsNull(transactionComment) != null)
head.setComment(transactionComment);
+ Item.resetIdDispenser();
List<Item> newItems = new ArrayList<>();
newItems.add(head);
newItems.add(accRow);
}
- new Handler(Looper.getMainLooper()).post(() -> setItems(newItems));
+ new Handler(Looper.getMainLooper()).post(() -> replaceItems(newItems));
});
}
private int extractIntFromMatches(MatchResult m, Integer group, Integer literal) {
return tr;
}
- void loadTransactionIntoModel(String profileUUID, int transactionId) {
+ void loadTransactionIntoModel(long profileId, int transactionId) {
List<Item> newList = new ArrayList<>();
Item.resetIdDispenser();
LedgerTransaction tr;
- MobileLedgerProfile profile = Data.getProfile(profileUUID);
+ MobileLedgerProfile profile = Data.getProfile(profileId);
if (profile == null)
throw new RuntimeException(String.format(
"Unable to find profile %s, which is supposed to contain transaction %d",
- profileUUID, transactionId));
+ profileId, transactionId));
tr = profile.loadTransaction(transactionId);
TransactionHead head = new TransactionHead(tr.getDescription());
return ItemType.generalData;
}
public LedgerTransaction asLedgerTransaction() {
- return new LedgerTransaction(null, date, description, Data.getProfile());
+ return new LedgerTransaction(0, date, description, Data.getProfile());
}
public boolean equalContents(TransactionHead other) {
if (other == null)