MepApps.Dash.Inv.Batch.MiniMrpOrderCreation Documentation
Table of Contents
- Project Overview
- Key Features
- Architecture Summary
- Technology Stack
- Getting Started
- Project Structure
- Documentation Index
- Custom Implementations
- Configuration
- Development Guidelines
- Testing
- Deployment
- Troubleshooting
- Contributing
- Version History
- Related Projects
- Contact/Support
Project Overview
The MepApps.Dash.Inv.Batch.MiniMrpOrderCreation dashboard is a sophisticated Material Requirements Planning (MRP) solution that automates the creation of purchase orders based on inventory levels, safety stock requirements, and minimum quantity thresholds. Built on the MepDash framework, it integrates seamlessly with SYSPRO ERP to provide real-time inventory analysis and automated order generation capabilities.
This dashboard addresses the critical business need of maintaining optimal inventory levels while minimizing carrying costs. It calculates precise reorder quantities using advanced MRP algorithms, considers multiple ordering strategies, and creates purchase orders directly in SYSPRO through business object integration.
Key Features
- Advanced MRP Calculations: Dual calculation methods based on safety stock and minimum quantities
- Flexible Order Grouping: Configure orders by supplier, warehouse, and/or due date
- Real-time Inventory Analysis: Live data from SYSPRO with custom calculation views
- Batch Order Processing: Efficient creation of multiple purchase orders
- Supplier Management: Advanced supplier selection with filtering and validation
- Allocation Visibility: View sales order and WIP job allocations
- Dynamic Configuration: Settings management at multiple scopes (Program, Company, Operator)
- Excel Export: Export inventory and order data for analysis
- Audit Trail: Comprehensive logging of all order creation activities
- Database Validation: Automatic verification and creation of required database objects
- Responsive UI: WPF-based interface with modern Material Design elements
Architecture Summary
The solution follows a multi-layered architecture:
Presentation Layer
- WPF Views with XAML
- MVVM pattern with data binding
- Custom controls and converters
- Resource dictionaries for styling
Business Logic Layer
- MRP calculation engine
- Order consolidation services
- Business rule validation
- Workflow orchestration
Data Access Layer
- Entity Framework for complex queries
- Dapper for performance-critical operations
- Custom SQL views for MRP calculations
- Transaction management
Integration Layer
- SYSPRO E.net session management
- XML-based business object posting
- Error handling and retry logic
- Response parsing and validation
Cross-Cutting Concerns
- Dependency injection (Microsoft.Extensions.DependencyInjection)
- Structured logging with Serilog
- Configuration management
- Resource handling
Technology Stack
- Framework: .NET Framework 4.8 / .NET 6+
- UI Framework: WPF (Windows Presentation Foundation)
- Pattern: MVVM (Model-View-ViewModel)
- Data Access: Entity Framework 6, Dapper
- Database: SQL Server 2016+
- Integration: SYSPRO E.net Business Objects
- Logging: Serilog with Seq integration
- DI Container: Microsoft.Extensions.DependencyInjection
- Testing: MSTest, Moq
- Version Control: Git
Getting Started
Prerequisites
- SYSPRO 7.x or 8.x installed and configured
- SQL Server 2016 or higher
- .NET Framework 4.8 or .NET 6+ runtime
- Visual Studio 2022 or later
- SYSPRO operator with purchase order creation permissions
Setup Instructions
-
Clone the repository:
git clone https://github.com/your-org/MepApps.Dash.Inv.Batch.MiniMrpOrderCreation.git -
Restore NuGet packages:
dotnet restore -
Update connection strings in configuration
-
Build the solution:
dotnet build --configuration Release -
Deploy to SYSPRO environment (see Deployment section)
Configuration Requirements
- SYSPRO connection configuration
- Database connection string
- Seq logging endpoint (optional)
- User permissions setup
Project Structure
MepApps.Dash.Inv.Batch.MiniMrpOrderCreation/
├── Db/ # Database context and entities
│ └── PluginSysproDataContext.cs
├── Models/ # Data models and DTOs
│ ├── BindingModels/ # View model bindings
│ └── EventArgModels/ # Custom event arguments
├── Resources/ # Embedded resources
│ ├── SQL/ # SQL scripts for views
│ ├── CustomForms.xml # SYSPRO custom forms
│ ├── DatabaseValidation.json # DB validation config
│ └── MepSettings.json # Application settings
├── Services/ # Business and utility services
│ ├── NavigationServices/ # Navigation helpers
│ └── *.cs # Core services
├── ViewModels/ # MVVM ViewModels
│ ├── Dialog/ # Dialog ViewModels
│ └── *.cs # Page ViewModels
├── Views/ # WPF Views
│ ├── Dialog/ # Dialog views
│ └── *.xaml # Page views
└── docs/ # Documentation
├── navigation/ # Navigation patterns
├── services/ # Service documentation
├── syspro/ # SYSPRO integration
├── ui/ # UI patterns
└── examples/ # Implementation examples
Documentation Index
Navigation (5 documents)
- Navigation Architecture - Core navigation infrastructure and patterns
- Page Routing - View registration and discovery mechanisms
- Navigation Events - Event-driven navigation patterns
- Dialog Navigation - Modal dialog implementation
- Navigation Best Practices - Guidelines and anti-patterns
Services (5 documents)
- Service Architecture - Dependency injection and service patterns
- Data Services - Database access and ORM implementation
- Business Logic Services - Core MRP and order creation logic
- Integration Services - SYSPRO integration and posting
- Utility Services - Supporting services and helpers
SYSPRO (5 documents)
- SYSPRO Integration Overview - Overall integration architecture
- SYSPRO Data Models - Database entities and relationships
- SYSPRO Posting Patterns - Business object posting strategies
- SYSPRO Business Objects - PORTOI and other business objects
- SYSPRO Customization - Custom tables, views, and forms
UI (5 documents)
- UI Architecture - WPF/MVVM implementation
- MVVM Patterns - ViewModel patterns and data binding
- UI Components - Reusable controls and templates
- Data Presentation - Grids, paging, and data display
- User Interactions - Input handling and validation
Examples (10 documents)
- MRP Order Creation Workflow - Core business process implementation
- Custom Database Validation - Database object validation framework
- Batch Order Processing - Queue-based order processing
- Dynamic Configuration System - Settings management implementation
- Audit Trail Implementation - Order creation audit logging
- Advanced Search and Filtering - Multi-criteria search implementation
- Settings and Preferences - User preference management
- Event-Driven Messaging - Custom event system
- Data Transformation Pipeline - Complex data transformations
- Specialized UI Patterns - Custom controls and UI enhancements
Custom Implementations
MRP Calculation Engine
The dashboard implements a sophisticated dual-method MRP calculation:
- Safety Stock Method: Maintains minimum safety levels
- Minimum Quantity Method: Ensures minimum stock thresholds
- Reorder Quantity Rounding: Rounds up to reorder quantity multiples
Custom Database View (CG_InventoryOrdering_View)
A complex SQL view that pre-calculates MRP requirements by combining:
- Current stock levels
- Allocations (sales orders and WIP)
- In-transit quantities
- Safety stock and minimum levels
- Reorder quantity calculations
Dynamic Order Grouping
Flexible order consolidation based on configuration:
- Group by supplier only
- Group by supplier and warehouse
- Group by supplier and due date
- Group by supplier, warehouse, and due date
Database Validation Framework
Automatic verification and creation of required database objects:
- Checks for missing views
- Validates column existence
- Creates missing objects from embedded scripts
- Logs all database changes
Configuration
MepSettings.json
Key configuration options:
OrderByWarehouse: Enable warehouse groupingOrderByDueDate: Enable due date groupingMaxOrderLines: Maximum lines per purchase orderPageSize: Grid pagination sizeAutoSearchOnSupplierSelect: Auto-search behavior
Settings Scopes
- Program: System-wide settings
- Company: Company-specific configurations
- CompanyOperator: User within company
- Operator: User-specific preferences
Database Connection
Configure in app.config or appsettings.json:
<connectionStrings>
<add name="SysproConnection"
connectionString="Data Source=server;Initial Catalog=SysproCompany;..."/>
</connectionStrings>
Development Guidelines
Coding Standards
- Follow C# naming conventions
- Use structured logging with Serilog
- Implement proper disposal patterns
- Handle exceptions at appropriate levels
- Write unit tests for business logic
MVVM Guidelines
- Keep views code-behind minimal
- Use commands for all user actions
- Implement INotifyPropertyChanged properly
- Use data binding for all UI updates
- Separate concerns between layers
Database Development
- Prefix custom objects with 'CG_'
- Version control all SQL scripts
- Test performance with large datasets
- Document complex queries
- Use appropriate indexes
Testing
Unit Testing
Run unit tests:
dotnet test --filter Category=Unit
Integration Testing
Requires SYSPRO test environment:
dotnet test --filter Category=Integration
Manual Testing Checklist
- MRP calculations accuracy
- Order creation in SYSPRO
- Multi-user concurrency
- Large dataset performance
- Error handling scenarios
Deployment
Build Process
- Update version numbers
- Build release configuration:
dotnet publish -c Release -o ./publish
SYSPRO Deployment
- Copy files to SYSPRO plugin directory
- Register plugin in SYSPRO
- Configure operator permissions
- Run database validation
- Test in production environment
Database Deployment
- Review SQL scripts in Resources/SQL
- Execute scripts in target database
- Verify view creation
- Test data access
Troubleshooting
Common Issues
Database View Missing
Error: "Invalid object name 'CG_InventoryOrdering_View'" Solution: Run database validation service or manually execute creation script
SYSPRO Session Timeout
Error: "SYSPRO session is not valid" Solution: Check session configuration and network connectivity
Permission Denied
Error: "Insufficient privileges to create purchase orders" Solution: Verify SYSPRO operator permissions
Performance Issues
Symptom: Slow grid loading Solution: Check database indexes and consider implementing paging
Logging
Check Seq for detailed logs:
- Error level: Application errors
- Warning level: Business rule violations
- Information level: Normal operations
- Debug level: Detailed troubleshooting
Contributing
Development Process
- Create feature branch from develop
- Implement changes with tests
- Update documentation
- Submit pull request
- Code review and approval
- Merge to develop
Code Review Checklist
- Follows coding standards
- Includes unit tests
- Documentation updated
- No breaking changes
- Performance considered
Version History
Version 2.0.0 (Current)
- Implemented MRP calculation engine
- Added batch order processing
- Enhanced supplier selection
- Improved performance for large datasets
Version 1.5.0
- Added database validation framework
- Implemented audit logging
- Enhanced error handling
Version 1.0.0
- Initial release
- Basic order creation functionality
- SYSPRO integration
Related Projects
- MepDash Framework: Core dashboard infrastructure
- MepApps.Erp.Syspro: SYSPRO integration libraries
- MepApps.Dash.Template: Dashboard template project
Contact/Support
Development Team
- Team Lead: [Contact Information]
- Technical Support: support@company.com
- Documentation: This repository
Resources
Last Updated: 2025-08-14 Documentation Version: 1.0