diff --git a/process/Neon_lib/process.js b/process/Neon_lib/process.js index 4d7d910d5d98598a85aec882756dd42d87cc0693..18402adc55753b73d0fe427c881e0b50e9333cfa 100644 --- a/process/Neon_lib/process.js +++ b/process/Neon_lib/process.js @@ -154,7 +154,7 @@ CopyModuleUtils.copyModule = function(pInputMapping) //root mapping var rootModule = Object.keys(pInputMapping)[0]; var ModuleMapping = _ModuleMapping(rootModule, pInputMapping[rootModule]); - var ModuleData = _getModuleData(rootModule, pInputMapping[rootModule].condition); + var ModuleData = _getModuleData(rootModule, pInputMapping[rootModule].condition, pInputMapping[rootModule].order); ModulesMapping[rootModule] = ModuleMapping; for(var row in ModuleData) @@ -171,15 +171,19 @@ CopyModuleUtils.copyModule = function(pInputMapping) //delivers stored data for module in Database with condition - function _getModuleData(pModule, pCondition) + function _getModuleData(pModule, pCondition, pOrder) { if(pModule == undefined) return {}; var ModuleColumnsStructure = AliasDefinitionStructure.tables[pModule].columns; var cols = Object.keys(ModuleColumnsStructure); var dataQuery = newSelect(cols).from(pModule); + if(pCondition != undefined) - dataQuery.where(pCondition) + dataQuery.where(pCondition); + + if(pOrder != undefined) + dataQuery.orderBy(pOrder); var dbData = dataQuery.table(); diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js index 86cc96712ade6e652f107912eb59adba772e00f3..0527be16d824a0c41bb9195f59d951b30ba437ea 100644 --- a/process/Offer_lib/process.js +++ b/process/Offer_lib/process.js @@ -406,7 +406,8 @@ OfferUtils.copyOfferItems = function (pSourceOfferId, pTargetOfferId, pDiscount) condition: newWhere("OFFERITEM.OFFER_ID", pSourceOfferId), ValueMapping: { "OFFER_ID": pTargetOfferId - } + }, + order: ["ASSIGNEDTO", "ITEMSORT"] } }; CopyModuleUtils.copyModule(inputMapping);