]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java
add transaction comment to the internal transaction representation
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / model / LedgerTransaction.java
index 24527892d580306b51af1eeeb19f8161935f54ac..afb9c57f01bdc3298f942b99a73180029e1fa5e2 100644 (file)
@@ -51,6 +51,7 @@ public class LedgerTransaction {
     private Integer id;
     private Date date;
     private String description;
+    private String comment;
     private ArrayList<LedgerTransactionAccount> accounts;
     private String dataHash;
     private boolean dataLoaded;
@@ -107,6 +108,12 @@ public class LedgerTransaction {
         this.description = description;
         dataHash = null;
     }
+    public String getComment() {
+        return comment;
+    }
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
     public int getId() {
         return id;
     }
@@ -129,6 +136,8 @@ public class LedgerTransaction {
                 data.append(item.getCurrency());
                 data.append('\0');
                 data.append(item.getAmount());
+                data.append('\0');
+                data.append(item.getComment());
             }
             sha.update(data.toString()
                            .getBytes(Charset.forName("UTF-8")));
@@ -166,7 +175,7 @@ public class LedgerTransaction {
                 catch (ParseException e) {
                     e.printStackTrace();
                     throw new RuntimeException(
-                            String.format("Error parsing date '%s' from " + "transacion %d",
+                            String.format("Error parsing date '%s' from " + "transaction %d",
                                     dateString, id));
                 }
                 description = cTr.getString(1);