AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.09.2010, 15:19   #1  
Wamr is offline
Wamr
----------------
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
 
1,737 / 858 (32) +++++++
Регистрация: 15.01.2002
Адрес: Москва
Записей в блоге: 7
CustVendSettle просмотр кода
DAX 2009 RU 5
просматривал код и возникли вопросы
- метод settleNow
строка 552 и далее
X++:
            if (!areDebitsDone && custVendTransDebit.AmountCur != 0)
            {
                //find the offset to the custVendTransDebet still open
                select firstonly custVendTransCredit order by RecId desc
                where custVendTransCredit.RecId == custVendTransDebit.OffsetRecId;

                this.setStillOpenValues(custVendTransDebit,
                    custVendTransOpenDebit.RecId,
                    specTransDebit.Balance01,
                    custVendTransCredit.Dimension,
                    debitTransState);
            }

            if (!areCreditsDone && custVendTransCredit.AmountCur != 0)
            {
                this.setStillOpenValues(custVendTransCredit,
                    custVendTransOpenCredit.RecId,
                    specTransCredit.Balance01,
                    custVendTransCredit.Dimension,
                    debitTransState); // ???
            }
почему (или зачем) при сохранении кредитовой проводки с ней идет состояние дебетовой?

- метод processStillOpenTransactions
Делается цикл по еще открытым проводкам.
X++:
    for (currentIndex = stillOpenIndex; currentIndex > 0; currentIndex--)
    {
        // Find over/under amount for the company
        currentCompany = stillOpenCompany[stillOpenIndex];
        changecompany(currentCompany)
        {
            // There can be multiple transactions per company in the index, but we only want to
            // process each company once for over/under taxes.  Will use set called companiesWithTaxProccesed
            // and if company is already in the set this is indication that taxes where already calculated
            // and shouldn't be calculated again.
            if (companiesWithTaxProcessed.in(currentCompany))
            {
                calcTaxForCompany = false;
            }
            else
...
Здесь каждый раз берется код компании для проводки с индексом stillOpenIndex, который не меняется. Надо либо changeCompany вынести из цикла, либо все-таки брать компанию для currentIndex .

- метод processStillOpenTransactions
объявлена переменная isCrossCompany.
Единственный раз ее значение меняется в цикле по проводкам. То есть, с какого-то момента все последуюшие проводки обрабатывются с признаком isCrossCompany = true, независимо от данных в самих проводках.
Это такая задумка или недодумка?

Последний раз редактировалось Wamr; 25.09.2010 в 15:51.
За это сообщение автора поблагодарили: kashperuk (5), Logger (3), ziva (2), MikeR (4), gl00mie (5).
Старый 28.09.2010, 20:15   #2  
tav is offline
tav
Участник
 
49 / 10 (1) +
Регистрация: 15.11.2002
Это еще не все. Вы взгляните на строки в методе settleForDifferentProfilesOrPrepayment:

X++:
        if (exchRateDiffCalcType == ExchRateDiffCalcType_W::Standard ||   firstCustVendTrans.RecId == custVendTransCredit.RecId)
        {
            closeAmountMST = _settleAmountMstDebit;
        }
сопоставил предоплату 3100 руб. с валютной отгрузкой 100$ по курсу 30. При таком алгоритме в основной валюте получается сумма 3000, хотя сумма в валюте проводки 3100 и валюта проводки - рубли.
__________________
yes
Старый 11.10.2012, 21:59   #3  
Sada is offline
Sada
Программатор
Аватар для Sada
 
1,450 / 153 (8) ++++++
Регистрация: 29.03.2005
Адрес: Толи Барнаул, толи Москва
\Classes\CustVendSettle\settleForDifferentProfilesOrPrepayment

X++:
        if (reversePrepayment)
        {
            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
                                                    custVendTransDebit,
                                                    this.amount(_settleAmountCurCredit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransDebit.Dimension,
                                                    custVendTransDebit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                    this.amount(- closeAmountMST),
                                                    0,
                                                    custVendTransCredit.CurrencyCode);

            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
                                                    custVendTransCredit,
                                                    this.amount(-_settleAmountCurCredit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransCredit.Dimension,
                                                    custVendTransCredit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                    this.amount(closeAmountMST));
        }
        else
        {
            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
            // </GEEU>
                                                    custVendTransDebit,  ??????????????????????????????????????????????????????????????????????
                                                    this.amount(_settleAmountCurDebit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransCredit.Dimension,
                                                    custVendTransCredit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                     /* <SYS>
                                                     this.amount(_settleAmountMstDebit));
        }
        else
        {
            CustVendSettle_Vend::postingProfileSettle(ledgerVoucher,
            </SYS> */
                                                    // <GEEU>
                                                    this.amount(closeAmountMST));

            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
            // </GEEU>
                                                    custVendTransDebit,
                                                    this.amount(-_settleAmountCurDebit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransDebit.Dimension,
                                                    custVendTransDebit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                      /* <SYS>
                                                      this.amount(-_settleAmountMstDebit));

            CustVendSettle_Vend::postingProfileSettle(ledgerVoucher,
                                                      custVendTransDebit,
                                                      this.amount(_settleAmountCurDebit),
                                                      custVendTransSettlement,
                                                      settlementGroupPlaceHolder,
                                                      custVendTransCredit.Dimension,
                                                      custVendTransCredit.PostingProfile,
                                                      LedgerTransTxt::Settlement,
                                                      this.amount(_settleAmountMstDebit));
                                                      </SYS> */
                                                    // <GEEU>
                                                    this.amount(- closeAmountMST));
        }
Мне показалось или там custVendTransCredit должно быть?
За это сообщение автора поблагодарили: kashperuk (5).
Старый 12.10.2012, 08:22   #4  
S.Kuskov is offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3,429 / 1772 (66) ++++++++
Регистрация: 28.04.2007
Адрес: Калуга
Цитата:
Сообщение от Sada Посмотреть сообщение
Мне показалось или там custVendTransCredit должно быть?
Не только вам Сопоставление разных профилей (договоры)
Старый 15.10.2012, 13:08   #5  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Только вот недавно эту тему увидел.
Баги создал, но уже наверное поздно, но может пофиксят хотфиксом каким-нить.
Старый 20.02.2013, 15:58   #6  
Sada is offline
Sada
Программатор
Аватар для Sada
 
1,450 / 153 (8) ++++++
Регистрация: 29.03.2005
Адрес: Толи Барнаул, толи Москва
И снова здравствуйте, любители сопоставлений! Оказывается, просто замена дебетовой проводки на кредитовую чинит одно, но ломает другое. Оказывается, нужно там еще передать валюту из ДЕБЕТОВОЙ проводки. Вот так:
X++:
            // </GEEU>
                                                    // BugFix 26.12.12 -->
                                                    //custVendTransDebit,
                                                    custVendTransCredit,
                                                    // BugFix 26.12.12 <--
                                                    this.amount(_settleAmountCurDebit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransCredit.Dimension,
                                                    custVendTransCredit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                     /* <SYS>
                                                     this.amount(_settleAmountMstDebit));
        }
        else
        {
            CustVendSettle_Vend::postingProfileSettle(ledgerVoucher,
            </SYS> */
                                                    // <GEEU>
                                                    this.amount(closeAmountMST)
                                                    // BugFix 19.02.13 -->
                                                    , 0
                                                    , custVendTransDebit.CurrencyCode);      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                                                    // BugFix 19.02.13 <--
по аналогии как в
X++:
        if (reversePrepayment)
        {
            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
                                                    custVendTransDebit,
                                                    this.amount(_settleAmountCurCredit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransDebit.Dimension,
                                                    custVendTransDebit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                    this.amount(- closeAmountMST),
                                                    0,
                                                    custVendTransCredit.CurrencyCode); !!!!!!!!!!!!!!!   :)

            CustVendSettle::postingProfileSettle_RU(ledgerVoucher,
                                                    custVendTransCredit,
                                                    this.amount(-_settleAmountCurCredit),
                                                    custVendTransSettlement,
                                                    settlementGroupPlaceHolder,
                                                    custVendTransCredit.Dimension,
                                                    custVendTransCredit.PostingProfile,
                                                    LedgerTransTxt::Settlement,
                                                    this.amount(closeAmountMST));
Фишка вот в чем, если сопоставляются две проводки в разных валютах, то Аксапта из Евро(например) с неправильно подсунутой валютой пытается перевести опять в Евро

Последний раз редактировалось Sada; 20.02.2013 в 16:01.
За это сообщение автора поблагодарили: S.Kuskov (1).
Старый 04.02.2015, 18:05   #7  
b_nosoff is offline
b_nosoff
Читатель
Аватар для b_nosoff
MCP
MCBMSS
 
197 / 143 (5) +++++
Регистрация: 01.12.2004
Адрес: Msk
Записей в блоге: 13
\Classes\CustVendSettle\calcCreditToDebitExchRate()

X++:
    // Use the payment date and exchange rates from the invoice company.
    exchangeRateHelper = ExchangeRateHelper::newExchangeDate(Ledger::primaryLedger(CompanyInfo::findDataArea(debitCompany).RecId),
                                                                custVendTransDebit.CurrencyCode,  // Invoice currency
                                                                custVendTransCredit.TransDate); // Payment date
                                                                // <--

AX2012 R2 CU7

UPDATE: Хотя, тут, может быть, все верно - рассчитывается курс на дату платежа, а не накладной. Но неочевидно как-то, похоже на копипасту )
__________________
Axapta non erubescit

Последний раз редактировалось b_nosoff; 04.02.2015 в 19:11.
Теги
ax2009, ax2012, custvendsettle, баг, сопоставление

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
эффективное отображение исполнения кода Evgeniy2020 DAX: Программирование 8 31.07.2008 11:11
как сообщить об ошибках, не прерывая исполнения кода chanchala DAX: Программирование 11 16.07.2008 12:28
проблема с настройкой штрихового кода Nic DAX: Функционал 4 27.12.2004 09:04
Отображение названия вместо кода! demID DAX: Программирование 31 05.10.2004 00:03
Использование штрихового кода (barcode) в Аксапта Pavlo AKA Panok DAX: Функционал 9 17.10.2003 15:13

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:11.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.