Настраиваю распределение счетов ГК.
Если запись по распределению создается первый раз, то все работает. Если же изменяется уже существующее распределение, то получаем сообщение:
"Существуют схемы распределения с различными критериями по аналитике. Это может привести к неправильному распределению."
Полазил в коде, и в методе checkdimensionCriteria таблицы LedgerAllocation нашел следующую проверку:
Код:
while select ledgerAllocationCopy
where ledgerAllocationCopy.transBudget == this.transBudget &&
ledgerAllocationCopy.fromAccount == this.fromAccount
{
for (dimIdx = 1; dimIdx <= dimof(this.fromDimension); dimIdx++)
{
if (this.dimensionAllocation[dimIdx] != ledgerAllocationCopy.dimensionAllocation[dimIdx])
{
return checkFailed("@SYS59977");
}
}
}
При этом условие:
Код:
if (this.dimensionAllocation[dimIdx] != ledgerAllocationCopy.dimensionAllocation[dimIdx])
на существующей записи будет почти всегда выполняться, так как запись сравнивается сама с собой. Мне кажется, что корректно было бы так:
Код:
while select ledgerAllocationCopy
where ledgerAllocationCopy.transBudget == this.transBudget &&
ledgerAllocationCopy.fromAccount == this.fromAccount
&& ledgerAllocationCopy.RecId != this..RecId //дополнительная проверка
{
for (dimIdx = 1; dimIdx <= dimof(this.fromDimension); dimIdx++)
{
if (this.dimensionAllocation[dimIdx] != ledgerAllocationCopy.dimensionAllocation[dimIdx])
{
return checkFailed("@SYS59977");
}
}
}
Может я ошибаюсь?