承接 tourze/salary-manage-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/salary-manage-bundle

Composer 安装命令:

composer require tourze/salary-manage-bundle

包简介

企业薪酬管理 Symfony Bundle - 提供薪资计算、税务处理、社保管理的完整解决方案

README 文档

README

中文 | English

A comprehensive enterprise salary management Symfony Bundle that provides complete solutions for salary calculation, tax processing, and social insurance management.

Features

  • 💰 Salary Calculation: Flexible salary calculation engine with configurable rules and support for various pay components
  • 🧾 Tax Management: Automated tax calculation with support for multiple tax brackets and regional tax policies
  • 🛡️ Social Insurance: Comprehensive social insurance calculation including pension, medical, unemployment, work injury, and maternity insurance
  • 📊 Reporting: Advanced reporting system with multiple report types and export capabilities
  • 🔄 Workflow: Approval workflow system for salary calculations and payments
  • 💳 Payment Processing: Integrated payment processing with multiple payment methods and status tracking
  • 📁 Data Import/Export: Flexible data import and export functionality for integration with external systems
  • 🎯 Performance Integration: Performance data integration for performance-based salary calculations
  • 🕒 Attendance Integration: Attendance data integration for attendance-based salary calculations

Requirements

  • PHP ^8.2
  • Symfony ^7.3
  • Doctrine ORM ^3.0

Installation

composer require tourze/salary-manage-bundle

Configuration

Enable the bundle in your Symfony application:

// config/bundles.php
return [
    // ...
    Tourze\SalaryManageBundle\SalaryManageBundle::class => ['all' => true],
];

Basic Usage

Salary Calculation

use Tourze\SalaryManageBundle\Service\SalaryCalculatorService;
use Tourze\SalaryManageBundle\Entity\Employee;
use Tourze\SalaryManageBundle\Entity\PayrollPeriod;

// Get the salary calculator service
$calculator = $container->get(SalaryCalculatorService::class);

// Create employee and payroll period
$employee = new Employee();
$employee->setEmployeeNumber('EMP001');
$employee->setName('John Doe');
$employee->setBaseSalary('5000.00');

$period = new PayrollPeriod();
$period->setStartDate(new DateTime('2024-01-01'));
$period->setEndDate(new DateTime('2024-01-31'));

// Calculate salary
$calculation = $calculator->calculate($employee, $period);

// Get calculation results
$grossSalary = $calculation->getGrossSalary();
$netSalary = $calculation->getNetSalary();
$totalDeductions = $calculation->getTotalDeductions();

Tax Calculation

use Tourze\SalaryManageBundle\Service\TaxCalculatorService;

$taxCalculator = $container->get(TaxCalculatorService::class);

$taxResult = $taxCalculator->calculateTax($employee, $grossSalary);

$incomeTax = $taxResult->getIncomeTax();
$socialInsuranceTax = $taxResult->getSocialInsuranceTax();
$totalTax = $taxResult->getTotalTax();

Social Insurance Calculation

use Tourze\SalaryManageBundle\Service\SocialInsuranceCalculatorService;

$insuranceCalculator = $container->get(SocialInsuranceCalculatorService::class);

$insuranceResult = $insuranceCalculator->calculate($employee, $grossSalary);

$pensionInsurance = $insuranceResult->getPensionInsurance();
$medicalInsurance = $insuranceResult->getMedicalInsurance();
$unemploymentInsurance = $insuranceResult->getUnemploymentInsurance();

Report Generation

use Tourze\SalaryManageBundle\Service\ReportGeneratorService;

$reportGenerator = $container->get(ReportGeneratorService::class);

// Generate monthly salary report
$report = $reportGenerator->generateReport([
    'type' => 'monthly_salary',
    'period' => $period,
    'department' => 'IT'
]);

// Export to Excel
$excelFile = $reportGenerator->exportToExcel($report, 'salary_report.xlsx');

Data Import

use Tourze\SalaryManageBundle\Service\DataImportExportService;

$dataService = $container->get(DataImportExportService::class);

// Import employee data from CSV
$result = $dataService->importEmployees('employees.csv', [
    'employee_number' => 0,
    'name' => 1,
    'department' => 2,
    'base_salary' => 3
]);

Configuration

The bundle provides flexible configuration options:

# config/packages/salary_manage.yaml
salary_manage:
    # Regional configuration
    regional:
        default_region: 'CN'
        regions:
            CN:
                currency: 'CNY'
                tax_year: 'calendar'
                social_insurance_rates:
                    pension: 0.08
                    medical: 0.02
                    unemployment: 0.005

    # Calculation rules
    calculation:
        overtime_rate: 1.5
        weekend_rate: 2.0
        holiday_rate: 3.0

    # Approval workflow
    approval:
        enabled: true
        required_approvers: 2
        auto_approve_threshold: 1000

Entities

Core Entities

  • Employee: Employee information and salary details
  • PayrollPeriod: Payroll period definition
  • SalaryCalculation: Salary calculation results
  • SalaryItem: Individual salary components
  • TaxBracket: Tax bracket configuration
  • TaxResult: Tax calculation results
  • SocialInsuranceResult: Social insurance calculation results
  • Deduction: Various deduction types
  • PaymentRecord: Payment processing records
  • ApprovalRequest: Approval workflow requests

Enums

  • SalaryItemType: Types of salary items (base, overtime, bonus, etc.)
  • DeductionType: Types of deductions (tax, insurance, etc.)
  • PaymentStatus: Payment processing status
  • PaymentMethod: Payment methods (bank transfer, cash, etc.)
  • ApprovalStatus: Approval workflow status
  • InsuranceType: Social insurance types
  • ReportType: Available report types

Services

Core Services

  • SalaryCalculatorService: Main salary calculation engine
  • TaxCalculatorService: Tax calculation service
  • SocialInsuranceCalculatorService: Social insurance calculation
  • ReportGeneratorService: Report generation and export
  • ApprovalWorkflowService: Approval workflow management
  • PaymentProcessorService: Payment processing
  • DataImportExportService: Data import and export
  • ExternalSystemService: External system integration

Interfaces

All services implement corresponding interfaces for better testability and flexibility:

  • SalaryCalculatorInterface
  • TaxCalculatorInterface
  • SocialInsuranceCalculatorInterface
  • ReportGeneratorInterface
  • ApprovalWorkflowInterface
  • PaymentProcessorInterface
  • DataImportExportInterface

Exception Handling

The bundle provides specific exception types for better error handling:

  • SalaryCalculationException: Salary calculation errors
  • TaxCalculationException: Tax calculation errors
  • InsuranceCalculationException: Social insurance calculation errors
  • PaymentProcessingException: Payment processing errors
  • ApprovalWorkflowException: Approval workflow errors
  • DataValidationException: Data validation errors
  • DataAccessException: Data access errors
  • ReportGeneratorException: Report generation errors

Testing

The bundle includes comprehensive tests:

# Run all tests
php vendor/bin/phpunit

# Run specific test suites
php vendor/bin/phpunit tests/Service/
php vendor/bin/phpunit tests/Entity/
php vendor/bin/phpunit tests/Exception/

Integration Examples

EasyAdmin Integration

The bundle provides EasyAdmin integration for quick admin interface setup:

// config/packages/easy_admin.yaml
easy_admin:
    entities:
        - Tourze\SalaryManageBundle\Entity\Employee
        - Tourze\SalaryManageBundle\Entity\SalaryCalculation
        - Tourze\SalaryManageBundle\Entity\PayrollPeriod

External System Integration

use Tourze\SalaryManageBundle\Interface\ExternalSystemInterface;

class CustomERPSystem implements ExternalSystemInterface
{
    public function syncEmployeeData(Employee $employee): bool
    {
        // Sync employee data to external ERP system
        return true;
    }

    public function getAttendanceData(Employee $employee, \DateTime $startDate, \DateTime $endDate): array
    {
        // Get attendance data from external system
        return [];
    }
}

Performance Considerations

  • Caching: The bundle uses Symfony cache component for calculation results
  • Batch Processing: Support for batch salary calculations
  • Lazy Loading: Entities use lazy loading for optimal performance
  • Query Optimization: Optimized database queries for large datasets

Security

  • Input Validation: All inputs are validated using Symfony validator
  • Data Encryption: Sensitive data is encrypted in database
  • Access Control: Support for role-based access control
  • Audit Trail: Complete audit trail for all operations

Contributing

Please read our contributing guidelines before submitting pull requests.

License

This bundle is licensed under the MIT License. See the LICENSE file for details.

Support

For support and documentation:

Changelog

See CHANGELOG.md for details about changes in each version.

tourze/salary-manage-bundle 适用场景与选型建议

tourze/salary-manage-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「bundle」 「management」 「tax」 「payroll」 「hr」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tourze/salary-manage-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tourze/salary-manage-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 tourze/salary-manage-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-15