23.08.2008, 12:47 | #1 |
Участник
|
LedgerVoucherObject AX4
Скиньте кто-нибудь класс LedgerVoucherObject из SP3 или SP4.
Конкретнее, нужен метод ledgerVoucherObject.createLedgerTransStorno_RU(ledgerTrans.TransDate, ledgerTrans.Voucher); Хочу посмотреть, как там сделано сторно. Последний раз редактировалось KpecT; 23.08.2008 в 14:04. |
|
23.08.2008, 21:01 | #2 |
Участник
|
X++: // this method creates storno ledger transactions // based on _transDate, _voucher parameters; // transaction date and voucher of storno transaction // are inherided from this LedgerVoucherObject; // this method takes into account correspondence public void createLedgerTransStorno_RU(TransDate _transDate, Voucher _voucher) { LedgerVoucherTransObject templateTransObject; LedgerTrans ledgerTrans, ledgerTransNew, ledgerTransCorr; ; templateTransObject = new LedgerVoucherTransObject(); ttsbegin; if (! isConfigurationKeyEnabled(configurationkeynum(LedgerBond_RU)) || LedgerParameters::find().Correspondence_RU == NoYes::No) { while select ledgerTrans where ledgerTrans.Voucher == _voucher && ledgerTrans.TransDate == _transDate { templateTransObject.parmSourceRecId(ledgerTrans.RecId); ledgerTransNew = LedgerTrans::ledgerTransReverse(ledgerTrans); ledgerTransNew.Voucher = this.parmVoucher(); ledgerTransNew.TransDate = this.parmTransDate(); this.addTrans(LedgerVoucherTransObject::newLedgerTrans_RU(ledgerTransNew, templateTransObject)); } } else { while select ledgerTrans where ledgerTrans.Voucher == _voucher && ledgerTrans.TransDate == _transDate && ! ledgerTrans.Crediting { ledgerTransCorr = ledgerTrans.bondedLedgerTrans_RU(); templateTransObject.parmSourceRecId(ledgerTrans.RecId); ledgerTransNew = LedgerTrans::ledgerTransReverse(ledgerTrans); ledgerTransNew.Voucher = this.parmVoucher(); ledgerTransNew.TransDate = this.parmTransDate(); this.addTrans(LedgerVoucherTransObject::newLedgerTrans_RU(ledgerTransNew, templateTransObject)); templateTransObject.parmSourceRecId(ledgerTransCorr.RecId); ledgerTransCorr = LedgerTrans::ledgerTransReverse(ledgerTransCorr); ledgerTransCorr.Voucher = this.parmVoucher(); ledgerTransCorr.TransDate = this.parmTransDate(); this.addTrans(LedgerVoucherTransObject::newLedgerTrans_RU(ledgerTransCorr, templateTransObject)); ledgerBondClient.bondVRef2VRef(ledgerBondClient.lastVrefId(), ledgerBondClient.lastVrefId(-1)); } } ttscommit; } |
|