diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-21 11:15:46 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-21 11:15:46 +0100 |
| commit | aa7304a1f1f23199a8011c2385b638653e19a687 (patch) | |
| tree | bc5add84614e4026c9a11f244f4f3d99addb2f9f | |
| parent | d494e495715e1dca056a05442e83dfb16a0c0354 (diff) | |
| download | stock-aa7304a1f1f23199a8011c2385b638653e19a687.tar.gz stock-aa7304a1f1f23199a8011c2385b638653e19a687.tar.bz2 stock-aa7304a1f1f23199a8011c2385b638653e19a687.zip | |
Show KLID in brackets on movement xref quantity line items
Extend the enrichBomDisplay JOIN to also fetch the KLID xref and append
it to linked_title for any component that has a kitlocker listing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | includes/classes/StockMovement.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/classes/StockMovement.php b/includes/classes/StockMovement.php index a735607..9eb0cdd 100644 --- a/includes/classes/StockMovement.php +++ b/includes/classes/StockMovement.php @@ -190,8 +190,10 @@ class StockMovement extends LibertyContent { if( !$componentIds ) return; $components = $this->mDb->getAssoc( "SELECT lc.`content_id`, pck.`xkey` AS `part_size`, pck.`xkey_ext` AS `part_size_ext` + , klid.`xkey` AS `klid` FROM `".BIT_DB_PREFIX."liberty_content` lc - LEFT JOIN `".BIT_DB_PREFIX."liberty_xref` pck ON pck.`content_id` = lc.`content_id` AND pck.`item` = 'PRT' + LEFT JOIN `".BIT_DB_PREFIX."liberty_xref` pck ON pck.`content_id` = lc.`content_id` AND pck.`item` = 'PRT' + LEFT JOIN `".BIT_DB_PREFIX."liberty_xref` klid ON klid.`content_id` = lc.`content_id` AND klid.`item` = 'KLID' WHERE lc.`content_id` IN (".implode( ',', array_fill( 0, count( $componentIds ), '?' ) ).")", $componentIds ); @@ -199,6 +201,9 @@ class StockMovement extends LibertyContent { if( !empty( $row['xref'] ) && isset( $components[$row['xref']] ) ) { $row['part_size'] = $components[$row['xref']]['part_size']; $row['part_size_ext'] = $components[$row['xref']]['part_size_ext']; + if( !empty( $components[$row['xref']]['klid'] ) ) { + $row['linked_title'] .= ' ('.$components[$row['xref']]['klid'].')'; + } } } unset( $row ); |
