|
06.06.2013, 10:34 | #1 |
Участник
|
Округление при разноске в ГК в 2012
интересный метод
\Classes\SubledgerJournalizer\roundSubledgerJournalTmpDetail X++: while select sum(TransactionCurrencyAmount), sum(AccountingCurrencyAmount), sum(ReportingCurrencyAmount) from subledgerJournalAccountEntryTmpDetail group by TransactionCurrencyCode, ExchangeRate1, ExchangeRate2, ReportingExchangeRate1, ReportingExchangeRate2, ExchangeRateDate, FiscalCalendarPeriod, Ledger, PostingLayer, SubledgerJournalEntryType //this subgrouping ensures we round each future SLJE separately where subledgerJournalAccountEntryTmpDetail.DebitCredit == DebitCredit::Debit && subledgerJournalAccountEntryTmpDetail.IsReversal == NoYes::No //reversal/relieving entries are backing out already rounded entries and should stay as they are // <GEEHU><GEECZ> && subledgerJournalAccountEntryTmpDetail.TransactionCurrencyAmount != 0 && subledgerJournalAccountEntryTmpDetail.ExchangeRate1 != 0 // </GEECZ></GEEHU> { ...если не совпадает X++: if (accountingCurrencyAmountToRound != 0 || reportingCurrencyAmountToRound != 0) { while select maxof(RecId) from roundingEntrySubledgerJournalAccountEntryTmpDetail group by TransactionCurrencyCode, ExchangeRate1, ExchangeRate2, ReportingExchangeRate1, ReportingExchangeRate2, ExchangeRateDate, DebitCredit where roundingEntrySubledgerJournalAccountEntryTmpDetail.Ledger == subledgerJournalAccountEntryTmpDetail.Ledger && roundingEntrySubledgerJournalAccountEntryTmpDetail.FiscalCalendarPeriod == subledgerJournalAccountEntryTmpDetail.FiscalCalendarPeriod && roundingEntrySubledgerJournalAccountEntryTmpDetail.PostingLayer == subledgerJournalAccountEntryTmpDetail.PostingLayer && roundingEntrySubledgerJournalAccountEntryTmpDetail.SubledgerJournalEntryType == subledgerJournalAccountEntryTmpDetail.SubledgerJournalEntryType && roundingEntrySubledgerJournalAccountEntryTmpDetail.IsReversal == NoYes::No //reversal/relieving entries should not be modified, don't pick them to apply difference to // <GEEHU><GEECZ> && roundingEntrySubledgerJournalAccountEntryTmpDetail.TransactionCurrencyAmount != 0 && roundingEntrySubledgerJournalAccountEntryTmpDetail.ExchangeRate1 != 0 // </GEECZ></GEEHU> { select firstonly forupdate updateEntrySubledgerJournalAccountEntryTmpDetail where updateEntrySubledgerJournalAccountEntryTmpDetail.RecId == roundingEntrySubledgerJournalAccountEntryTmpDetail.RecId; Теперь вопрос - а не надо ли во втором запросе(который выбирает максимальный RecId) добавить условие roundingEntrySubledgerJournalAccountEntryTmpDetail.TransactionCurrencyCode == subledgerJournalAccountEntryTmpDetail.TransactionCurrencyCode ?? |
|
06.06.2013, 11:03 | #2 |
Участник
|
Хотфикс KB2850454
|
|
Теги |
ax2012, subledger journal, округление |
|
|