summaryrefslogtreecommitdiff
path: root/edit_movement.php
AgeCommit message (Collapse)AuthorFilesLines
14 daysFix ref_key not loading on edit; restrict movement type to ORDER/TRANSLester Caine1-0/+1
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-14Add multi-user (kitelf) stock filtering and PBLD prebuild movement typeLester Caine1-4/+9
- 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-10stock: rename PCK→PRT (fractional parts), add PCK as ordering pack-size ↵Lester Caine1-2/+2
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-08stock: requisition system, movement BOM editor, autocomplete dropdownsLester Caine1-4/+70
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-06import: save uploaded CSVs to storage/stock/ for audit trailLester Caine1-0/+2
Add STOCK_IMPORT_PATH = STORAGE_PKG_PATH.'stock/' to bit_setup_inc. edit_assembly.php: move_uploaded_file BOM CSV to storage/stock/<origname>_bom_<content_id>.csv before processing. edit_movement.php: copy movement CSV to storage/stock/<origname>_move_<content_id>.csv before calling importCsv(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06edit_movement: switch xref tabs to LibertyXrefGroup pathLester Caine1-5/+2
Replace movement_xref_groups/getXrefGroupList() with loadXrefInfo() + gXrefInfo; reference group filtered in template as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03stock: movement contact linkage, note field, view/edit tidyLester Caine1-4/+60
- 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: redirect to view_movement after save/mark-receivedLester Caine1-2/+2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Move CSV import into StockMovement::importCsv(); fix storeXref by-refLester Caine1-92/+2
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-02edit_movement: support CSV upload at create timeLester Caine1-132/+104
Extract CSV processing into stockProcessMovementCsv() used by both fSave (new movement) and upload_csv (existing movement). Template: CSV file input shown on create form; enctype set to multipart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01Rewrite StockMovement as pure LibertyContent; CSV import; bom gridLester Caine1-102/+131
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-05-31Remove stock_component table — use liberty_content directlyLester Caine1-8/+6
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-27Add item_position column, DB-level sort, allow zero qty in movementsLester Caine1-6/+19
loadItems() now accepts a sort mode matching smartlink conventions (item_position_asc/desc, title_asc/desc) and orders at the DB level so future paging works correctly. edit_movement passes sort_mode from the request through to loadItems(). Template uses {smartlink} on Pos and Component headers for toggling sort direction. Zero quantity is now valid (needed for BOM-based movements where a part isn't required). item_position is auto-assigned as a sequence number on both CSV upload and manual add. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Redirect to edit page after creating new movementLester Caine1-1/+6
Saving a new movement now redirects to edit_movement.php?movement_id=X so the items/upload section is immediately visible. Saving an existing movement still returns to the list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Add CSV upload to edit_movement, fix foreach syntax, add PRG redirectsLester Caine1-5/+64
- CSV upload button on edit_movement reads the 3-column stock CSV and loads items directly into the open movement; shows loaded/skipped counts - Status select was using Smarty inline array literal (broken); replaced with PHP-assigned $statusOptions and {foreach from=} syntax - add_item and remove_item now redirect after success (PRG pattern) to prevent double-submit on refresh - load_stock.php remains but upload-on-edit is the preferred path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Add list_movements page and redirect after movement saveLester Caine1-2/+1
list_movements.php shows all movements with direction/status filter dropdowns and an Edit button per row. Menu gains a List Movements link. edit_movement.php now redirects to list_movements.php after a successful save rather than reloading the edit page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Add movement edit screen and menu entryLester Caine1-0/+112
edit_movement.php handles create/save, item add/remove, process, and delete. Template shows header fields, items table with remove buttons, inline add-item form, and a Process button when status=pending. Menu gains an Add Movement link gated on p_stock_create. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>