定制 azaharizaman/nexus-payroll-mys-statutory 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

azaharizaman/nexus-payroll-mys-statutory

最新稳定版本:v0.1.0-alpha1

Composer 安装命令:

composer require azaharizaman/nexus-payroll-mys-statutory

包简介

Malaysia statutory payroll calculations (EPF, SOCSO, EIS, PCB) for Nexus Payroll package

README 文档

README

Country-specific statutory payroll calculations for Malaysia, implementing the Nexus\Payroll package's StatutoryCalculatorInterface.

Features

This package calculates Malaysian statutory deductions and employer contributions:

  • EPF (Employees Provident Fund) - Employee and employer contributions
  • SOCSO (Social Security Organization) - Employee and employer contributions
  • EIS (Employment Insurance System) - Employee and employer contributions
  • PCB (Income Tax Deduction) - Monthly tax estimate (MTD)

Calculation Rules (2024/2025)

EPF

  • Employee: 11% of monthly salary
  • Employer: 12% or 13% depending on salary (12% for salary ≤ RM5,000, 13% for > RM5,000)
  • Salary Ceiling: RM30,000 per month

SOCSO

  • Contribution Categories: Based on monthly salary ranges (RM30 to RM5,000)
  • Maximum Contribution: RM234.30 per month (for salary > RM4,950)
  • Both employee and employer contributions apply

EIS

  • Employee: 0.2% of monthly salary (capped)
  • Employer: 0.2% of monthly salary (capped)
  • Salary Ceiling: RM4,000 per month
  • Maximum Contribution: RM7.90 per month

PCB (Income Tax)

  • Calculated based on MTD (Monthly Tax Deduction) tables
  • Considers tax relief, marital status, and dependents
  • Progressive tax rates apply

Usage

use Nexus\PayrollMysStatutory\MalaysiaStatutoryCalculator;
use Nexus\Payroll\Contracts\PayloadInterface;

$calculator = new MalaysiaStatutoryCalculator();

// Create payload with employee and company data
$payload = new StandardPayload(
    employeeId: '01234567-89ab-cdef-0123-456789abcdef',
    employeeMetadata: [
        'tax_number' => 'SG1234567890',
        'socso_number' => '12345678',
        'epf_number' => '87654321',
        'marital_status' => 'married',
        'dependents' => 2,
    ],
    companyMetadata: [
        'company_registration_number' => '1234567-X',
        'epf_employer_number' => 'EMPLOYER123',
    ],
    grossPay: 5000.00,
    taxableIncome: 5000.00,
    basicSalary: 4000.00,
    earningsBreakdown: [
        ['code' => 'BASIC', 'name' => 'Basic Salary', 'amount' => 4000.00],
        ['code' => 'ALLOWANCE', 'name' => 'Transport Allowance', 'amount' => 1000.00],
    ],
    periodStart: new \DateTime('2025-01-01'),
    periodEnd: new \DateTime('2025-01-31'),
    ytdGrossPay: 60000.00,
    ytdTaxPaid: 1200.00,
);

// Calculate statutory deductions
$result = $calculator->calculate($payload);

// Get results
$totalEmployeeDeductions = $result->getTotalEmployeeDeductions(); // EPF + SOCSO + EIS + PCB
$totalEmployerContributions = $result->getTotalEmployerContributions(); // EPF + SOCSO + EIS
$netPay = $result->getNetPay();

// Get breakdown
$employeeDeductions = $result->getEmployeeDeductionsBreakdown();
// [
//     ['code' => 'EPF_EMPLOYEE', 'name' => 'EPF Employee Contribution', 'amount' => 550.00],
//     ['code' => 'SOCSO_EMPLOYEE', 'name' => 'SOCSO Employee Contribution', 'amount' => 24.75],
//     ['code' => 'EIS_EMPLOYEE', 'name' => 'EIS Employee Contribution', 'amount' => 7.90],
//     ['code' => 'PCB', 'name' => 'Income Tax (PCB)', 'amount' => 125.00],
// ]

$employerContributions = $result->getEmployerContributionsBreakdown();
// [
//     ['code' => 'EPF_EMPLOYER', 'name' => 'EPF Employer Contribution', 'amount' => 650.00],
//     ['code' => 'SOCSO_EMPLOYER', 'name' => 'SOCSO Employer Contribution', 'amount' => 84.75],
//     ['code' => 'EIS_EMPLOYER', 'name' => 'EIS Employer Contribution', 'amount' => 7.90],
// ]

Integration with Nexus Payroll

Register the calculator in your service provider:

use Nexus\PayrollMysStatutory\MalaysiaStatutoryCalculator;
use App\Services\Payroll\TenantAwareStatutoryCalculator;

public function register(): void
{
    $this->app->singleton(StatutoryCalculatorInterface::class, function ($app) {
        $tenantCalculator = new TenantAwareStatutoryCalculator();
        
        // Register Malaysia calculator
        $tenantCalculator->registerCalculator('MY', new MalaysiaStatutoryCalculator());
        
        // Set as default for Malaysian tenants
        $tenantCalculator->setDefaultCountryCode('MY');
        
        return $tenantCalculator;
    });
}

Required Employee Metadata Fields

  • epf_number - EPF membership number
  • socso_number - SOCSO registration number
  • tax_number - Income tax reference number
  • marital_status - 'single' or 'married' (for PCB calculation)
  • dependents - Number of dependents (for PCB calculation)

Required Company Metadata Fields

  • company_registration_number - SSM registration number
  • epf_employer_number - EPF employer reference number

Official References

Notes

  • Calculations are based on 2024/2025 statutory rates
  • EPF, SOCSO, and EIS rates may change annually - update accordingly
  • PCB calculations use simplified MTD tables - consult tax advisor for complex scenarios
  • Foreign workers may have different contribution rules

📖 Documentation

Package Documentation

Additional Resources

  • IMPLEMENTATION_SUMMARY.md - Implementation progress
  • REQUIREMENTS.md - Requirements
  • TEST_SUITE_SUMMARY.md - Tests
  • VALUATION_MATRIX.md - Valuation

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固