25 Jan 2009
Posted by: Ricardo Pichler in: X++
Dando uma navegada, achei o codigo abaixo e é uma alternativa a outros modelos já exibidos aqui.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | public void sampleLedgerTrans() { Voucher voucher; LedgerVoucher ledgerVoucher; LedgerVoucherObject ledgerVoucherObject; LedgerVoucherTransObject ledgerVoucherTransObject; LedgerJournalTransTxt transTxt; Dimension dimension; AmountCur amount; Currency currencyCode; NumberSequenceCode numberSequenceCode; ; //<-- Feed a proper number sequence code to 'numberSequenceCode' here ttsbegin; voucher = NumberSeq::newGetNumFromCode(numberSequenceCode).num(); ledgerVoucher = LedgerVoucher::newLedgerPost(DetailSummary::Detail, SysModule::Ledger, numberSequenceCode); ledgerVoucherObject = LedgerVoucherObject::newVoucher(voucher, systemdateget(), SysModule::Ledger); ledgerVoucher.addVoucher(ledgerVoucherObject); //while (moreLines) <-- Loop to create all lines belonging to the current voucher (sum must balance) { ledgerVoucherTransObject = LedgerVoucherTransObject::newCreateTrans(ledgerVoucher.findLedgerVoucherObject(), ledgerPostingType::CustSettlement, //<-- Use best for your situation ledgerAccount, //<-- Account to post to dimension, //<-- Financial dimensions to use currencyCode, //<-- Use currency corresponding to amount amount, //<-- Amount to post my.TableId, //<-- TableId referenced (if applicable) my.RecId, //<-- RecId referenced (if applicable) qty); //<-- A qty (if applicable) ledgerVoucherTransObject.parmTransTxt(transTxt); //<-- Use best for your situation ledgerVoucher.addTrans(ledgerVoucherTransObject); } ledgerVoucher.end(); ttscommit; } |
[]s
Ricardo Pichler
2 Responses
matiazo
12|Feb|2009 1boa dica ricardo, porém o correto seria postar um voucher na contabilidade e journal financeiro. Um journal financeiro utiliza:
* LedgerJournalTrans (table)
* LedgerJournalTable (table)
* LedgerJournalCheckPost (class)
abs!
Cristiano
06|Dec|2017 2Gostaria de agradecer os esforos que voc colocou ao escrever este blog.
Eu estou esperando para verificar as mesmas postagens de blog de alto nvel
por voc tambm no futuro. Na verdade, suas habilidades de escrita criativa
me motivou a ter meu prprio blog agora;)
Leave a reply