11 KiB
Mold Cost Calculator - Admin User Guide
📋 Table of Contents
- System Overview
- Cost Calculation System
- Cost Factors & Pricing
- Admin Panel Access
- User Management
- Quotation Management
- System Configuration
- Troubleshooting
🎯 System Overview
The Mold Cost Calculator is a web-based application that calculates mold manufacturing costs based on various technical specifications and complexity factors. The system is designed for footwear industry professionals to get accurate cost estimates for different types of molds.
Key Features
- Multi-factor cost calculation based on mold type, complexity, and texture
- Country-specific tax rates for accurate regional pricing
- User management system with role-based access control
- Comprehensive admin panel for system oversight
- Real-time cost breakdown with detailed component analysis
💰 Cost Calculation System
Base Calculation Formula
The system uses a multi-layered calculation approach:
Total Cost = (Base Price + Complexity Cost + Texture Cost) × (1 + Tax Rate)
Where:
- Base Price = DEFAULT_NET_BASE × Mold Type Factor
- Complexity Cost = Base Price × (Slider Factor + Cavity Factor + High Sidewall Factor)
- Texture Cost = Base Price × Texture Factor
Default Values
- DEFAULT_NET_BASE: $12.50 (base unit cost)
- Tax Rates: Varies by country (see below)
📊 Cost Factors & Pricing
1. Mold Type Factors
The system applies different multipliers based on the specific mold type:
Rubber Molds
| Specific Type | Factor | Description |
|---|---|---|
| Flat | 1.00 | Standard flat outsole |
| Flat with Top/Heel Tip | 1.25 | Flat with additional tip features |
| Top PL | 1.05 | Top part line mold |
| Visible PL | 1.28 | Visible part line mold |
| Short PL (Heel/Forefoot) | 1.18 | Short part line for specific areas |
| Wave PL | 1.32 | Wave pattern part line |
CMEVA Molds
| Specific Type | Factor | Description |
|---|---|---|
| 2 Plates Mold | 1.00 | Standard 2-plate configuration |
| 3 Plates Mold | 1.35 | Complex 3-plate configuration |
| 2 Plates with in-mold channel | 1.25 | 2-plate with channel features |
| Breathable + in-mold channel | 1.45 | Breathable with channel features |
IMEVA Molds
| Specific Type | Factor | Description |
|---|---|---|
| 2 Plates Mold | 1.00 | Standard 2-plate configuration |
| 3 Plates Mold | 1.35 | Complex 3-plate configuration |
Sandal Molds
| Specific Type | Factor | Description |
|---|---|---|
| Sandal with Upper Bandage | 1.15 | Sandal with bandage features |
| 2 Plate without Upper Bandage | 1.05 | Standard 2-plate sandal |
Co-shot Molds
| Specific Type | Factor | Description |
|---|---|---|
| Co-shot mold | 1.25 | Multi-material injection |
| Foaming mold | 1.40 | Foam injection process |
PU Molds
| Specific Type | Factor | Description |
|---|---|---|
| 2 Plates Mold | 1.00 | Standard 2-plate configuration |
| 3 Plates Mold | 1.35 | Complex 3-plate configuration |
2. Complexity Factors
Additional costs based on mold complexity:
| Complexity Type | Factor | Calculation |
|---|---|---|
| High Sidewall (>60mm) | 0.18 | Base Price × 0.18 |
| Slider | 0.10 | Base Price × (Number of Sliders × 0.10) |
| Cavity | 0.12 | Base Price × ((Number of Cavities - 1) × 0.12) |
3. Texture Factors
Digital texture processing costs:
| Texture Type | Factor | Description |
|---|---|---|
| adidas digital | 0.00 | No additional cost |
| customized texture | 0.15 | 15% of base price |
| laser | 0.20 | 20% of base price |
4. Tax Rates by Country
| Country | Tax Rate | Percentage |
|---|---|---|
| China | 0.06 | 6% |
| Vietnam | 0.10 | 10% |
| Indonesia | 0.07 | 7% |
🔐 Admin Panel Access
Accessing the Admin Panel
- Login Requirements: Must be logged in with admin privileges
- URL: Navigate to
/admin/dashboard - Authentication: System checks
current_user.is_adminflag
Admin Privileges Required
- User account must have
is_admin = Truein the database - Admin users can access all system features
- Regular users are redirected to login with access denied message
👥 User Management
Viewing Users
- Location: Admin Panel → Users
- Features:
- List all registered users
- Search and filter functionality
- Pagination (20 users per page)
- User status indicators
User Information Displayed
- User ID
- Username
- Email address
- Account status (Active/Inactive)
- Role (Admin/User)
- Last login date
- Account creation date
User Actions
View User Details
- Click the eye icon (👁️) to view detailed user information
- Shows user profile and quotation history
Toggle User Status
- Click the toggle button to activate/deactivate users
- Inactive users cannot log in
- Confirmation dialog required
Delete User
- Restriction: Cannot delete your own account
- Process: Confirmation required before deletion
- Impact: Permanently removes user and all associated data
User Statistics
- Total registered users
- Active users (logged in within 30 days)
- User activity trends
📋 Quotation Management
Viewing Quotations
- Location: Admin Panel → Quotations
- Features:
- List all system quotations
- Advanced filtering options
- Pagination (20 quotations per page)
- Cost breakdown display
Filter Options
- Country: Filter by mold shop country
- Mold Type: Filter by main mold type
- Date Range: Filter by creation date
- Clear Filters: Reset all filters
Quotation Information Displayed
- Quotation ID
- User who created it
- Model name
- Country
- Mold type
- Base price
- Total cost
- Creation date
Quotation Actions
View Quotation Details
- Click the eye icon to view complete quotation details
- Shows all form data and cost breakdown
- Displays approval information
Delete Quotation
- Process: Confirmation required
- Impact: Permanently removes quotation from system
- Audit: Admin action logged
Quotation Statistics
- Total quotations in system
- Quotations by country
- Recent quotation activity
- Cost analysis trends
⚙️ System Configuration
Cost Factor Management
Updating Cost Factors
Cost factors are defined in app/constants.py:
COST_FACTORS = {
'mold': {
'Flat': 1.0,
'Flat with Top/Heel Tip': 1.25,
# ... other factors
},
'complexity': {
'high_sidewall': 0.18,
'slider': 0.1,
'cavity': 0.12
},
'texture': {
'adidas_digital': 0.0,
'customized texture': 0.15,
'laser': 0.2
}
}
Updating Tax Rates
Tax rates are also in app/constants.py:
TAX_RATES = {
'China': 0.06,
'Vietnam': 0.10,
'Indonesia': 0.07
}
Updating Default Base Price
Change DEFAULT_NET_BASE in app/constants.py:
DEFAULT_NET_BASE = 12.5 # Change this value
Database Management
Creating Admin Users
Use the CLI command to create admin users:
# Set environment variables
export ADMIN_USERNAME="admin"
export ADMIN_EMAIL="admin@company.com"
export ADMIN_PASSWORD="secure_password"
export ADMIN_COMPANY="Company Name"
# Run the command
flask init-db
Database Migrations
The system uses Alembic for database migrations:
# Create a new migration
flask db migrate -m "Description of changes"
# Apply migrations
flask db upgrade
Environment Configuration
Required Environment Variables
SECRET_KEY: Application secret keyDATABASE_URL: Database connection stringADMIN_EMAIL: Admin user emailADMIN_PASSWORD: Admin user password
Optional Environment Variables
FLASK_ENV: Environment (development/production)LOG_LEVEL: Logging levelMAIL_SERVER: Email server configuration
🔧 Troubleshooting
Common Issues
Cost Calculation Errors
Problem: Incorrect cost calculations Solution:
- Check cost factors in
app/constants.py - Verify mold type mappings
- Ensure all factors are properly defined
User Access Issues
Problem: Users cannot access admin panel Solution:
- Verify user has
is_admin = Truein database - Check user account is active
- Clear browser cache and cookies
Database Connection Issues
Problem: Database connection failures Solution:
- Check database server status
- Verify connection string in environment
- Check database permissions
- Review application logs
Form Validation Errors
Problem: Form submissions failing validation Solution:
- Check form field mappings
- Verify validation rules
- Review server logs for specific errors
- Ensure all required fields are properly configured
Log Analysis
Application Logs
- Location:
/app/logs/directory - Format: Timestamp, log level, message
- Key Logs: Error messages, validation failures, calculation results
Database Logs
- Location: Database server logs
- Key Information: Connection issues, query performance, errors
Performance Monitoring
System Metrics
- User activity levels
- Quotation creation rates
- Calculation response times
- Database query performance
Optimization Tips
- Monitor database query performance
- Review cache hit rates
- Check for slow calculations
- Monitor memory usage
📞 Support & Maintenance
Regular Maintenance Tasks
- Database Backups: Regular automated backups
- Log Rotation: Manage log file sizes
- Security Updates: Keep dependencies updated
- Performance Monitoring: Monitor system performance
- User Management: Review and clean up inactive users
Emergency Procedures
- System Downtime: Check server status and logs
- Data Corruption: Restore from latest backup
- Security Breach: Review access logs and user activity
- Performance Issues: Scale resources or optimize queries
Contact Information
- Technical Support: [Your IT Support Email]
- System Administrator: [Admin Contact]
- Emergency Contact: [Emergency Phone Number]
📈 System Analytics
Key Performance Indicators (KPIs)
- User Adoption: Number of active users
- Usage Patterns: Peak usage times
- Calculation Accuracy: Error rates in calculations
- System Performance: Response times and uptime
Reporting Capabilities
- User activity reports
- Quotation volume analysis
- Cost factor impact analysis
- Geographic usage patterns
Data Export
- Quotation data export (CSV/Excel)
- User activity reports
- Cost analysis reports
- System performance metrics
This admin guide should be updated whenever system changes are made to cost factors, user management features, or administrative functions.