计算雇主在雇员公积金,基本,总薪金和劳动福利基金上的支出总额。
我要添加公积金,基本工资,工资总额和劳动福利基金,并将其存储到另一个变量中。
应添加所有四个变量,即pf,esic,gp和lwf,并且必须将其存储在另一个变量中并打印结果。
我正在使用zendframework和PHP,并且已经查询了公积金,esic,工资总额和劳动福利基金,并计算了所有公积金,esic,工资总额和劳动福利基金。
public function getAllCTCCompensationData($postData)
{
$queryBuilder = $this->entityManager->createQueryBuilder();
$queryBuilder->select('ppp.payperiodSdesc, ppesa.grossPay, pptpp.pfEmployerContribution, pptpp.esiEmployerContribution, pplw.employercontribution')
->from(PyProcessEmpStatusApproved::class, 'ppesa')
->leftJoin(PyProcessTdsPfPt::class, 'pptpp', 'with', 'ppesa.ouCode = pptpp.ouCode')
->leftJoin(PyPayGroup::class, 'ppg', 'with', 'pptpp.pgCode = ppg.pgCode')
->leftJoin(PyProcessLabourWelfare::class, 'pplw', 'with', 'ppg.pgCode = pplw.pgCode')
->leftJoin(PyPayPeriod::class,'ppp','with','pplw.payperiodCode = ppp.payperiodCode')
->leftJoin(PyPayrollCalendar::class, 'ppc', 'with', 'ppp.paycalCode = ppc.paycalCode')
->where('ppesa.ouCode = ?1')
->andWhere('ppesa.langCode = ?2')
->setParameter('1', $postData['ouCode'])
->setParameter('2', $postData['langCode'])
->orderBy('ppesa.ouCode','DESC');
$compData = $queryBuilder->getQuery()->getResult();
return $compData;
}
这是控制器
public function addviewAction()
{
if ($this->sessionContainer->empId == "") {
return $this->redirect()->toRoute('admin_user_login');
}
if (!in_array('PY', $this->sessionContainer->arrRole)) {
if (!in_array('py_admin', $this->sessionContainer->arrRole)) {
return $this->redirect()->toRoute('dashboard_ess_index');
}
}
$postData = $this->getRequest()->getPost()->toArray();
$postData['ouCode'] = $this->sessionContainer->ouCode;
$postData['langCode'] = $this->sessionContainer->langCode;
$compData = $this->payrollspendManager->buildCTCCompensationData($ouCode,$langCode,$postData,);
$resultData = new ViewModel([
'reportData' => $compData,
// 'compensationSearch' => $groupSearch,
'arrLabels' => $this->arrLabels,
'processReportManager' => $this->processReportManager,
'postData' => $postData,
]);
$resultData->setTerminal(true);
return $resultData;
}
这是经理
public function buildCTCCompensationData($postData)
{
$compData = $this->getAllCTCCompensationData($postData);
return [
'detail' => $compData
];
}
public function getAllCTCCompensationData($postData)
{
$queryBuilder = $this->entityManager->createQueryBuilder();
$queryBuilder->select('ppp.payperiodSdesc, ppesa.grossPay, pptpp.pfEmployerContribution, pptpp.esiEmployerContribution, pplw.employercontribution')
->from(PyProcessEmpStatusApproved::class, 'ppesa')
->leftJoin(PyProcessTdsPfPt::class, 'pptpp', 'with', 'ppesa.ouCode = pptpp.ouCode')
->leftJoin(PyPayGroup::class, 'ppg', 'with', 'pptpp.pgCode = ppg.pgCode')
->leftJoin(PyProcessLabourWelfare::class, 'pplw', 'with', 'ppg.pgCode = pplw.pgCode')
->leftJoin(PyPayPeriod::class,'ppp','with','pplw.payperiodCode = ppp.payperiodCode')
->leftJoin(PyPayrollCalendar::class, 'ppc', 'with', 'ppp.paycalCode = ppc.paycalCode')
->where('ppesa.ouCode = ?1')
->andWhere('ppesa.langCode = ?2')
->setParameter('1', $postData['ouCode'])
->setParameter('2', $postData['langCode'])
->orderBy('ppesa.ouCode','DESC');
$compData = $queryBuilder->getQuery()->getResult();
}
这是我的PyProcessTdsPfPt实体
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
class PyProcessTdsPfPt
{
public $esiEmployerContribution;
public $pfEmployerContribution;
public $pfPensionFund;
}
Note:
ESIC = $esiEmployerContribution;
Provident fund total is $pfEmployerContribution + $pfPensionFund;
这是我的PyProcessEmpStatusApproved实体
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
class PyProcessEmpStatusApproved
{
public $grossPay;
}
注意:总工资= $ grossPay
这是PyProcessWelfare.php实体
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
class PyProcessLabourWelfare
{
public $employercontribution;
}
Note : labourwelfare fund = $employercontribution;
我想对总薪水,esic,常设基金和劳工基金建立模型函数,并将这四个函数相加,并使用总函数将结果显示在另一个基金中。 如果需要,任何文件都将提供代码。