Bug 415411 - No support for check forms with split protocol
Summary: No support for check forms with split protocol
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: exporter (show other bugs)
Version: 4.8.4
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 19:15 UTC by Ralf Habacker
Modified: 2019-12-25 23:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.8.5,5.0.8


Attachments
test case (25.50 KB, text/xml)
2019-12-21 14:17 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2019-12-20 19:15:13 UTC
Phil Hopkins wrote: 
When using check forms that contain a log for record keeping it is
needed to print out all of the splits associated with a transaction when
printing a check. This cannot be done since the split variables are not
present in the check printing plugin.

STEPS TO REPRODUCE
1. inspect https://cgit.kde.org/kmymoney.git/tree/kmymoney/plugins/checkprinting/checkprinting.cpp?h=5.0&id=5f5848ba2b3a2148aa402fe87d8c41ba1ebdb329#n172

OBSERVED RESULT
There are not template attributes for the mentioned split attributes

EXPECTED RESULT
The mentioned split attributes should be replaces

ADDITIONAL INFORMATION
It would be nice to have a template showing all available fields.
Comment 1 Ralf Habacker 2019-12-20 19:24:54 UTC
Git commit 9ae5d7c17654dc57b396571ddd630305674ff3a2 by Ralf Habacker.
Committed on 20/12/2019 at 19:22.
Pushed by habacker into branch '4.8'.

printcheck: avoid incorrect replacement of split values

Template parameters for split values are now replaced in descending order.
If we replace the template parameter 'SPLITVALUE1' before 'SPLITVALUE10',
the latter is erroneously overwritten with the value from the former,
followed by '0'.

M  +2    -2    kmymoney/plugins/printcheck/printcheck.cpp

https://commits.kde.org/kmymoney/9ae5d7c17654dc57b396571ddd630305674ff3a2
Comment 2 Ralf Habacker 2019-12-20 19:24:54 UTC
Git commit d12a2e01a35a44e584fae3e3ef1dd545af74d34a by Ralf Habacker, on behalf of Phil Hopkins.
Committed on 20/12/2019 at 19:21.
Pushed by habacker into branch '4.8'.

Adding additional variable to check printing

When using check forms that contain a log for record keeping it is
needed to print out all of the splits associated with a transaction when
printing a check. This cannot be done since the split variables are not
present in the check printing plugin.

This patch will add the variables SplitAccountName and SplitValue for
up to 10 splits within a transaction. The check template will then be
able to access the split variables and print them when printing a check.

Differential Revision: https://phabricator.kde.org/D23369
FIXED-IN:4.8.5,5.0.7

M  +18   -0    kmymoney/plugins/printcheck/printcheck.cpp

https://commits.kde.org/kmymoney/d12a2e01a35a44e584fae3e3ef1dd545af74d34a
Comment 3 Ralf Habacker 2019-12-20 19:30:08 UTC
Git commit 8674a3c6471b6c5427910b6773273dcb1490c0f6 by Ralf Habacker.
Committed on 20/12/2019 at 19:23.
Pushed by habacker into branch '4.8'.

print check plugin: Add supported fields to check_all_fields.html template

M  +12   -0    kmymoney/plugins/printcheck/check_all_fields.html

https://commits.kde.org/kmymoney/8674a3c6471b6c5427910b6773273dcb1490c0f6
Comment 4 Ralf Habacker 2019-12-20 22:12:05 UTC
Git commit 3ed3238d0cbd5f1cf8f51e8adfd4c779448c5585 by Ralf Habacker.
Committed on 20/12/2019 at 22:08.
Pushed by habacker into branch '4.8'.

printcheck plugin: Always replace $MEMO1|2 to avoid being replaced by the value of $MEMO.

M  +2    -4    kmymoney/plugins/printcheck/printcheck.cpp

https://commits.kde.org/kmymoney/3ed3238d0cbd5f1cf8f51e8adfd4c779448c5585
Comment 5 Ralf Habacker 2019-12-21 12:26:52 UTC
Git commit 3227834a97fc62537a3b60d91c91de1f7ce2dfe7 by Ralf Habacker.
Committed on 21/12/2019 at 12:26.
Pushed by habacker into branch '5.0'.

checkprinting: avoid incorrect replacement of split values

Template parameters for split values are now replaced in descending order.
If we replace the template parameter 'SPLITVALUE1' before 'SPLITVALUE10',
the latter is erroneously overwritten with the value from the former,
followed by '0'.

Cherry picked from commit 9ae5d7c17654dc57b396571ddd630305674ff3a2
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D26134

M  +2    -2    kmymoney/plugins/checkprinting/checkprinting.cpp

https://commits.kde.org/kmymoney/3227834a97fc62537a3b60d91c91de1f7ce2dfe7
Comment 6 Ralf Habacker 2019-12-21 14:17:53 UTC
Created attachment 124639 [details]
test case
Comment 7 Thomas Baumgart 2019-12-25 09:22:04 UTC
Git commit 2309eb945c2bffb00b874ac8c57dfc73d7b13838 by Thomas Baumgart.
Committed on 25/12/2019 at 09:21.
Pushed by tbaumgart into branch 'master'.

checkprinting: avoid incorrect replacement of split values

Template parameters for split values are now replaced in descending
order.
If we replace the template parameter 'SPLITVALUE1' before
'SPLITVALUE10',
the latter is erroneously overwritten with the value from the former,
followed by '0'.

Cherry picked from commit 9ae5d7c17654dc57b396571ddd630305674ff3a2
Reviewed By: tbaumgart
Differential Revision: https://phabricator.kde.org/D26134

(cherry picked from commit 3227834a97fc62537a3b60d91c91de1f7ce2dfe7)

M  +2    -2    kmymoney/plugins/checkprinting/checkprinting.cpp

https://commits.kde.org/kmymoney/2309eb945c2bffb00b874ac8c57dfc73d7b13838