From a063310fe70a3c451636e25d334cbdcacec677eb Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 31 Jan 2021 15:24:48 +0200 Subject: [PATCH] complete fromRoomObject() to include date matching fields --- .../model/PatternDetailsItem.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java b/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java index a5ec165c..52fa1dc7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java @@ -65,16 +65,28 @@ abstract public class PatternDetailsItem { if (ph.getTransactionDescriptionMatchGroup() == null) header.setTransactionDescription(ph.getTransactionDescription()); else - header.setTransactionDescriptionMatchGroup(ph.getTransactionDescriptionMatchGroup()); + header.setTransactionDescriptionMatchGroup( + ph.getTransactionDescriptionMatchGroup()); if (ph.getTransactionCommentMatchGroup() == null) header.setTransactionComment(ph.getTransactionComment()); else header.setTransactionCommentMatchGroup(ph.getTransactionCommentMatchGroup()); - header.setDateDayMatchGroup(ph.getDateDayMatchGroup()); - header.setDateMonthMatchGroup(ph.getDateMonthMatchGroup()); - header.setDateYearMatchGroup(ph.getDateYearMatchGroup()); + if (ph.getDateDayMatchGroup() == null) + header.setDateDay(ph.getDateDay()); + else + header.setDateDayMatchGroup(ph.getDateDayMatchGroup()); + + if (ph.getDateMonthMatchGroup() == null) + header.setDateMonth(ph.getDateMonth()); + else + header.setDateMonthMatchGroup(ph.getDateMonthMatchGroup()); + + if (ph.getDateYearMatchGroup() == null) + header.setDateYear(ph.getDateYear()); + else + header.setDateYearMatchGroup(ph.getDateYearMatchGroup()); return header; } -- 2.39.5