Skip to content

Conversation

@RemcoHalman
Copy link
Owner

  • Created modules.js variable file with product number mappings for all EBP files
  • Added new "Modules" tab button to index.html
  • Implemented displayModules function in ui.js to show:
    • Unique modules list with product numbers, variant numbers, and unit type IDs
    • Bill of Materials with quantities for each module
  • Updated tab switching logic to handle modules tab
  • Modules tab displays metadata and provides two separate views for module management

This enables users to view all available modules and generate a complete
Bill of Materials from the loaded EBP file.

claude and others added 6 commits December 24, 2025 12:44
- Created modules.js variable file with product number mappings for all EBP files
- Added new "Modules" tab button to index.html
- Implemented displayModules function in ui.js to show:
  - Unique modules list with product numbers, variant numbers, and unit type IDs
  - Bill of Materials with quantities for each module
- Updated tab switching logic to handle modules tab
- Modules tab displays metadata and provides two separate views for module management

This enables users to view all available modules and generate a complete
Bill of Materials from the loaded EBP file.
- Import MODULES array from modules.js in index.html
- Pass MODULES to displayModules function for reference data
- Update displayModules to show two sections:
  1. "Available Modules" - all modules from modules.js database
  2. "Bill of Materials" - actual items from loaded file with proper counting
- Fix BOM aggregation to count by product number only (not variant/unitTypeId)
- Now BOM properly aggregates quantities instead of showing separate entries

This ensures the BOM displays accurate counts for each product and provides
a complete reference list of all available modules.
- Updated module lookup to use standardUnitVariantNumber as the key
- Enriches units with product numbers from modules.js based on variant number matching
- BOM now aggregates by variant number (proper grouping)
- Added "Unit Name" column to BOM for clarity
- Product number now comes from modules.js lookup when variant matches

How it works now:
1. Scan modules.js and create lookup map by variant number
2. For each unit in EBP file, lookup product number using variant number
3. BOM groups by variant number and shows matched product number
4. Displays: Quantity, Product Number (from modules.js), Variant Number, Unit Name, Unit Type ID
Changes:
- Simplified Modules tab to only show Quantity and Product Number in BOM
- Removed "Available Modules" section (was redundant)
- Updated Units page to show "Product Number" instead of "Variant Number"
- Enrich all units with product numbers from modules.js on file load
- Product numbers are looked up by matching variant numbers in modules.js

How it works:
1. When EBP file is loaded, units are enriched with product numbers
2. Units tab displays product numbers (from modules.js lookup)
3. Modules tab shows clean BOM with just Quantity and Product Number
4. All lookups are done by matching standardUnitVariantNumber
Critical fixes:
1. Units page now shows "Unknown" instead of unit name when no product match
2. Fixed Modules tab crash caused by undefined moduleInfo access
3. Added null checks throughout to prevent JavaScript errors

The Modules tab was failing because line 471 tried to access
moduleInfo.productNumber without checking if moduleInfo exists first.
This caused a runtime error and prevented the tab from displaying.

All fallback values now consistently use "Unknown" instead of unit.name.
@RemcoHalman RemcoHalman merged commit b67fd39 into main Dec 24, 2025
3 checks passed
@RemcoHalman RemcoHalman deleted the claude/create-modules-variable-file-weRvk branch December 24, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants