[Patch] Add a reversing transaction to the one(s) currently selected

Thomas Baumgart thb at net-bembel.de
Sat Mar 21 17:40:55 GMT 2020


Dawid,

On Samstag, 21. März 2020 16:16:43 CET Dawid Wrobel wrote:

> I added an option to duplicate selected transaction(s) *and* reverse it
> (them). Similar functionality exists in GnuCash.
> 
> The use case is that for some of the transactions you want to easily add a
> reversing transaction and assign it to an Income/Expense category. With
> that in mind, the reversed transaction has the same date as the original.
> 
> Checked-in to my branch:
> https://github.com/wrobelda/kmymoney/tree/add_reversing_transaction
> 
> P.S. Are you planning on moving to GitLab and using Pull Requests there to
> maintain contributions like these? I am developing on mac and using
> Phabricator to submit patches is quite a pain.

Eventually we will do that. Guess I have to learn how to work with those pull requests then.

I had a quick look at https://github.com/wrobelda/kmymoney/commit/170be2e2672ef082943119ccdbc172c424e9f926 and noticed the following things:

Why do you use

	d->m_value = d->m_value * MyMoneyMoney::MINUS_ONE;

instead of

	d->m_value = -d->m_value;


Also, make sure to invert the sign of the MyMoneySplit::m_shares member as well. Otherwise, your book-keeping is off ;)


-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
If a train station is where a train stops,
then what stops at a workstation?
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20200321/dae420ac/attachment.sig>


More information about the KMyMoney-devel mailing list