officelife
officelife copied to clipboard
employee modal - 500 error
Cant view employee modal - 500 error
When clicking in an employees to view or possibly add details i get this:
App\Helpers\HolidayHelper::getNumberOfDaysLeftToEarn(): Argument #1 ($ptoPolicy) must be of type App\Models\Company\CompanyPTOPolicy, null given,
C:\officelife-main\app\Helpers\HolidayHelper .php : 34
*/
public static function getHolidaysEarnedEachMonth(Employee $employee): float
{
return $employee->amount_of_allowed_holidays / 12;
}
/**
* Return the number of days that an employee will earn as holidays from
* today til the end of the year.
*
* @param CompanyPTOPolicy $ptoPolicy
* @param Employee $employee
*
* @return float
*/
LINE 34>> public static function getNumberOfDaysLeftToEarn(CompanyPTOPolicy $ptoPolicy, Employee $employee): float
{```