Review Request 130143: Add support for dedicated opening balance account.

Thomas Baumgart tbaumgart at kde.org
Sun Jun 4 17:18:36 UTC 2017


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130143/#review103278
-----------------------------------------------------------




kmymoney/converter/mymoneytemplate.cpp (line 416)
<https://git.reviewboard.kde.org/r/130143/#comment68701>

    I agree with Christian here. The flag is either present in the template or not. That should be sufficient. Plus, I don't see a usage of the attribute 'value' in this patch at all. So, from MPOV, the 'value' attribute can be removed.



kmymoney/dialogs/knewaccountdlg.cpp (line 222)
<https://git.reviewboard.kde.org/r/130143/#comment68702>

    You could write 
    
        m_qcheckboxOpeningBalance->setEnabled(false);
        m_qcheckboxOpeningBalance->setToolTip(i18n("Reason"));
    
    here infront of the if() statement and only enable it inside in case no other opening balance account was found. In case the reason differs (transactions found), update the tooltip reason. Also update the tooltip contents in case one can mark the account as opening balance account with text which explains what this is good for (which I expected to find in the ui file but did not).
    
    This code layout saves you the multiple else paths at the end.



kmymoney/dialogs/knewaccountdlg.cpp (line 239)
<https://git.reviewboard.kde.org/r/130143/#comment68704>

    Agreed, it might be not so wise to hide the widget in case the account cannot be made an opening balance account.
    
    I just verified that the tooltip is also shown when a widget is disabled. So showing a descriptive text in the tooltip whenever the widget is disabled is a good idea.



kmymoney/dialogs/knewaccountdlg.cpp (line 240)
<https://git.reviewboard.kde.org/r/130143/#comment68703>

    You could simplify this whole basic block into a single instruction with
    
    m_qcheckboxOpeningBalance->setEnabled(MyMoneyFile::instance()->transactionCount(account.id()) == 0);


- Thomas Baumgart


On Mai 30, 2017, 9:45 vorm., Ralf Habacker wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130143/
> -----------------------------------------------------------
> 
> (Updated Mai 30, 2017, 9:45 vorm.)
> 
> 
> Review request for KMymoney.
> 
> 
> Bugs: 370290
>     http://bugs.kde.org/show_bug.cgi?id=370290
> 
> 
> Repository: kmymoney
> 
> 
> Description
> -------
> 
> This patch introduce a feature to specify a dedicated account
> to be used as opening balance account instead of using an account
> with a predefined name which may be language specific.
> 
> The "opening balance account" flag could be set in the account
> editor if no other account contains this flag. Also changing
> the state of the flag is only possible if no transactions are
> assigned to the account having this flag.
> 
> On creating a new kmymoney file the "opening balance account"
> flag is imported from a related template account flag if specified
> in the following form
> 
> <account type="16" name="9000 Saldovortragskonten">
>    <flag name="OpeningBalanceAccount" value="1"/>
> </account>
> 
> If specified the template admin needs to make sure that only one
> template account has this flag set.
> 
> Exporting the current kmymoney file to an account template exports
> this flag too.
> 
> BUG:370290
> 
> 
> Diffs
> -----
> 
>   kmymoney/converter/mymoneytemplate.cpp 25a343e3fbdd9409ebdbd814bc08122c151a09d9 
>   kmymoney/dialogs/knewaccountdlg.cpp dfe2967174bf323d9eda4983fd545d0930a9ec43 
>   kmymoney/dialogs/knewaccountdlgdecl.ui bee638d2b4f73bc8496c86bbf606bfaa5fa4c913 
>   kmymoney/mymoney/mymoneyfile.cpp 692014b21ec8bff4e4c3f3f240d377cd7b9697b3 
>   kmymoney/mymoney/storage/mymoneystorageanon.cpp b6d0dc6a7b499aa45498cb76bef836731ff618d4 
>   kmymoney/reports/objectinfotable.cpp 584a9a378d37d51766e551d8e6b6baffe4fb397d 
>   kmymoney/reports/reportstestcommon.h 22000165dff793c5d7281072f702e0ca3c40f882 
>   kmymoney/reports/reportstestcommon.cpp 40b103ca965e0a1973b6fd0a351ddb976aa10471 
> 
> Diff: https://git.reviewboard.kde.org/r/130143/diff/
> 
> 
> Testing
> -------
> 
> - compiled
> - set/unset "opening balance account" flag in account editor for a given account and save/load kmymoney file -> state is persistent
> - checked if it is possible to set "opening balance account" flag in an additional account -> check box is not visible on editing the second account
> - checked if it is possible to change "opening balance account" flag if transactions are assigned to the opening balance account -> check box is disabled
> 
> Note: I choosed the flag name as to be 'OpeningBalanceAccount' in the template file and kmymoney file to have the same name.
> 
> 
> Thanks,
> 
> Ralf Habacker
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20170604/9603527b/attachment.html>


More information about the KMyMoney-devel mailing list