{"id":104,"date":"2019-09-25T13:42:54","date_gmt":"2019-09-25T16:42:54","guid":{"rendered":"https:\/\/pedrotornich.com\/a\/?p=104"},"modified":"2019-09-25T13:42:55","modified_gmt":"2019-09-25T16:42:55","slug":"create-journal-line-ax2012","status":"publish","type":"post","link":"https:\/\/pedrotornich.com\/a\/2019\/09\/25\/create-journal-line-ax2012\/","title":{"rendered":"Create Journal Line (AX2012)"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code lang=\"csharp\" class=\"language-csharp line-numbers\">protected LedgerJournalTrans createJournalLine(CustTransOpen _custTransOpen)\n{\n    CustTable custTable;\n    LedgerJournalTrans journalTrans;\n    AxLedgerJournalTrans_CustPaymJour axJournalTrans;\n\n    custTable = this.getCustTable(_custTransOpen.AccountNum);\n    axJournalTrans = AxLedgerJournalTrans_CustPaymJour::newLedgerJournalTable(journalTable);\n\n    journalTrans = axJournalTrans.ledgerJournalTrans();\n\n    journalTrans.TransDate = systemDateGet();\n    journalTrans.parmAccount(custTable.AccountNum, LedgerJournalACType::Cust);\n    journalTrans.initFromCustTable(custTable);\n    journalTrans.initForCurrency(journalTable);\n    journalTrans.parmOffsetLedgerDimension(journalTable.OffsetLedgerDimension);\n    \n    if(_custTransOpen.AmountCur &lt; 0)\n    {\n        journalTrans.AmountCurDebit = abs(_custTransOpen.AmountCur);\n    }\n    else\n    {\n        journalTrans.AmountCurCredit = _custTransOpen.AmountCur;\n    }\n\n    axJournalTrans.save();\n\n    return journalTrans;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-ax2012"],"_links":{"self":[{"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/posts\/104"}],"collection":[{"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":1,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/posts\/104\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pedrotornich.com\/a\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}