Skip to content
Snippets Groups Projects
Commit 1bf230bf authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Merge branch 'partlist' into 'master'

Partlist

See merge request xrm/basic!23
parents c38a1f33 f2dbac68
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1">
<name>Prod2prodPreview_view</name>
<name>Prod2ProdEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<genericViewTemplate>
<name>linkData</name>
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>a522d552-60cd-4b79-827f-64bb9b551f57</name>
<entityField>SOURCE_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>868f8e9b-c863-4515-8aec-0b3d8c7657b5</name>
<entityField>QUANTITY</entityField>
</entityFieldLink>
<entityFieldLink>
<name>79c10c6e-d84e-4147-b4a6-fb283cc3521e</name>
<entityField>OPTIONAL</entityField>
</entityFieldLink>
<entityFieldLink>
<name>7fb15e31-bb91-47a8-9ae4-15cc1734d7ee</name>
<entityField>TAKEPRICE</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
......@@ -12,6 +12,7 @@
<treetableViewTemplate>
<name>partlist</name>
<parentField>PARENTID</parentField>
<favoriteActionGroup1>alter</favoriteActionGroup1>
<titleField>PRODUCTCODE</titleField>
<descriptionField>QUANTITY</descriptionField>
<entityField>#ENTITY</entityField>
......
......@@ -38,6 +38,10 @@
<name>bf58edbf-0708-41a7-a092-ebc87a60c3c2</name>
<entityField>IMAGE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>913381d1-91cc-4ec7-b732-b35ddab01b90</name>
<entityField>test</entityField>
</neonTableColumn>
<neonTableColumn>
<name>ee627d12-c60c-48c2-a86e-2a144f5853e6</name>
<entityField>PRODUCTCODE</entityField>
......
......@@ -375,8 +375,10 @@ DataTree.prototype.toArray = function(pMaxDepth)
var uidMap = {};
__push(this.rootId, tree[this.rootId], 0);
function __push(pParent, pNode, pDepth) {
for (var i = 0; i < pNode.ids.length; i++) {
function __push(pParent, pNode, pDepth) {
if (pNode != undefined)
{
for (var i = 0; i < pNode.ids.length; i++) {
if (pNode.parent == that.baseId)
{
// set UUID to "" if it is a root-node
......@@ -388,6 +390,7 @@ DataTree.prototype.toArray = function(pMaxDepth)
if (pMaxDepth == undefined || pDepth < pMaxDepth)
__push(nextUid, tree[pNode.ids[i]], pDepth+1);
}
}
}
......
import("system.logging");
import("system.util");
import("system.SQLTYPES");
import("system.datetime");
......@@ -427,7 +428,8 @@ Prod2ProdUtils.prototype.getPartsListObject = function() {
* , "QUANTITY"
* , "OPTIONAL"
* , "TAKEPRICE"
* , "PRODUCTCODE"] ]
* , "PRODUCTCODE"
* , "PRODUCTID"] ]
*/
Prod2ProdUtils.prototype.getPartsListForRecordContainer = function() {
var tree = this._relateChilds();
......@@ -488,7 +490,7 @@ Prod2ProdUtils.prototype.getParentProdIds = function() {
*/
Prod2ProdUtils.prototype._initProd2ProdData = function() {
if (this.data == undefined) {
this.data = db.table("select SOURCE_ID, DEST_ID, PROD2PRODID, QUANTITY, OPTIONAL, TAKEPRICE, PRODUCTCODE, SOURCE_ID, DEST_ID "
this.data = db.table("select SOURCE_ID, DEST_ID, PROD2PRODID, QUANTITY, OPTIONAL, TAKEPRICE, PRODUCTCODE, PRODUCTID, SOURCE_ID, DEST_ID "
+ "from PROD2PROD join PRODUCT on PROD2PROD.SOURCE_ID = PRODUCTID "
+ "order by PRODUCTCODE ");
}
......@@ -500,7 +502,7 @@ Prod2ProdUtils.prototype._initProd2ProdData = function() {
Prod2ProdUtils.prototype._buildTree = function(supervised) {
this._initProd2ProdData();
var productId = this.productId;
var tree = DataTree.begin(this.productId).addArray(this.data,
function(pUid, pNode)
{
......@@ -522,6 +524,7 @@ Prod2ProdUtils.prototype._buildTree = function(supervised) {
pNode["optional"] = pNode.data[2];
pNode["takeprice"] = pNode.data[3];
pNode["productcode"] = pNode.data[4];
pNode["productid"] = pNode.data[5];
}
}
}
......@@ -538,11 +541,14 @@ Prod2ProdUtils.prototype._relateChilds = function() {
function __relate(id) {
var treeObject = tree.getTreeObject();
for (var treeId in treeObject) {
if (treeObject[treeId].destid == treeObject[id].sourceid && treeObject[id].ids.indexOf(treeId) == -1) {
treeObject[id].ids.push(treeId);
__relate(treeId);
}
if (treeObject[id] != undefined)
{
for (var treeId in treeObject) {
if (treeObject[treeId].destid == treeObject[id].sourceid && treeObject[id].ids.indexOf(treeId) == -1) {
treeObject[id].ids.push(treeId);
__relate(treeId);
}
}
}
}
}
......@@ -557,11 +563,14 @@ Prod2ProdUtils.prototype._relateParents = function() {
function __relate(id) {
var treeObject = tree.getTreeObject();
for (var treeId in treeObject) {
if (treeObject[treeId].sourceid == treeObject[id].destid && treeObject[id].ids.indexOf(treeId) == -1) {
treeObject[id].ids.push(treeId);
__relate(treeId);
}
if (treeObject[id] != undefined)
{
for (var treeId in treeObject) {
if (treeObject[treeId].sourceid == treeObject[id].destid && treeObject[id].ids.indexOf(treeId) == -1) {
treeObject[id].ids.push(treeId);
__relate(treeId);
}
}
}
}
}
\ No newline at end of file
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