Bug 412429 - No display of transactions in the tags view when tags are specified in a split
Summary: No display of transactions in the tags view when tags are specified in a split
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.0.6
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 415633 (view as bug list)
Depends on:
Blocks: 404527 406403
  Show dependency treegraph
 
Reported: 2019-09-28 21:13 UTC by sergesartor
Modified: 2019-12-28 10:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.5,5.0.8
Sentry Crash Report:


Attachments
Test case (29.29 KB, text/xml)
2019-10-05 10:42 UTC, Ralf Habacker
Details
Test case modified (5.56 KB, application/x-kmymoney)
2019-10-05 14:33 UTC, sergesartor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sergesartor 2019-09-28 21:13:36 UTC
SUMMARY


STEPS TO REPRODUCE
1. ventiler une dépense par exemple
2. sur une ligne ventilée choisir une étiquette (exemple : "frais"), valider et saisir
3. quand je sélectionne l'onglet étiquettes et que je choisis l'étiquette "frais", la dépense n'apparait pas

OBSERVED RESULT
Il manque des dépenses avec l'étiquette "frais" lorsque cette étiquette est à l'intérieur d'une ventilation

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/Manjaro: 
KDE Frameworks 5.61.0
Qt 5.13.0 (construit sur 5.13.0)
Le système de fenêtres xcb

ADDITIONAL INFORMATION
Comment 1 Jack 2019-09-29 23:11:44 UTC
I am only guessing, but I think you are missing a step somewhere.  I'm also not sure if you are having problems with categories or tags, but I don't have any problem with either.

I tried:
1) create a new transaction and select a payee
2) click the split button
3) create and save a split with a new category and a new tag.
4) create and save a second split with a different new category and different new tag.
5) save the splits (Note you must explicitly save each new split and then save all the splits.)
6) save the new transaction

I see both new categories in the category view and I see both new tags in the tag view.

When you go back and look at the transaction and all the splits, is every detail as you set it?  If not, you forgot to save at some step.
Comment 2 sergesartor 2019-09-30 07:01:33 UTC
Thanks Jack to help me.
Sorry for my bad English.
I confirm my problem.
When I create a tag inside a multiple transaction, I don't see the concerned line in the tag view.
I save all the split and the transaction. If I return to see the transaction, I see the tag.
But I don't see the transaction in the view tag.
Comment 3 Thomas Baumgart 2019-09-30 19:21:55 UTC
Does it appear in the tags view when you save the file, quit KMyMoney and restart it? If it appears with the transaction it is on file and part of the tags.
Comment 4 sergesartor 2019-09-30 21:17:15 UTC
Thank's Thomas for help

When I save the file,the tag is ok in the split but doesn't appear in tag view.
May be, it is a problem with my configuration ?
Comment 5 sergesartor 2019-10-04 07:00:13 UTC
Hello 
When I saw the tag inside the transactions in the last release, I was very happy.
But in my case, this is doesn't work because I don't see the transaction in the view tag.
Unfortunately, I am the only one with this problem. I don't understand why.
I would be very happy if someone has an explanation for this problem.
Thank's a lot.
Comment 6 Thomas Baumgart 2019-10-04 15:14:29 UTC
I reread all entries here. The creation of the tag is not the problem, it is also listed in the tags view. But when you select the newly created tag in the tags view the transaction is not shown in the transactions tab.
Comment 7 sergesartor 2019-10-04 15:36:11 UTC
Yes exactly.
In the tag view, I see all the transactions with the tag except when the tag is on a split.
I hope I've made myself clear.
Comment 8 Ralf Habacker 2019-10-05 10:42:14 UTC
Created attachment 123031 [details]
Test case

1. Transaction 'test-split-2' is not shown in the tag view after selecting 'tag2'
2. Transaction 'test-transaction-tag-3-split-tag-1' is not shown in the tag view after selecting 'tag1'
Comment 9 Ralf Habacker 2019-10-05 10:58:15 UTC
Tags are always defined in splits. Adding a tag to a transaction adds the tag to the first split (see first transaction in test file)

 <TRANSACTIONS count="3">
  <TRANSACTION postdate="2019-02-08" commodity="EUR" memo="" id="T000000000000000001" entrydate="2019-02-08">
   <SPLITS>
    <SPLIT payee="" reconcileflag="0" shares="1/1" reconciledate="" action="" bankid="" account="A000001" number="1" value="1/1" memo="test-transaction-tag-1" id="S0001">
     <TAG id="G000001"/>
    </SPLIT>
    <SPLIT payee="" reconcileflag="0" shares="-1/1" reconciledate="" action="" bankid="" account="A000002" number="" value="-1/1" memo="test-transaction-tag-1" id="S0002"/>
   </SPLITS>
  </TRANSACTION>

Tags added with the tag editor are added to splits starting with the second split (see second transaction)

  <TRANSACTION postdate="2019-02-08" commodity="EUR" memo="" id="T000000000000000002" entrydate="2019-02-08">
   <SPLITS>
    <SPLIT payee="" reconcileflag="0" shares="10/1" reconciledate="" action="" bankid="" account="A000001" number="2" value="10/1" memo="test-split-tag-2" id="S0001"/>
    <SPLIT payee="" reconcileflag="0" shares="-10/1" reconciledate="" action="" bankid="" account="A000002" number="" value="-10/1" memo="test-split-tag-2" id="S0002">
     <TAG id="G000002"/>
    </SPLIT>
   </SPLITS>
  </TRANSACTION>

Fetching tags from second and further splits is not implemented in  MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) yet.
Comment 10 sergesartor 2019-10-05 14:33:09 UTC
Created attachment 123035 [details]
Test case modified
Comment 11 sergesartor 2019-10-05 14:41:01 UTC
Thank's Ralf for help.

I have modified the file test case.
In my case, I don't see the splited transactions with tag in tag view.
Is't the same for you.
Comment 12 Ralf Habacker 2019-10-06 09:28:35 UTC
review request for a bug fix is https://phabricator.kde.org/D24426
Comment 13 Ralf Habacker 2019-10-11 05:18:55 UTC
Git commit 65461d923923c4f0b163bc790a63463dbcc8b5b7 by Ralf Habacker.
Committed on 11/10/2019 at 05:21.
Pushed by habacker into branch '5.0'.

Fix 'No display of transactions in the tags view when tags are specified in a split'

Since it is currently not clear whether this change will lead
to unwanted side effects at other code locations, the new method
setConsiderCategorySplits() has been added to enable this
functionality.
FIXED-IN:5.0.8
Test Plan: tested on linux with mymoneytransactionsfiltertest
Reviewed By: tbaumgart, #kmymoney
Differential Revision: https://phabricator.kde.org/D24426

M  +10   -1    kmymoney/mymoney/mymoneytransactionfilter.cpp
M  +10   -0    kmymoney/mymoney/mymoneytransactionfilter.h
M  +5    -2    kmymoney/mymoney/tests/mymoneytransactionfilter-test.cpp
M  +1    -0    kmymoney/views/ktagsview.cpp

https://commits.kde.org/kmymoney/65461d923923c4f0b163bc790a63463dbcc8b5b7
Comment 14 Ralf Habacker 2019-10-11 10:39:16 UTC
Git commit c47a6355e6583710cdd460ad7bb1b93b3d546961 by Ralf Habacker.
Committed on 11/10/2019 at 10:38.
Pushed by habacker into branch '4.8'.

Fix 'No display of transactions in the tags view when tags are specified in a split'
FIXED-IN:4.8.5,5.0.8

(cherry-picked from commit 1285c644bdaa79f95ef22d55c808aa877c6aa861)

M  +9    -1    kmymoney/mymoney/mymoneytransactionfilter.cpp
M  +10   -0    kmymoney/mymoney/mymoneytransactionfilter.h
M  +5    -2    kmymoney/mymoney/mymoneytransactionfiltertest.cpp
M  +1    -0    kmymoney/views/ktagsview.cpp

https://commits.kde.org/kmymoney/c47a6355e6583710cdd460ad7bb1b93b3d546961
Comment 15 Ralf Habacker 2019-10-25 07:02:03 UTC
*** Bug 412870 has been marked as a duplicate of this bug. ***
Comment 16 Thomas Baumgart 2019-12-28 08:53:29 UTC
*** Bug 415633 has been marked as a duplicate of this bug. ***
Comment 17 Ralf Habacker 2019-12-28 10:37:14 UTC
(In reply to Ralf Habacker from comment #15)
> *** Bug 412870 has been marked as a duplicate of this bug. ***
This has been reverted because tag view display has been fixed with bug 412429; this bug is for the remaining ledger view.