summaryrefslogtreecommitdiff
path: root/edit_movement.php
AgeCommit message (Collapse)AuthorFilesLines
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>