summaryrefslogtreecommitdiff
path: root/print_bom.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-07 16:51:15 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-07 16:51:15 +0100
commit9f5cb5855df61554e38a6da5d036bd78d421a2a9 (patch)
tree403cdd171269e8037cb8113f0735665ec916215c /print_bom.php
parentd75d099650de58ede08583e3dac27986544f799f (diff)
downloadstock-9f5cb5855df61554e38a6da5d036bd78d421a2a9.tar.gz
stock-9f5cb5855df61554e38a6da5d036bd78d421a2a9.tar.bz2
stock-9f5cb5855df61554e38a6da5d036bd78d421a2a9.zip
Stock package: assembly/component model, package-level xref, imports, print BOM
- LibertyXrefInfo/LibertyXrefGroup: package-level guid support ('stock') so stgrp, supplier, kitlocker groups are shared across SA and SC - schema_inc.php: stgrp group with KLG01-28, supplier consolidated to 'stock' level, kitlocker moved to 'stock', duplicate #PN/#PR removed - StockAssembly::getList(): non_root_only and show_empty fixes for standalone assemblies (no gallery hierarchy) - StockBase::loadXrefInfo(): instantiates with 'stock' package guid - list_assemblies.php: gallery_id param, show_empty default for flat list - edit_assembly.php: STOCKCOMPONENT_CONTENT_TYPE_GUID → string literal - ImportSimpleComponent: SCREF lookup fixed (xkey not xkey_ext), #SUP row now carries PN/price/URL directly; #PN #PR #URL separate rows removed - ImportKitlockerAssemblies, load_kitlocker_assemblies, load_component_list: new importers for KitlockerAssemblies.csv (A/C split) and Component List.csv - print_bom.php + print_bom.tpl: read-only printable BOM (p_stock_view only) with auto window.print() on load - component_order.tpl: print icon (floaticon), position number for print, hidden-print on form controls - list_stock.tpl: print icon - view_assembly.tpl: print icon → print_bom.php; permission gates tightened - ipackage duplicate attributes removed from templates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'print_bom.php')
-rw-r--r--print_bom.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/print_bom.php b/print_bom.php
new file mode 100644
index 0000000..4ad16c4
--- /dev/null
+++ b/print_bom.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Read-only printable BOM for an assembly. Requires p_stock_view only.
+ *
+ * @package stock
+ */
+
+namespace Bitweaver\Stock;
+
+require_once '../kernel/includes/setup_inc.php';
+
+use Bitweaver\KernelTools;
+
+global $gBitSystem, $gBitSmarty;
+
+$gBitSystem->verifyPermission( 'p_stock_view' );
+
+include_once STOCK_PKG_INCLUDE_PATH.'assembly_lookup_inc.php';
+
+if( !$gContent->isValid() ) {
+ $gBitSystem->fatalError( 'Assembly not found.' );
+}
+
+$gContent->loadXrefInfo();
+$gBitSmarty->assign( 'gXrefInfo', $gContent->mXrefInfo );
+
+$gBitSystem->display( 'bitpackage:stock/print_bom.tpl', $gContent->getTitle().' — '.KernelTools::tra('Parts List'), [ 'display_mode' => 'display' ] );