summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit_movement.php1
-rw-r--r--includes/classes/StockMovement.php3
2 files changed, 4 insertions, 0 deletions
diff --git a/edit_movement.php b/edit_movement.php
index defc9f4..588065b 100644
--- a/edit_movement.php
+++ b/edit_movement.php
@@ -29,6 +29,7 @@ $refTypes = $gBitDb->getAssoc(
FROM `".BIT_DB_PREFIX."liberty_xref_item` xi
JOIN `".BIT_DB_PREFIX."liberty_xref_group` xg ON xg.`x_group` = xi.`x_group` AND xg.`content_type_guid` = xi.`content_type_guid`
WHERE xi.`content_type_guid` = '".STOCKMOVEMENT_CONTENT_TYPE_GUID."' AND xi.`x_group` = 'reference'
+ AND xi.`item` IN ('ORDER','TRANS')
ORDER BY xi.`item`"
);
diff --git a/includes/classes/StockMovement.php b/includes/classes/StockMovement.php
index 178944d..a735607 100644
--- a/includes/classes/StockMovement.php
+++ b/includes/classes/StockMovement.php
@@ -109,6 +109,9 @@ class StockMovement extends LibertyContent {
, (SELECT FIRST 1 x.`item` FROM `{$X}liberty_xref` x
WHERE x.`content_id` = lc.`content_id` AND x.`item` IN ('REQN','TRANS','ORDER','PBLD')
ORDER BY x.`xorder`) AS ref_type
+ , (SELECT FIRST 1 x.`xkey` FROM `{$X}liberty_xref` x
+ WHERE x.`content_id` = lc.`content_id` AND x.`item` IN ('REQN','TRANS','ORDER','PBLD')
+ ORDER BY x.`xorder`) AS ref_key
, (SELECT FIRST 1 x.`data` FROM `{$X}liberty_xref` x
WHERE x.`content_id` = lc.`content_id` AND x.`item` IN ('REQN','TRANS','ORDER','PBLD')
ORDER BY x.`xorder`) AS ref_from_data