Skip to main content

MepApps.Dash.Inv.Batch.MiniMrpOrderCreation Documentation

Table of Contents

  1. Project Overview
  2. Key Features
  3. Architecture Summary
  4. Technology Stack
  5. Getting Started
  6. Project Structure
  7. Documentation Index
  8. Custom Implementations
  9. Configuration
  10. Development Guidelines
  11. Testing
  12. Deployment
  13. Troubleshooting
  14. Contributing
  15. Version History
  16. Related Projects
  17. 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

  1. SYSPRO 7.x or 8.x installed and configured
  2. SQL Server 2016 or higher
  3. .NET Framework 4.8 or .NET 6+ runtime
  4. Visual Studio 2022 or later
  5. SYSPRO operator with purchase order creation permissions

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/your-org/MepApps.Dash.Inv.Batch.MiniMrpOrderCreation.git
  2. Restore NuGet packages:

    dotnet restore
  3. Update connection strings in configuration

  4. Build the solution:

    dotnet build --configuration Release
  5. 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

Services (5 documents)

SYSPRO (5 documents)

UI (5 documents)

Examples (10 documents)

  1. MRP Order Creation Workflow - Core business process implementation
  2. Custom Database Validation - Database object validation framework
  3. Batch Order Processing - Queue-based order processing
  4. Dynamic Configuration System - Settings management implementation
  5. Audit Trail Implementation - Order creation audit logging
  6. Advanced Search and Filtering - Multi-criteria search implementation
  7. Settings and Preferences - User preference management
  8. Event-Driven Messaging - Custom event system
  9. Data Transformation Pipeline - Complex data transformations
  10. 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 grouping
  • OrderByDueDate: Enable due date grouping
  • MaxOrderLines: Maximum lines per purchase order
  • PageSize: Grid pagination size
  • AutoSearchOnSupplierSelect: 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

  1. Update version numbers
  2. Build release configuration:
    dotnet publish -c Release -o ./publish

SYSPRO Deployment

  1. Copy files to SYSPRO plugin directory
  2. Register plugin in SYSPRO
  3. Configure operator permissions
  4. Run database validation
  5. Test in production environment

Database Deployment

  1. Review SQL scripts in Resources/SQL
  2. Execute scripts in target database
  3. Verify view creation
  4. 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

  1. Create feature branch from develop
  2. Implement changes with tests
  3. Update documentation
  4. Submit pull request
  5. Code review and approval
  6. 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
  • 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