implemented dropping transaction by clearing amount, source or destination field
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -295,7 +295,7 @@ public class SqliteDb extends BaseDb implements AccountDb {
|
||||
}
|
||||
} else if (transaction.isDirty()) {
|
||||
try {
|
||||
if (transaction.amount() == 0) {
|
||||
if (transaction.amount() == 0 || transaction.source().isEmpty() || transaction.destination().isEmpty()) {
|
||||
delete().from(TABLE_TRANSACTIONS).where(Field.ID, equal(transaction.id())).where(ACCOUNT, equal(transaction.accountId())).execute(db);
|
||||
} else {
|
||||
replaceInto(TABLE_TRANSACTIONS, Field.ID, Field.ACCOUNT, Field.TIMESTAMP, Field.SOURCE, Field.DESTINATION, Field.AMOUNT, Field.DESCRIPTION)
|
||||
|
||||
Reference in New Issue
Block a user