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, независимо от данных в самих проводках.
Это такая задумка или недодумка?