summaryrefslogtreecommitdiff
path: root/includes
AgeCommit message (Collapse)AuthorFilesLines
8 daysExtend KLID enrichment to assembly tab on movement viewHEADmasterLester Caine1-0/+20
Apply the same linked_title suffix to the assembly xref group rows so kitlocker components show their KLID there too. INNER JOIN on KLID means assemblies (which have none) are untouched. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 daysShow KLID in brackets on movement xref quantity line itemsLester Caine1-1/+6
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>
9 daysAppend KLID in brackets to component title where availableLester Caine1-0/+9
Add klid correlated subquery to both load() and getList(), then append it in getTitleFromHash(). Enrich title in the getList() foreach so list pages see the updated value without calling getTitleFromHash() themselves. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 daysFix ref_key not loading on edit; restrict movement type to ORDER/TRANSLester Caine1-0/+3
Add ref_key (xkey) subquery to StockMovement::load() — it was present in getList() but missing from load(), so the field always appeared blank on edit. Filter edit_movement.php refTypes query to ORDER and TRANS only; REQN and PBLD are created via their own dedicated entry points. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15Link prebuild count in user_galleries to its PBLD movement recordLester Caine1-0/+7
Add prebuild_content_id to StockAssembly::getList() (most recent PBLD movement for the assembly owner) and link both the Prebuilt label and count in user_galleries.tpl to view_movement.php?content_id=. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14Add parsed_data, counts and kitlocker data to StockAssembly::getList()Lester Caine1-0/+17
- getList() now provides per-row: parsed_data (via parseDataHash), part_number (#SUP first), klid, component_count (BOM lines), prebuild_count (PBLD kit total for assembly owner) as correlated subqueries — removes need for supplementary queries in callers - list_assemblies.php: remove batch query block now redundant - user_galleries.tpl: show parsed_data in .content div; dl counts moved to panel-footer with margin-bottom:0; klid in panel-title second line; panel-heading tidied to title only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14Add multi-user (kitelf) stock filtering and PBLD prebuild movement typeLester Caine1-30/+38
- list_movements/list_stock: filter by user_id (kitelf) with breadcrumb navigation; creator names in list_movements are clickable filter links - list_movements: unified part_content_id replaces separate assembly_content_id/component_content_id URL params; type-aware breadcrumb and qty column (assembly kit count vs component qty) - StockMovement::getList(): $partId/$partIsAsm collapse cmp/asm into one variable; unified part_qty/part_qty_type SELECT; PBLD added to all ref_type IN() lists and sort subqueries; lc.user_id added to SELECT - New PBLD (Prebuild) movement type: add_prebuild.php/tpl creates PBLD movements (assemblies only, BOM exploded, optional note); add_requisition retired from UI; PBLD handled in edit/view with isBuild/isPbld flags; view/edit show Build Date/Completed labels for PBLD - schema_inc.php: PBLD registered in stockmovement reference xref items - view_movement.tpl: updated to <header>/<section> pattern with kitelf breadcrumb; getDirection() explicit for PBLD Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12stock: movement xref views use linked_title/linked_data; bomprt tidy; ↵Lester Caine1-23/+11
floaticon form fixes StockMovement::loadXrefInfo() — drop xref_title/xref_data enrichment (now from lc_linked JOIN); restore part_size/part_size_ext query; use array_map not array_column. stockmovement view_xref_bom_item/bomprt_item — switch to linked_title/linked_data. Movement bomprt qty: round(xkey/part_size, 3) of part_size (pieces-needed fraction). Both bomprt templates: drop notes row; drop part_size_ext (PRT = integer parts, not VOL). list_components: plain <form> (GET needs no CSRF), form-inline + form-group structure, hidden-print on floaticon; hide-kitlocker checkbox properly spaced. list_movements: hidden-print on floaticon div. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12stock: BOM view uses linked_title/linked_data; loadXrefInfo only enriches ↵Lester Caine1-4/+6
part_size Component title and description in BOM view templates (view_xref_bom_item, view_xref_bomprt_item, print_bom) now use linked_title/linked_data from the lc_linked JOIN in loadContent() — same pattern as the supplier name fix. StockAssembly::loadXrefInfo() drops the title/data enrichment loop (now redundant) and only queries for part_size/part_size_ext from the PRT xref. array_column replaced with array_map to reliably call ArrayAccess offsetGet on LibertyXref objects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12stock: hide-kitlocker filter on list_components; fix supplier name in ↵Lester Caine1-0/+19
view_xref_sup_item list_components defaults to hiding kitlocker components (KLID xref present) but keeps those where the kitlocker contact is also the supplier (#SUP → SCREF='kitlocker') — parts kitlocker supplies to elves. Filter checkbox in the search form, defaults on. view_xref_sup_item: switch from xref_title (cross_ref_title = "Supplier") to linked_title (liberty_content.title of the linked contact) so the contact name appears as the link text. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11StockBase: use xrefType()->loadContent() in loadXrefInfo()Lester Caine1-2/+1
Follows the new LibertyXrefType::loadContent() pattern — drops the direct LibertyXrefInfo construction now that loadContent() handles the dual-guid package/content-type query internally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11stock: merge stgrp xrefs into kitlocker group at data level; revert stgrp ↵Lester Caine1-0/+9
template tag; drop sgGroup stash from component templates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10stock: add kitlocker gallery — view_kitlocker.php, ↵Lester Caine1-0/+5
stock_fixed_grid_inc.tpl, view_xref_kitlocker_group.tpl; stgrp getList filter; stgrp template field set to kitlocker Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10stock: remove gallery layout machinery — drop pagination constants, ↵Lester Caine3-58/+3
getLayout/getAllLayouts, per-page config, admin UI; simplify mod_components and display inc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10stock: rename PCK→PRT (fractional parts), add PCK as ordering pack-size ↵Lester Caine2-19/+19
tag; rename pack_size→part_size; bompck templates→bomprt; strip verbose labels (fraction), (H x W) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09stock: PCK/SHT fractional display, movement qty summing, import qty typeLester Caine1-6/+10
Display fixes: - list_stock, list_movements, view_component: PCK stock divides by pack_size for fractional strip display; SHT shows 2 decimal places - list_movements: pack_size fetched per component for PCK display - All fractional formats use %.2f consistently StockMovement::getList component filter: - Replace INNER JOIN on xcmp with EXISTS subquery to avoid duplicate rows when a component appears multiple times in a movement BOM - cmp_qty now SUMs all matching xref rows so multi-assembly RQs show total quantity rather than silently dropping duplicate rows Movement BOM edit templates: - stockmovement/edit_xref_bom_item.tpl: proper edit form for SGL/SHT/VOL lines linking back to view_component - stockmovement/edit_xref_bompck_item.tpl: same for PCK with pack size hint Import: - ImportSimpleComponent: columns 6/7 (qty_type, qty_value) wired up; PCK/SHT/VOL writes qty xref so movement CSV imports pick up default type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08stock: requisition system, movement BOM editor, autocomplete dropdownsLester Caine2-0/+21
Requisitions: - add_requisition.php: create REQN movements linked to assemblies or kitlocker components; Ordered date stored on REQN xref start_date - ASSEMBLY xref group registered in schema (sort_order=1, template=assembly); ASSEMBLY item registered with multiple=1 for future multi-item reqns - StockMovement::loadXrefInfo() enriches assembly group rows with linked_title/linked_desc from liberty_content - view_xref_assembly_group/item templates: Assembly tab with qty, title link, type; Add item form on edit_movement for REQNs; hidden on I-direction - view_movement/edit_movement: isReqn flag hides assembly tab and type selector on ORDER/TRANS; add another assembly from edit_movement BOM editor: - stockmovement/view_xref_bom_group: Add component links to new add_movement_component.php instead of generic liberty/add_xref.php - add_movement_component.php/.tpl: movement-aware add component page; uses movement_lookup_inc, STOCKMOVEMENT_CONTENT_TYPE_GUID, sequential xorder, redirects back to edit_movement Autocomplete dropdowns (replace <select> everywhere): - add_requisition: hidden+text+dropdown widget; KLID in JSON for matching - add_supplier: AJAX contact lookup replaces static supplier list - list_stock: assembly selector replaced with autocomplete dropdown - edit_movement: From field proper dropdown replacing datalist; Movement Type radio fixed (was reading non-existent mInfo[reference]) - view_xref_assembly_group: Add item inline form with same widget Import: - ImportKitlockerAssemblies: upsert xrefs on reload; KLID/KLSGL/KL3M now stored on both assemblies and components (not assembly-only) - StockComponent::getList: kitlocker_only filter via EXISTS(KLID xref) list_movements: Add Requisition icon alongside Add Movement in header Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07Stock package: assembly/component model, package-level xref, imports, print BOMLester Caine2-1/+11
- 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>
2026-06-06stock: docblock tidy across all four class filesLester Caine4-53/+355
Add/update docblocks for StockBase, StockComponent, StockAssembly, and StockMovement. File-level comments describe the content model; method comments document params, return types, and non-obvious behaviour (BOM enrichment, circular-assembly guard, movement direction inference, CSV import format, recursive CTE tree, xorder appending). Remove stale/empty @package duplicates on class declarations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06import: cull legacy importers; move data to storage/stock/Lester Caine1-0/+1
Remove old ImportAssembly/Component classes, load_stock, load_components, load_assemblies, load_kitlocker_assemblies/groups (one-off imports). Add STOCK_IMPORT_PATH = STORAGE_PKG_PATH.'stock/' to bit_setup_inc. Update load_simple_assemblies/components/components_2 to use STOCK_IMPORT_PATH instead of __DIR__.'/data/'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06xref: complete migration from loadXrefList to loadXrefInfoLester Caine4-82/+9
Remove loadXrefList() overrides from StockBase, StockAssembly, StockMovement; remove loadXrefList() calls from all load() methods. StockMovement::load() gains ref_type and ref_from_data correlated subqueries so templates no longer need mInfo.reference[0]. getDirection() reads mInfo.ref_type directly. component_order.php/tpl: switch to loadXrefInfo + gXrefInfo path. edit_assembly.php: remove stale bucket-clearing block. view_movement.tpl: use mInfo.ref_from_data instead of mInfo.reference.0.data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06Refactor xref display to LibertyXrefGroup path throughoutLester Caine4-1/+67
- StockBase/StockAssembly/StockMovement: add loadXrefInfo() overrides to enrich supplier group with contact titles and BOM group with component titles, descriptions and pack sizes - display_stock_assembly_inc, view/edit_component, view/edit_assembly, view_movement: replace getXrefGroupList() with loadXrefInfo() + assign gXrefInfo; edit pages pass allow_edit=true - All view/edit templates: switch {section} over stockXxx_types arrays to {foreach $gXrefInfo->mGroups as $xrefGroup} object path - BOM and supplier group templates rewritten: $xrefGroup object, column widths, class="table", conditional colspan - All BOM/supplier item templates: $gContent->mInfo.$source[xref].x -> $xrefInfo.x; $source ne 'history' -> $isHistory - Dead code removed: list_xref_stock.tpl, view_xref_pck_item.tpl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04stock: fix SCREF lookup to use xkey; remove duplicate datalist entriesLester Caine1-1/+1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: movement contact linkage, note field, view/edit tidyLester Caine1-0/+18
- importCsv: look up contact by SCREF xref.data, store content_id in xref.xref - load(): add ref_contact_id, ref_contact_name, ref_type_title subqueries - edit_movement.php: contact lookup URL; save xref.xref from manual picker; fix refRow.edit → refRow.data fallback - edit_movement.tpl: From field with contact autocomplete + hidden id; Note field - view_movement.tpl: supplier above dates, reference tab removed, note shown, Type shows cross_ref_title, contact links to contact record Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: preserve movement type when CSV import updates reference xrefLester Caine1-4/+6
importCsv() was hardcoding item='TRANS' on the reference row, overwriting an ORDER or REQN type already stored by edit_movement.php before the upload. Now fetches the existing item and preserves it; TRANS only used for new rows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: drop Ref column, sortable Ordered/Received, fix smartlink isortLester Caine1-2/+4
- Remove redundant ref_key column (shown in Reference already) - Add ref_start_date sort to getList() match block (subquery-based, avoids Firebird alias restriction) - Fix isort values: smartlink appends _asc/_desc itself — passing _desc in isort was generating ref_start_date_desc_desc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: fix markReceived, add ref_start_date to load(), tidy view_movement datesLester Caine1-1/+5
- markReceived() was passing mDb->NOW() string into BIGINT event_time; use time() - load() now includes ref_start_date correlated subquery (same as getList) - view_movement.tpl: Created → Ordered → Received order; Ordered only shown when ref_start_date is set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: CSV import order date → xref.start_date; add optional received dateLester Caine1-5/+23
Header line now: from, ref, order_date(dd/mm/yy), received_date(dd/mm/yy) - col 3 (order date) stored in liberty_xref.start_date on reference row - col 4 (received date, optional) stored in lc.event_time Existing 3-column CSVs still work unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: add Ordered/Received sort and ref_start_date to list_movementsLester Caine1-4/+12
- StockMovement::getList() adds ref_start_date correlated subquery from liberty_xref.start_date on the reference row - event_time sort handled explicitly (lc. prefix needed for Firebird) - list_movements.tpl: Ordered column, sortable Received column, colspan fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: fix pagination on list_movementsLester Caine1-0/+9
StockMovement::getList() was missing a COUNT query so postGetList() defaulted cant to max_records, giving total_pages=1 always. Also pass filter params (ref_type, find, component_content_id, assembly_content_id) through pagination links so filters survive page navigation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: add BOM component add page with autocompleteLester Caine1-0/+38
- add_component.php: find component by title and store BOM xref; redirect to component_order.php on success, or edit_component.php (title pre-filled) if component not found - add_component.tpl: form with datalist autocomplete via lookup_component.php - includes/lookup_component.php: JSON endpoint for component title search - edit_component.php: pre-fill title from request for new components - view_xref_bom_group.tpl: add button now goes to add_component.php Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: override getEditUrl() on all concrete content classesLester Caine2-0/+14
LibertyContent::getEditUrl() always builds edit.php; StockAssembly and StockMovement now return their correct entry points (edit_assembly.php, edit_movement.php). StockComponent already had this override. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Component movement history: filter list_movements by component_content_idLester Caine1-0/+10
StockMovement::getList() joins xcmp when component_content_id is set, adding cmp_qty/cmp_qty_type columns per row. list_movements.php looks up component title; template shows it in the header, adds a Qty column, and provides a back link. view_component Stock tab now links to filtered movement list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Move CSV import into StockMovement::importCsv(); fix storeXref by-refLester Caine1-0/+92
Standalone function removed from edit_movement.php; logic lives in the method using \$this->mDb. Named variable used for item storeXref call — literal arrays cause fatal error (passed by reference). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Fix CONTENT_TYPE_GUID define placement — movement stays in StockMovementLester Caine2-1/+2
StockMovement extends LibertyContent not StockBase, so STOCKMOVEMENT_CONTENT_TYPE_GUID belongs in StockMovement.php. StockBase correctly holds assembly and component defines only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Move all stock CONTENT_TYPE_GUID defines to StockBaseLester Caine3-5/+3
StockBase is always loaded first; defining all three constants there avoids files depending on each other's load order. Removed duplicate defines from StockComponent and StockMovement. Reverted spurious use StockComponent from edit_assembly.php. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Remove old fisheye-era files superseded by stock rewriteLester Caine5-490/+0
Removes gallery views, image editing, carousel/gallery liberty plugins, gallery/image templates, and supporting includes that predate the stock package rewrite. None of these exist in the current bitweaver5 working tree. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Rename stock_assembly_component_map table to stock_assembly_mapLester Caine3-41/+41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Fix two-arg constructor signature to work with getLibertyObject/getNewObjectLester Caine3-16/+29
All three classes only accepted one parameter; getNewObject passes (null, $contentId) so the content_id was silently dropped and the object never loaded. Coalesce $pContentId ?? $pPrimaryId preserves all existing single-arg call sites. Also guard explodeFromAssembly against non-numeric xkey via SIMILAR TO filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Rename view.php → view_assembly.php, edit.php → edit_assembly.phpLester Caine1-1/+1
Consistent with view_component, view_movement naming convention. All URL references updated across templates, modules, and StockAssembly::getDisplayUrlFromHash(). nginx pretty-URL rewrite updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Rewrite StockMovement as pure LibertyContent; CSV import; bom gridLester Caine2-9/+43
stock_movement/stock_movement_item tables retired. StockMovement now a pure LibertyContent subclass — direction from reference xref (REQN=out, TRANS/ORDER=in), received state from lc.event_time, items as quantity xrefs with explicit xorder. loadXrefList() enriches component names. schema_inc.php: full stockmovement xref seed — reference group (REQN/TRANS/ORDER) and quantity group (SGL/PCK/SHT/VOL, bom/bompck templates). MOV item removed from stockcomponent/stockassembly seed. edit_movement.php: type selector on create from DB; CSV upload parses header (from/ref/date) and component lines using component xref for default qty type. list_movements.php/tpl: rebuilt; ref_type filter; ref_type/ref_key/ received columns via xref subquery. view_movement.php/tpl: cleaned up; xref group tabs, allow_edit=false. stockmovement/ bom templates added. movement_lookup_inc simplified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Retire stock_movement, stock_assembly, stock_component tables from schemaLester Caine1-319/+80
stock_movement and stock_movement_item replaced by liberty_content + liberty_xref (quantity group for items, reference group REQN/TRANS/ORDER for direction). stock_assembly and stock_component were already dead (content_id used throughout). stock_assembly_component_map retained. MOV xref item removed from quantity seed data. StockMovement registered as content object. StockMovement rewritten as pure LibertyContent subclass — no movement_id, no table joins. Direction inferred from reference xref (REQN=out, TRANS/ORDER=in). Received state via lc.event_time / markReceived(). explodeFromAssembly() writes xref records. processMovement() removed pending import flow implementation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31Add supplier xref page; fix STOCKASSEMBLY_CONTENT_TYPE_GUID in StockBaseLester Caine1-0/+2
add_supplier.php + add_supplier.tpl: form to add a #SUP xref record with supplier contact (filtered by $04 type), part number, price and note in one step. view_xref_sup_group.tpl: smartlink updated to "Add supplier" pointing to the new page. StockBase: define STOCKASSEMBLY_CONTENT_TYPE_GUID with guard so it is available when StockAssembly is not loaded (e.g. component view path). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31Remove assembly_id/component_id: use content_id throughoutLester Caine6-687/+182
All stock classes, templates, imports, and controllers now reference content_id directly. StockRemote deleted (unused). StockBase: dead methods (isMachineName, updatePosition, isEditable) removed; hash_key aliases dropped. getList() keyed by content_id, fixing missing content_id in row data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31Remove stock_component table — use liberty_content directlyLester Caine4-125/+49
stock_component was a pure alias (component_id ↔ content_id with no other data). All queries now target liberty_content WHERE content_type_guid = STOCKCOMPONENT_CONTENT_TYPE_GUID directly. - StockComponent: drop mComponentId, constructor takes content_id only - All component_id URL params changed to content_id - Import files, edit_movement, sitemap updated to match - BOM xref templates updated (xref column migrated from component_id to content_id in live DB — 130 rows) - StockAssembly loadXrefList/enrichXrefDisplay join liberty_content directly; loadComponents drops stock_component LEFT JOIN - StockBase: previous/next keys renamed to _content_id stock_component table left in schema_inc.php pending DB reset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29Fix supplier view: contact name lookup and date column visibilityLester Caine1-1/+1
- StockBase: getAssoc() 2-col query returns scalar not array; access directly - view_xref_sup_item.tpl: move start_date and last_update_date inside xrefAllowEdit guard; remove |default:true to prevent false being overridden; column count now matches group template headers in both view and edit modes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29Supplier xref: #SUP consolidates contact/part/price; group template for ↵Lester Caine2-0/+34
stockcomponent - StockBase: loadXrefList() batch-fetches contact names for supplier rows so xref_title is available in view templates (not just edit) - StockBase: enrichXrefDisplay() handles supplier contact lookup for edit forms - StockAssembly: enrichXrefDisplay() calls parent first for supplier handling - schema_inc.php: #SUP template='sup'; supplier group template='sup' for stockcomponent so view_xref_sup_group.tpl is selected - New templates in stockcomponent/: view_xref_sup_group.tpl (Supplier/Part No./Price/Note headings), view_xref_sup_item.tpl (contact link to display_contact.php, dates/edit hidden in view mode), edit_xref_sup_item.tpl - view_component.tpl: pass allow_edit=false to hide dates and action buttons - edit_component.tpl: use getXrefListTemplate() for group dispatch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29BOM edit templates: component title/desc read-only, pack_size_ext supportLester Caine1-2/+21
- StockAssembly: enrichXrefDisplay() fetches component title, description, pack_size and pack_size_ext in one JOIN query for BOM edit forms - StockAssembly: loadXrefList() batch query also fetches pack_size_ext - edit_xref_bom_item.tpl: component shown as read-only link, only qty and ref designators editable; remove raw component ID field - edit_xref_bompck_item.tpl: new — PCK variant shows "N of pack_size ext" inline, Pieces required label - view_xref_bompck_item.tpl: show pack_size_ext after pack_size in qty cell Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29BOM parts list upload and display via liberty_xrefLester Caine2-0/+35
- StockAssembly: loadXrefList() override sorts quantity rows by xorder and batch-fetches component title, description and pack size in one JOIN query - StockComponent: getEditUrl() returns edit_component.php; new components redirect to edit after save so xrefs can be added immediately - edit.php: BOM CSV upload handler (ITEM/XORDER/XREF/XKEY/XKEY_EXT format) writing to liberty_xref via LibertyXref::store(); removed old component upload and single-add handlers - edit_component.php: removed spurious assembly/component guard on save - schema_inc.php: quantity group template='bom' for stockassembly; KLSGL kitlocker stock item; bom template on stockassembly quantity xref items - Templates: edit_assembly.tpl and view_assembly.tpl use getXrefListTemplate(); new list_xref_bom.tpl, list_xref_bompck.tpl, view_xref_bom_record.tpl, edit_xref_bom.tpl for BOM display and editing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28Fix assembly list pagination and search scopeLester Caine1-14/+20
StockAssembly::getList(): replace GetAssoc() with query() so limit/offset are actually applied — GetAssoc() silently ignored them (3rd/4th args are force_array/first2cols, not limit/offset), causing all rows to be returned. list_assemblies_simple.tpl: pass assembly_id through minifind so searching within a sub-level preserves the parent filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>