Показаны различия между двумя версиями страницы.
— |
axapta:формированиепроводокгк [2018/04/13 22:43] (текущий) |
||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | Раздел: | ||
+ | ---- | ||
+ | {{toc}} | ||
+ | как формировать проводки [[ГлавнаяКнига]] описано в материалах курса MorphXIntergationMaster. | ||
+ | [[http:// | ||
+ | |||
+ | При сторнировании надо выставлять флаг parmCorrection в [[Класс/ | ||
+ | <code XPP> | ||
+ | _ledgerVoucher.findLedgerVoucherObject().parmCorrection( | ||
+ | _isCancellation); | ||
+ | </ | ||
+ | |||
+ | === Пример === | ||
+ | в качестве примера использования можно западной функциональности можно посмотреть Класс/ | ||
+ | |||
+ | [[РоссийскаяФункциональность]], | ||
+ | <code java> | ||
+ | // EVGL, Correspondence II --> | ||
+ | if (ledgerBondClient && AmountTrans) | ||
+ | { | ||
+ | ledgerBondClient.bondVRef2VRef(ledgerBondClient.lastVrefId(), | ||
+ | ledgerBondClient.lastVrefId(-1)); | ||
+ | } | ||
+ | // EVGL, Correspondence II --> | ||
+ | </ | ||
+ | |||
+ | еще один пример: | ||
+ | <code java> | ||
+ | // \Data Dictionary\Tables\CustTrans\Methods\postClosing | ||
+ | void postClosing(TransDate | ||
+ | ledgerVoucher | ||
+ | { | ||
+ | // Номерная серия | ||
+ | NumberSeq | ||
+ | | ||
+ | // Движок корреспонденции | ||
+ | // EGLA, Correspondence II, --> | ||
+ | LedgerBondClient_RU ledgerBondClient; | ||
+ | // EGLA, Correspondence II, <-- | ||
+ | |||
+ | // LedgerVoucher - объект инкапсулирующий всю операцию проводки | ||
+ | ledgerVoucher | ||
+ | // LedgerVoucherObject - объект инкапсулирующий документ ГК | ||
+ | LedgerVoucherObject ledgerVoucherObject; | ||
+ | // Признак того, что создается собственный объект разноску | ||
+ | boolean | ||
+ | | ||
+ | // Профиль разноски | ||
+ | CustPostingProfile | ||
+ | |||
+ | // Со счета | ||
+ | LedgerAccount | ||
+ | // На счет | ||
+ | LedgerAccount | ||
+ | |||
+ | // Если найден профиль разноски закрытия, | ||
+ | if (postingProfileClose && postingProfileClose != this.postingProfile) | ||
+ | { | ||
+ | // Получение счетов для разноски | ||
+ | fromAccount | ||
+ | toAccount | ||
+ | |||
+ | // Запоминания профиля разноски закрытия | ||
+ | this.postingProfileClose = postingProfileClose; | ||
+ | |||
+ | // Если счета отличаются | ||
+ | if (fromAccount != toAccount) | ||
+ | { | ||
+ | // Если нам не передали объект-разноску создаем свой: | ||
+ | if (! ledgerVoucher) // | ||
+ | { | ||
+ | // Получаем номерную серию | ||
+ | numberSeq = NumberSeq:: | ||
+ | |||
+ | // Создаем объект- разноску | ||
+ | ledgerVoucher = ledgerVoucher:: | ||
+ | SysModule:: | ||
+ | numberSeq.parmVoucherSequenceCode()); | ||
+ | // Создаем объект - voucher | ||
+ | ledgerVoucherObject = LedgerVoucherObject:: | ||
+ | _postingDate, | ||
+ | SysModule:: | ||
+ | LedgerTransType:: | ||
+ | // ссылка на платеж, | ||
+ | ledgerVoucherObject.parmPaymentReference(this.paymReference); | ||
+ | // Добавляем документ ГК в разноску | ||
+ | ledgerVoucher.AddVoucher(ledgerVoucherObject); | ||
+ | |||
+ | ledgerVoucherInit= true; | ||
+ | } | ||
+ | |||
+ | // Добавляем кредитовую проводку | ||
+ | ledgerVoucher.addTrans( | ||
+ | LedgerVoucherTransObject:: | ||
+ | ledgerVoucher.findLedgerVoucherObject(), | ||
+ | LedgerPostingType:: | ||
+ | fromAccount, | ||
+ | this.dimension, | ||
+ | this.currencyCode, | ||
+ | | ||
+ | this.recId)); | ||
+ | |||
+ | // Добавляем дебетовую проводку | ||
+ | ledgerVoucher.addTrans( | ||
+ | LedgerVoucherTransObject:: | ||
+ | ledgerVoucher.findLedgerVoucherObject(), | ||
+ | LedgerPostingType:: | ||
+ | toAccount, | ||
+ | this.dimension, | ||
+ | this.currencyCode, | ||
+ | this.amountCur, | ||
+ | this.recId)); | ||
+ | | ||
+ | // EGLA, Correspondence II --> | ||
+ | // Получаем объект для корреспонденции | ||
+ | ledgerBondClient = ledgerVoucher.findLedgerVoucherObject().ledgerBondClient_RU(); | ||
+ | if (ledgerBondClient && this.amountCur) | ||
+ | { | ||
+ | // Устанавливаем корреспонденцию | ||
+ | ledgerBondClient.bondVRef2VRef(ledgerBondClient.lastVrefId(), | ||
+ | | ||
+ | } | ||
+ | // EGLA, Correspondence II <-- | ||
+ | |||
+ | // Устанавливаем дату закрытия | ||
+ | this.closed = this.maxSettlementDate(_postingDate); | ||
+ | |||
+ | // если нам пришлось создать собственный объект-разноску: | ||
+ | if (ledgerVoucherInit) | ||
+ | { | ||
+ | // завершаем её | ||
+ | ledgerVoucher.end(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | === см. также == | ||
+ | [[: | ||
+ | *[[http:// | ||
+ | *Класс/ | ||
+ | *[[http:// |