Bug 380286 - Exported account templates only includes incomplete tax information
Summary: Exported account templates only includes incomplete tax information
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: file (show other bugs)
Version: 4.8.0
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-28 18:50 UTC by Ralf Habacker
Modified: 2019-08-29 00:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.8.3,5.0.3


Attachments
test case for review request D16726 (28.40 KB, text/xml)
2018-11-16 11:39 UTC, Ralf Habacker
Details
test case for review request D16725 (2.41 KB, text/xml)
2018-11-16 11:48 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2017-05-28 18:50:26 UTC
Adding tax informations to an account results into the following extract from an kmy file: 
 
 <ACCOUNT currency="EUR" description="" parentaccount="A000073" opened="1900-01-01" number="" lastmodified="" type="12" id="A000075" lastreconciled="" institution="" name="8400 Erlöse USt. 19%">
   <KEYVALUEPAIRS>
    <PAIR key="Tax" value="Yes"/>
    <PAIR key="VatAccount" value="A000082"/>
    <PAIR key="lastStatementDate" value=""/>
   </KEYVALUEPAIRS>
  </ACCOUNT>

  <ACCOUNT currency="EUR" description="" parentaccount="A000080" opened="2017-05-25" number="" lastmodified="" type="10" id="A000082" lastreconciled="" institution="" name="1776 Umsatzsteuer 19%">
   <KEYVALUEPAIRS>
    <PAIR key="VatRate" value="19/100"/>
    <PAIR key="lastStatementDate" value=""/>
   </KEYVALUEPAIRS>
  </ACCOUNT>

Exporting this accounts to an account template file contains only an incomplete subset of required tax information:

    <account type="12" name="8400 Erlöse USt. 19%">
     <flag value="Yes" name="Tax"/>
    </account> 
    <account type="10" name="1776 Umsatzsteuer 19%"/>
    <account type="10" name="1780 Umsatzsteuer-Vorauszahlung"/>

where it should be:

    <account type="12" name="8400 Erlöse USt. 19%">
     <flag value="Yes" name="Tax"/>
     <flag value="<related-vat-account>" name="VatAccount"/>
    </account> 

    <account type="10" name="1776 Umsatzsteuer 19%">
     <flag value="19/100" name="VatRate"/>
    </account>
Comment 1 Ralf Habacker 2018-10-02 18:50:57 UTC
Git commit 74a051c48feef256b2c77f9ffaffe61aa05f6e23 by Ralf Habacker.
Committed on 02/10/2018 at 18:50.
Pushed by habacker into branch '4.8'.

Export account attribute 'VatRate' into a template file and read out again when importing

M  +8    -0    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/74a051c48feef256b2c77f9ffaffe61aa05f6e23
Comment 2 Ralf Habacker 2018-10-02 18:50:57 UTC
Git commit 9511d7618e67be2ca3cf1646ab33d3df0c6d86d4 by Ralf Habacker.
Committed on 02/10/2018 at 18:50.
Pushed by habacker into branch '4.8'.

Correction of setting up import of tax attributes from gnucash xea file

KMyMoney expects the flag "Tax" to have an attribute value="Yes".
FIXED-IN:4.8.3

M  +1    -1    tools/xea2kmt.cpp

https://commits.kde.org/kmymoney/9511d7618e67be2ca3cf1646ab33d3df0c6d86d4
Comment 3 Ralf Habacker 2018-10-02 18:50:57 UTC
Git commit 60a1ae8c128845c1b169ea1f9eb12b8d630d4548 by Ralf Habacker.
Committed on 02/10/2018 at 18:50.
Pushed by habacker into branch '4.8'.

Save account attribute 'Include in tax report' when exporting account structure to KMymoney template file

M  +6    -1    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/60a1ae8c128845c1b169ea1f9eb12b8d630d4548
Comment 4 Ralf Habacker 2018-10-02 18:50:57 UTC
Git commit 5f15218ca8f47d280a3c318011e369a53c6d38fd by Ralf Habacker.
Committed on 02/10/2018 at 18:50.
Pushed by habacker into branch '4.8'.

Add support for saving and loading tax account mappings to and from a template file

A tax account mapping is stored in an xml tag of type 'flag' with the attribute
name='VatAccount'. The attribute 'value' contains a reference to the corresponding
tax account, which contains the reference in the attribute 'id'.

When importing a template file with a tax account assignment, the reference is
first stored in a temporary key/value pair with the name 'UnresolvedVatAccount'
of the account concerned and after completion of the load is stored in the
key/value pair 'VatAccount' based on the ID of the tax account now available.

M  +47   -0    kmymoney/converter/mymoneytemplate.cpp
M  +1    -0    kmymoney/converter/mymoneytemplate.h

https://commits.kde.org/kmymoney/5f15218ca8f47d280a3c318011e369a53c6d38fd
Comment 5 Ralf Habacker 2018-11-06 18:07:26 UTC
Git commit df1571dd951edc2914ae8e76cb6b1a2ef26042f7 by Ralf Habacker.
Committed on 06/11/2018 at 17:02.
Pushed by habacker into branch 'work/380286-tax-related'.

Correction of setting up import of tax attributes from gnucash xea file

KMyMoney expects the flag "Tax" to have an attribute value="Yes".
FIXED-IN:4.8.3, 5.0.3

M  +1    -1    tools/xea2kmt.cpp

https://commits.kde.org/kmymoney/df1571dd951edc2914ae8e76cb6b1a2ef26042f7
Comment 6 Ralf Habacker 2018-11-06 18:07:26 UTC
Git commit b4a84e49eb97b5a62d4e1d51611355a2c7407405 by Ralf Habacker.
Committed on 06/11/2018 at 17:02.
Pushed by habacker into branch 'work/380286-tax-related'.

Add support for saving and loading tax account mappings to and from a template file

A tax account mapping is stored in an xml tag of type 'flag' with the attribute
name='VatAccount'. The attribute 'value' contains a reference to the corresponding
tax account, which contains the reference in the attribute 'id'.

When importing a template file with a tax account assignment, the reference is
first stored in a temporary key/value pair with the name 'UnresolvedVatAccount'
of the account concerned and after completion of the load is stored in the
key/value pair 'VatAccount' based on the ID of the tax account now available.

M  +47   -0    kmymoney/converter/mymoneytemplate.cpp
M  +1    -0    kmymoney/converter/mymoneytemplate.h

https://commits.kde.org/kmymoney/b4a84e49eb97b5a62d4e1d51611355a2c7407405
Comment 7 Ralf Habacker 2018-11-06 18:07:26 UTC
Git commit 721572fb611d6c658e829c265ef36cbab7556c7b by Ralf Habacker.
Committed on 06/11/2018 at 17:02.
Pushed by habacker into branch 'work/380286-tax-related'.

Save account attribute 'Include in tax report' when exporting account structure to KMymoney template file

M  +6    -1    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/721572fb611d6c658e829c265ef36cbab7556c7b
Comment 8 Ralf Habacker 2018-11-06 18:07:26 UTC
Git commit e54a2c6a54337f1c92df5c6d1dd37750d4de88a5 by Ralf Habacker.
Committed on 06/11/2018 at 17:02.
Pushed by habacker into branch 'work/380286-tax-related'.

Export account attribute 'VatRate' into a template file and read out again when importing

M  +8    -0    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/e54a2c6a54337f1c92df5c6d1dd37750d4de88a5
Comment 9 Ralf Habacker 2018-11-16 11:07:38 UTC
Git commit c90fdadbe524939b480722f7d5497744dbe243fa by Ralf Habacker.
Committed on 08/11/2018 at 22:19.
Pushed by habacker into branch '5.0'.

Correction of setting up import of tax attributes from gnucash xea file

Summary:
KMyMoney expects the flag "Tax" to have an attribute value="Yes".
FIXED-IN:4.8.3, 5.0.3

Test Plan: compiled and tested on linux

Reviewers: tbaumgart, wojnilowicz

Differential Revision: https://phabricator.kde.org/D16728

M  +1    -1    tools/xea2kmt.cpp

https://commits.kde.org/kmymoney/c90fdadbe524939b480722f7d5497744dbe243fa
Comment 10 Ralf Habacker 2018-11-16 11:07:38 UTC
Git commit e9bad591ba6ef2712927365ef23e090f73faea76 by Ralf Habacker.
Committed on 08/11/2018 at 22:19.
Pushed by habacker into branch '5.0'.

Save account attribute 'Include in tax report' when exporting account structure to KMymoney template file

Summary: CCBUG:380286

Test Plan: compiled and tested on linux

Reviewers: tbaumgart, wojnilowicz

Differential Revision: https://phabricator.kde.org/D16727

M  +6    -1    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/e9bad591ba6ef2712927365ef23e090f73faea76
Comment 11 Ralf Habacker 2018-11-16 11:39:30 UTC
Created attachment 116342 [details]
test case for review request D16726

How to test:
1. Apply the patch from D16725 and D16727
2. Open this test file with kmymoney
3. Inspect the tax page on account 'revenue' and verify that it uses 'sales tax' account
3. export to KMymoney template
4. create new kmymoney file and use the exported template
5. Inspect the tax page on account 'revenue' and verify that it uses 'sales tax' account
Comment 12 Ralf Habacker 2018-11-16 11:47:06 UTC
(In reply to Ralf Habacker from comment #11)
> 1. Apply the patch from D16725 and D16727
sorry, this should be D16725 and D16726
Comment 13 Ralf Habacker 2018-11-16 11:48:06 UTC
Created attachment 116343 [details]
test case for review request D16725

How to test:
1. Apply the patch from D16725
2. Open this test file with kmymoney
3. export to KMymoney template
4. create new kmymoney file and use the exported template
5. Inspect the tax page on account 'sale tax' and verify that it has a tax set to 10 %
Comment 14 Ralf Habacker 2018-11-25 12:30:52 UTC
Git commit 7e6cfca312659bb07c069fc27665a7b614dd351f by Ralf Habacker.
Committed on 25/11/2018 at 12:30.
Pushed by habacker into branch '5.0'.

Correction of setting up import of tax attributes from gnucash xea file

KMyMoney expects the flag "Tax" to have an attribute value="Yes".
FIXED-IN:4.8.3, 5.0.3
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D16728

M  +1    -1    tools/xea2kmt.cpp

https://commits.kde.org/kmymoney/7e6cfca312659bb07c069fc27665a7b614dd351f
Comment 15 Ralf Habacker 2018-11-26 08:59:02 UTC
Git commit 4735e228ae9ac31fc51d353007aad65d2c6e4e38 by Ralf Habacker.
Committed on 26/11/2018 at 08:55.
Pushed by habacker into branch '5.0'.

Add support for saving and loading tax account mappings to and from a template file

A tax account mapping is stored in an xml tag of type 'flag' with
the attribute name='VatAccount'. The attribute 'value' contains a
reference to the corresponding tax account, which contains the
reference in the attribute 'id'.

When importing a template file with a tax account assignment, the
reference is first stored in a temporary key/value pair with the
name 'UnresolvedVatAccount' of the account concerned and after
completion of the load is stored in the key/value pair 'VatAccount'
based on the ID of the tax account now available.
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D16726

M  +49   -1    kmymoney/converter/mymoneytemplate.cpp
M  +1    -0    kmymoney/converter/mymoneytemplate.h

https://commits.kde.org/kmymoney/4735e228ae9ac31fc51d353007aad65d2c6e4e38
Comment 16 Ralf Habacker 2018-11-26 08:59:03 UTC
Git commit 757f42ff80a787550392192226287ec79c515459 by Ralf Habacker.
Committed on 26/11/2018 at 08:47.
Pushed by habacker into branch '5.0'.

Export account attribute 'VatRate' into a template file and read out again when importing
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D16725

M  +9    -1    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/757f42ff80a787550392192226287ec79c515459
Comment 17 Ralf Habacker 2018-11-26 08:59:03 UTC
Git commit a7683b5440c7956084e96e62ae4e07bf5dfc3296 by Ralf Habacker.
Committed on 26/11/2018 at 08:56.
Pushed by habacker into branch '5.0'.

Save account attribute 'Include in tax report' when exporting account structure to KMymoney template file
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D16727

M  +6    -1    kmymoney/converter/mymoneytemplate.cpp

https://commits.kde.org/kmymoney/a7683b5440c7956084e96e62ae4e07bf5dfc3296