Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab Maintenance 28.03.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
ad465c40
Commit
ad465c40
authored
6 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
löschen von Produkten aus Offer / Order gefixt
parent
5bdc1110
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/OfferOrder_lib/process.js
+6
-19
6 additions, 19 deletions
process/OfferOrder_lib/process.js
with
6 additions
and
19 deletions
process/OfferOrder_lib/process.js
+
6
−
19
View file @
ad465c40
...
...
@@ -136,21 +136,6 @@ function ItemUtils(pOfferOrderId, pTableName) {
}
}
/**
* get a new SqlCondition Object with tablename + "ITEM." + tablename + "ITEMID" = pItemId
*
* @param {String} pItemId item id
* @param {String} [pTableName=this.tableName] table name, if this is not available
*
* @return {SqlCondition}
*/
ItemUtils
.
prototype
.
getNewItemIdCondition
=
function
(
pItemId
,
pTableName
)
{
if
(
pTableName
==
undefined
)
pTableName
=
this
.
tableName
;
return
SqlCondition
.
begin
().
andPrepare
(
pTableName
+
"
ITEM.
"
+
pTableName
+
"
ITEMID
"
,
pItemId
);
}
/**
* get netto and vat for all items or for all given items.
*
...
...
@@ -350,7 +335,6 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
*/
ItemUtils
.
prototype
.
deletePartsList
=
function
(
itemId
)
{
var
deletedItemIds
=
[];
//save address for this here to get class variables in recursive sub function __itemDeleteStatement
var
self
=
this
;
var
statements
=
[];
...
...
@@ -365,11 +349,14 @@ ItemUtils.prototype.deletePartsList = function(itemId) {
return
deletedItemIds
;
//recursive function for building item delete statements
function
__itemDeleteStatement
(
itemId
)
{
function
__itemDeleteStatement
(
itemId
)
{
var
itemsToDelete
=
self
.
ItemTree
[
itemId
].
ids
;
for
(
var
i
=
0
;
i
<
itemsToDelete
.
length
;
i
++
)
{
//unshift due to foreign key constraints (Delete hierarchically starting at the bottom)
statements
.
unshift
(
self
.
getNewItemIdCondition
(
itemsToDelete
[
i
],
self
.
tableName
).
build
(
"
1 = 2
"
));
//unshift due to foreign key constraints (Delete hierarchically starting at the bottom)
statements
.
unshift
([
self
.
tableName
+
"
ITEM
"
,
SqlCondition
.
begin
()
.
andPrepare
(
self
.
tableName
+
"
ITEM.
"
+
self
.
tableName
+
"
ITEMID
"
,
itemsToDelete
[
i
])
.
build
(
"
1 = 2
"
)]);
deletedItemIds
.
push
(
itemsToDelete
[
i
]);
__itemDeleteStatement
(
itemsToDelete
[
i
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment