Skip to content
Snippets Groups Projects
Commit 2639a596 authored by Christoph Manhart's avatar Christoph Manhart
Browse files

[Projekt: Entwicklung - xRM][TicketNr.: 1071354][Neue Angebotsversion /...

[Projekt: Entwicklung - xRM][TicketNr.: 1071354][Neue Angebotsversion / Angebot kopieren mit Untergeordneten Angebotsposten Fehlerhaft]
parent c5603256
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment