Добрый день! Скажите пожалуйста почему в инвент трансе не выбирается количество,
X++:
qbdsInventTrans = query.addDataSource(tableNum(InventTrans));
qbdsInventTrans.orderMode(OrderMode::GroupBy);
qbdsInventTrans.addSelectionField(fieldNum(InventTrans,Qty),SelectionField::Sum);
qbdsInventTrans.addSelectionField(fieldNum(InventTrans,CostAmountPosted),SelectionField::Sum);
qbdsInventTrans.addSelectionField(fieldNum(InventTrans,CostAmountAdjustment),SelectionField::Sum);
qbdsInventTrans.addRange(fieldNum(InventTrans,Qty)).value(strfmt("!=%1",0));
qbdsInventTrans.addRange(fieldNum(InventTrans,statusReceipt)).value(strfmt("<=%1",StatusReceipt::Received));
qbdsInventTrans.addRange(fieldNum(InventTrans,statusIssue)).value(strfmt("<=%1",StatusIssue::Sold));
qbdsInventTable = qbdsInventTrans.addDataSource(tableNum(InventTable));
qbdsInventTable.orderMode(OrderMode::GroupBy);
qbdsInventTable.addSortField(fieldNum(InventTable,ItemId));
qbdsInventTable.addSortField(fieldNum(InventTable,ItemType));
qbdsInventTable.joinMode(JoinMode::InnerJoin);
qbdsInventTable.fetchMode(QueryFetchMode::One2One);
qbdsInventTable.relations(true);
qbdsInventDim = qbdsInventTrans.addDataSource(tableNum(InventDim));
qbdsInventDim.orderMode(OrderMode::GroupBy);
qbdsInventDim.addSortField(fieldNum(InventDim,InventBatchId));
qbdsInventDim.addSelectionField(fieldNum(InventDim,InventBatchId));
qbdsInventDim.joinMode(JoinMode::InnerJoin);
qbdsInventDim.fetchMode(QueryFetchMode::One2One);
qbdsInventDim.relations(true);
qbdsInventTransOrigin = qbdsInventTrans.addDataSource(tableNum(InventTransOrigin));
qbdsInventTransOrigin.orderMode(OrderMode::GroupBy);
qbdsInventTransOrigin.addSortField(fieldNum(InventTransOrigin,ReferenceCategory));
qbdsInventTransOrigin.addSelectionField(fieldNum(InventTransOrigin,ReferenceCategory));
qbdsInventTransOrigin.joinMode(JoinMode::InnerJoin);
qbdsInventTransOrigin.fetchMode(QueryFetchMode::One2One);
qbdsInventTransOrigin.relations(true);
qbdsInventJournalTable = qbdsInventTransOrigin.addDataSource(tableNum(InventJournalTable));
qbdsInventJournalTable.orderMode(OrderMode::GroupBy);
qbdsInventJournalTable.addSortField(fieldNum(InventJournalTable,JournalId));
qbdsInventJournalTable.joinMode(JoinMode::InnerJoin);
qbdsInventJournalTable.fetchMode(QueryFetchMode::One2One);
qbdsInventJournalTable.addLink(fieldNum(InventTransOrigin,ReferenceId),fieldNum(InventJournalTable,JournalId));
qbdsInventJournalTable.addRange(fieldnum(InventJournalTable, DKL_TransDate)).value(queryrange(dateFrom, dateTo));
qbdsInventJournalTable.addRange(fieldnum(InventJournalTable, Posted)).value(queryValue(NoYes::Yes));
qbdsInventJournalTable.addRange(fieldnum(InventJournalTable, JournalType)).value(queryvalue(InventJournalType::Transfer));
qrType = qbdsInventJournalTable.addRange(fieldnum(InventJournalTable, MEL_OperationType));
qbdsInventLocationFrom = qbdsInventJournalTable.addDataSource(tablenum(InventLocation));
qbdsInventLocationFrom.orderMode(OrderMode::GroupBy);
qbdsInventLocationFrom.addSortField(fieldNum(InventLocation,InventLocationId));
qbdsInventLocationFrom.addSortField(fieldNum(InventLocation,Name));
qbdsInventLocationFrom.addSortField(fieldNum(InventLocation,InventLocationType));
qbdsInventLocationFrom.joinMode(JoinMode::InnerJoin);
qbdsInventLocationFrom.fetchMode(QueryFetchMode::One2One);
qbdsInventLocationFrom.addLink(fieldnum(InventJournalTable, DKL_InventLocationId), fieldnum(InventLocation, InventLocationId));
qbdsInventLocationTo = qbdsInventJournalTable.addDataSource(tablenum(InventLocation));
qbdsInventLocationTo.orderMode(OrderMode::GroupBy);
qbdsInventLocationTo.addSortField(fieldNum(InventLocation,InventLocationId));
qbdsInventLocationTo.addSortField(fieldNum(InventLocation,Name));
qbdsInventLocationTo.addSortField(fieldNum(InventLocation,InventLocationType));
qbdsInventLocationTo.joinMode(JoinMode::InnerJoin);
qbdsInventLocationTo.fetchMode(QueryFetchMode::One2One);
qbdsInventLocationTo.addLink(fieldnum(InventJournalTable, DKL_InventLocationIdTo), fieldnum(InventLocation, InventLocationId));
Далее идут ренжи по типам склада в зависимости от ситуатций! Все поля в остальных таблицах находит кроме полей в InventTrans!!!