tronderdata/td-cost-calcultaror
Composer 安装命令:
composer require tronderdata/td-cost-calcultaror
包简介
Advanced cost calculation module for TaskHub
README 文档
README
⚠️ BETA VERSION: This module is currently in beta. Features may change and some functionality might be incomplete.
A comprehensive cost calculation system module for TaskHub that enables businesses to accurately calculate product and service costs by allocating various cost items with flexible pricing models.
📌 This is a module extension for TaskHub - you need a working TaskHub installation to use this module. Visit the TaskHub repository for core system installation and documentation.
🚀 Features
- 💰 Cost Item Management: Create and manage individual cost elements (salary, rent, equipment, etc.)
- 📦 Product Cost Calculation: Build products by allocating cost items with different allocation types
- ⏱️ Flexible Time Periods: Support for yearly, monthly, hourly, and minute-based pricing
- 🎯 Multiple Allocation Types: Fixed amounts, per-user costs, and per-resource-unit pricing
- 📊 Visual Cost Breakdown: Interactive charts and detailed cost analysis
- 🏷️ Category Integration: Seamless integration with TaskHub Categories module
- 🌍 Multi-language Support: Full Norwegian and English localization
- 📈 Forecasting Tools: Predict future costs and analyze trends
📋 Table of Contents
- Installation
- Quick Start Guide
- Real-World Example
- Feature Overview
- User Guide
- Technical Documentation
- Contributing
- License
🔧 Installation
Prerequisites
- TaskHub Core >= 11.0 (Get TaskHub)
- PHP >= 8.1
- Laravel >= 10.0
- MySQL/PostgreSQL
Important: This module requires a working TaskHub installation. Please install and configure TaskHub first by following the TaskHub installation guide.
Manual Installation (Recommended)
- Clone the repository into your TaskHub modules directory:
cd /path/to/your/taskhub/modules
git clone https://github.com/tronderdata/td-cost-calcultaror.git
- Install dependencies (if any):
cd td-cost-calcultaror
composer install --no-dev
- Run migrations:
php artisan migrate --path=modules/td-cost-calcultaror/database/migrations
- Clear cache:
php artisan cache:clear php artisan config:clear php artisan view:clear
Alternative: Download ZIP
- Download the latest release as ZIP
- Extract to your TaskHub
modules/directory - Follow steps 2-4 from manual installation above
Composer Installation (Future)
Note: This module is not yet published to Packagist. Composer installation will be available in a future release.
# This will work once published to Packagist
composer require tronderdata/td-cost-calcultaror
🚀 Quick Start Guide
1. Access the Module
Navigate to Admin Panel → Cost Calculator in your TaskHub installation.
2. Create Your First Cost Item
- Go to Cost Items → Create New
- Fill in basic information:
- Name: "Office Rent"
- Price: 15000
- Period: Monthly
- Category: Office Expenses
3. Create a Product
- Go to Products → Create New
- Configure your product:
- Name: "Consulting Service"
- Calculation Model: Per User
- Expected Users: 5
4. Allocate Costs
- Edit your product
- Click Add Cost Item
- Select cost items and set allocation amounts
- View real-time cost calculations
🏢 Real-World Example: "Rent a Nerd" Service
Let's walk through setting up a technical consulting service with realistic Norwegian business costs.
Step 1: Create Cost Items
Salary Cost
- Name: "Hourly Salary"
- Price: 531.59 (kr/hour including taxes and benefits)
- Period: Hour
- Category: Personnel
Office Rent
- Name: "Office Rent"
- Price: 13,385.78 (kr/month)
- Period: Month
- Category: Facilities
Note: We manually calculated this to 63.74 kr/hour based on 21 working days × 8 hours = 168 hours/month
Step 2: Create the Service Product
- Name: "Lei en nerd" (Rent a Nerd)
- Calculation Model: Per Resource Unit
- Expected Resource Units: 1 (consultant)
Step 3: Allocate Costs
- Salary: Fixed allocation of 531.59 kr
- Office Rent: Fixed allocation of 63.74 kr
Step 4: View Results
Total hourly cost: 595.33 kr/hour
- Salary: 531.59 kr (89.3%)
- Office overhead: 63.74 kr (10.7%)
This gives you a data-driven foundation for pricing your consulting services with proper cost coverage.
📖 Feature Overview
Cost Items Management
- ✅ Create, edit, delete cost items
- ✅ Bulk operations for efficiency
- ✅ Category organization
- ✅ Lifetime and capacity tracking
- ✅ Notes and documentation
Product Configuration
- ✅ Multiple calculation models (per user, per resource, fixed price)
- ✅ Expected usage parameters
- ✅ Real-time cost updates
- ✅ Professional allocation management
Allocation Types
| Type | Description | Use Case |
|---|---|---|
| Fixed | Same amount regardless of scale | Base costs, licenses |
| Per User | Cost multiplied by user count | User licenses, accounts |
| Per Resource Unit | Cost per resource/hour/unit | Equipment, consulting time |
Reporting & Analytics
- 📊 Cost breakdown visualization
- 📈 Monthly and yearly projections
- 🎯 Allocation distribution charts
- 📋 Detailed cost reports
👥 User Guide
For Administrators
- Setup Categories: Organize cost items logically
- Define Cost Items: Input all business costs with accurate periods
- Create Product Templates: Build reusable product configurations
- Monitor Usage: Review cost allocations regularly
For Project Managers
- Calculate Project Costs: Use existing cost items for project budgeting
- Compare Scenarios: Create multiple product variants
- Track Resource Usage: Monitor per-user and per-resource costs
- Generate Reports: Export cost breakdowns for stakeholders
For Financial Controllers
- Audit Cost Accuracy: Verify all cost items reflect reality
- Analyze Profitability: Review cost vs. revenue ratios
- Forecast Budgets: Use yearly projections for planning
- Monitor Trends: Track cost changes over time
🛠️ Technical Documentation
Database Schema
The module creates the following tables:
cost_items: Core cost elementsproducts: Product definitionscost_allocations: Cost-to-product relationshipscost_item_logs: Audit trail
API Endpoints
# Cost Items GET /api/cost-calculator/cost-items POST /api/cost-calculator/cost-items PUT /api/cost-calculator/cost-items/{id} DELETE /api/cost-calculator/cost-items/{id} # Products GET /api/cost-calculator/products POST /api/cost-calculator/products PUT /api/cost-calculator/products/{id} # Calculations POST /api/cost-calculator/products/{id}/calculate GET /api/cost-calculator/products/{id}/breakdown
Permissions
view_cost_calculator: View cost items and productsedit_cost_calculator: Create and edit cost datadelete_cost_calculator: Delete cost items and productsexport_cost_calculator: Export cost reports
Integration Points
- Categories Module: For cost item organization
- Export System: For data extraction
- Permission System: For access control
- Cache System: For performance optimization
🔄 Workflow Examples
Scenario 1: Software Licensing Cost
- Create cost item: "Microsoft 365 Business" (150 kr/user/month)
- Create product: "Office Suite Access"
- Allocate: Per-user allocation
- Result: Automatic scaling based on user count
Scenario 2: Equipment Depreciation
- Create cost item: "Laptop Fleet" (25,000 kr, 36-month lifetime)
- Calculate: 694.44 kr/month depreciation
- Allocate: Fixed allocation to all products
- Result: Accurate equipment cost distribution
Scenario 3: Consulting Service Pricing
- Combine multiple cost items (salary, rent, equipment, insurance)
- Create different service tiers (Junior, Senior, Expert)
- Allocate proportionally based on role
- Result: Competitive yet profitable pricing structure
🐛 Known Issues & Limitations (Beta)
- Excel Export: Limited formatting options
- Bulk Import: Not yet implemented
- Currency Support: Only NOK currently supported
- Historical Data: Limited trending capabilities
- Mobile UI: Some responsive design improvements needed
🗺️ Roadmap
Version 0.2.0
- Multi-currency support
- Advanced reporting dashboard
- Excel import/export improvements
- Mobile-optimized interface
Version 0.3.0
- Cost templates and presets
- Integration with accounting systems
- Advanced forecasting algorithms
- Automated cost adjustments
Version 1.0.0
- Full API documentation
- Comprehensive test coverage
- Production-ready performance
- Complete user documentation
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository git clone https://github.com/tronderdata/td-cost-calcultaror.git cd td-cost-calcultaror # Install dependencies composer install # Run migrations (from your TaskHub root directory) php artisan migrate --path=modules/td-cost-calcultaror/database/migrations # Run tests php artisan test modules/td-cost-calcultaror/tests/
Running Tests
# Unit tests php artisan test tests/Unit/ # Feature tests php artisan test tests/Feature/ # All tests php artisan test
📞 Support
- Documentation: Module Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@tronderdata.no
📜 License
This module is open-sourced software licensed under the MIT license.
🙏 Acknowledgments
- Built as a module extension for TaskHub
- Developed by TronderData AS
- Community feedback and contributions
- Inspired by real Norwegian business needs
Made with ❤️ in Norway
For the core TaskHub system, visit TaskHub Repository
For more TaskHub modules, visit TronderData Modules
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-08-14