How split transaction on sub category ?

Stephane's Avatar

Stephane

25 Sep, 2019 08:55 PM

Hi

How split transaction on sub category ? I would like split transaction on the sub category "Artisans" of category "Alimentation".

root = moneydance.getRootAccount()
book = moneydance.getCurrentAccountBook()
mainAccount = root.getAccountByName("Test")
miscAccount = root.getAccountByName("Alimentation")

desc="test desc"
memo="test memo"
amount = 98765
idate = 20190225

print book
newTxn = ParentTxn.makeParentTxn(book, idate, idate, idate, "", mainAccount, desc, memo, -1, ParentTxn.STATUS_UNRECONCILED)

print newTxn
txnSplit = SplitTxn.makeSplitTxn(newTxn, amount, amount, 1.0, miscAccount, desc, -1, AbstractTxn.STATUS_UNRECONCILED )
print txnSplit
newTxn.addSplit(txnSplit)
book.getTransactionSet().addNewTxn(newTxn)
book.refreshAccountBalances()

Thank you

  1. Support Staff 1 Posted by Maddy on 26 Sep, 2019 01:15 PM

    Maddy's Avatar

    Hi Stephane,
    Thank you for contacting Moneydance support.

    To split a transaction into several categories, create a new transaction or double click a transaction to edit it, then select the Category field to open the Category drop-down menu and click the “Split” button at the top (or press ⌘-L or Ctrl + L on your keyboard).

    Further details on handling split transactions are outlined in this article in the Knowledgebase.

    It might be also useful to see, this article on using "Tags".

    I hope this information is helpful. Please let me know if you have further questions or need any assistance.

    --
    Maddy, Infinite Kind Support

  2. 2 Posted by Stephane on 26 Sep, 2019 01:44 PM

    Stephane's Avatar

    Thank Maddy

    I World like split transaction in sub category with python extension.

    Could you help me ?

    Thank

  3. Support Staff 3 Posted by Maddy on 26 Sep, 2019 04:04 PM

    Maddy's Avatar

    Hi Stephane,

    I’m sorry to keep you waiting, but I’d like to run your query past the development team who may be able to provide further information.

    Thank you for your patience.

    --
    Maddy, Infinite Kind Support

  4. Support Staff 4 Posted by Sean Reilly on 26 Sep, 2019 10:01 PM

    Sean Reilly's Avatar

    Hi Stephane,

    Thanks for your interest in building python extensions to Moneydance! In order to make a transaction that is split across multiple categories (or accounts, if a transfer) you only need to add multiple SplitTxn objects to a single ParentTxn.

    I'd also add that you don't need to call refreshAccountBalances() or .addNewTxn(newTxn) on the transaction set. If you call .syncItem() on the parent transaction then that will "save" the transaction and the transaction will be added and balances recalculated automatically.

    Thanks!
    Sean

    --
    Sean Reilly
    Developer, The Infinite Kind
    https://infinitekind.com

  5. System closed this discussion on 26 Dec, 2019 10:10 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac