Merge branch 'feature-employee-management' into feature-employee-management-emp011

This commit is contained in:
2026-04-16 14:47:25 +05:30
24 changed files with 318 additions and 60 deletions
@@ -42,6 +42,16 @@ std::shared_ptr<const Employee> ZenvyController::getCurrentEmployee()
return m_employeeManagementService->getCurrentEmployee();
}
bool ZenvyController::updateDesignation(const std::string& id,Enums::EmployeeDesignation designation)
{
return m_employeeManagementService->updateDesignation(id,designation);
}
std::vector<std::shared_ptr<Candidate>> ZenvyController::getShorlistedCandidates()
{
return m_employeeManagementService->getShorlistedCandidates();
}
//Payslip Management
void ZenvyController::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution)
{
@@ -66,3 +76,8 @@ void ZenvyController::persistStates()
m_payslipManagementService->savePayrolls();
m_payslipManagementService->savePayslips();
}
std::pair<std::shared_ptr<Payroll>, std::shared_ptr<Payslip>> ZenvyController::getPayslipForMonth(const std::string& employeeId, int year, int month)
{
return m_payslipManagementService->getPayslipForMonth(employeeId, year, month);
}
@@ -50,6 +50,8 @@ public:
std::shared_ptr<const Employee> getCurrentEmployee();
void updateProfile(const std::string&,const std::string&);
std::pair<Enums::EmployeeType, std::vector<std::shared_ptr<const Employee>>> searchEmployee(const std::string&);
bool updateDesignation(const std::string&,Enums::EmployeeDesignation);
std::vector<std::shared_ptr<Candidate>> getShorlistedCandidates();
template <typename ...Types>
Employees getEmployees(Types ...types)
@@ -60,6 +62,7 @@ public:
//Payslip management
void updateSalary(const std::string&, double, double, double, double, double);
void generatePayslips();
std::pair<std::shared_ptr<Payroll>, std::shared_ptr<Payslip>>getPayslipForMonth(const std::string&, int, int);
//File Management
void loadStates();
@@ -12,6 +12,11 @@ logMap& DataStore::getLogs()
return m_logs;
}
candidateMap& DataStore::getCandidates()
{
return m_candidates;
}
std::shared_ptr<Employee>& DataStore::getAuthenticatedEmployee()
{
return m_authenticatedEmployee;
@@ -25,6 +25,7 @@ using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
using payrollMap = std::map<std::string, std::shared_ptr<Payroll>>;
using payslipMap = std::map<std::string, std::shared_ptr<Payslip>>;
using logMap = std::map<util::Timestamp, std::shared_ptr<Log>>;
using candidateMap = std::map<std::string, std::shared_ptr<Candidate>>;
class DataStore
{
@@ -34,6 +35,7 @@ private:
payrollMap m_payrolls;
payslipMap m_payslips;
logMap m_logs;
candidateMap m_candidates;
DataStore() = default;
public:
static DataStore& getInstance();
@@ -45,6 +47,7 @@ public:
payrollMap& getPayrolls();
payslipMap& getPayslips();
logMap& getLogs();
candidateMap& getCandidates();
std::shared_ptr<Employee>& getAuthenticatedEmployee();
void setAuthenticatedEmployee(std::shared_ptr < Employee>);
};
@@ -12,7 +12,7 @@ const std::string& Candidate::getCandidateName() const
return m_name;
}
long int Candidate::getCandidatePhone() const
const std::string& Candidate::getCandidatePhone() const
{
return m_phone;
}
@@ -37,7 +37,7 @@ void Candidate::setCandidateName(const std::string& name)
m_name = name;
}
void Candidate::setCandidatePhone(long int phone)
void Candidate::setCandidatePhone(const std::string& phone)
{
m_phone = phone;
}
@@ -8,24 +8,24 @@ private:
static int m_uid;
std::string m_id;
std::string m_name;
long int m_phone;
std::string m_phone;
std::string m_qualification;
Enums::CandidateStatus m_status;
public:
Candidate() : m_id("CD" + std::to_string(++m_uid)), m_name(""), m_phone(0), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
Candidate() : m_id("CD" + std::to_string(++m_uid)), m_name(""), m_phone(""), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
Candidate(const std::string& name,
long int phone,
const std::string& phone,
const std::string& qualification,
Enums::CandidateStatus status)
: m_id("CD" + std::to_string(++m_uid)), m_name(name), m_phone(phone), m_qualification(qualification), m_status(status) {}
const std::string& getCandidateId() const;
const std::string& getCandidateName() const;
long int getCandidatePhone() const;
const std::string& getCandidatePhone() const;
const std::string& getCandidateQualification() const;
Enums::CandidateStatus getCandidateStatus() const;
void setCandidateId(const std::string& id);
void setCandidateName(const std::string& name);
void setCandidatePhone(long int phone);
void setCandidatePhone(const std::string& phone);
void setCandidateQualification(const std::string& qualification);
void setCandidateStatus(Enums::CandidateStatus status);
};
@@ -2,7 +2,7 @@
#include "GeneralEmployee.h"
#include "Factory.h"
Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
{
return m_designation;
}
@@ -19,7 +19,7 @@ Payroll::Payroll(const std::string& id,
m_houseRentAllowance(houseRentAllowance),
m_foodAllowance(foodAllowance),
m_employeePFContribution(employeePFContribution),
m_employerPFContribution(employerPFContribution)
m_employerPFContribution(employerPFContribution)
{
int idNumber = util::extractNumber(m_id);
if (idNumber > m_uid)
@@ -118,7 +118,6 @@ std::shared_ptr<Payroll> Payroll::deserialize(const std::string& record)
std::getline(serializedPayroll, foodAllowanceString, ',');
std::getline(serializedPayroll, employeePFString, ',');
std::getline(serializedPayroll, employerPFString, ',');
try
{
double basicSalary = std::stod(basicSalaryString);
@@ -145,4 +144,4 @@ std::shared_ptr<Payroll> Payroll::deserialize(const std::string& record)
std::string Payroll::getHeaders()
{
return "PayrollId,EmployeeId,BasicSalary,HouseRentAllowance,FoodAllowance,EmployeePFContribution,EmployerPFContribution";
}
}
@@ -1,6 +1,7 @@
#pragma once
#include <string>
#include <memory>
#include "Timestamp.h"
class Payroll
{
@@ -13,6 +14,7 @@ private:
double m_foodAllowance;
double m_employeePFContribution;
double m_employerPFContribution;
util::Timestamp m_timestamp;
public:
Payroll()
: m_id("PR" + std::to_string(++m_uid)),
@@ -131,6 +131,24 @@ bool EmployeeManagementService::deactivateEmployee(const std::string& id)
return true;
}
bool EmployeeManagementService::updateDesignation(const std::string& id, Enums::EmployeeDesignation designation)
{
auto& authenticatedEmployee = m_dataStore.getAuthenticatedEmployee();
util::enforceAuthorization(authenticatedEmployee->getEmployeeType(), Enums::EmployeeType::ADMIN, Enums::EmployeeType::HR);
std::map<std::string, std::shared_ptr<Employee>> employees = m_dataStore.getEmployees();
auto employeeIterator = employees.find(id);
if (employeeIterator == employees.end())
{
return false;
}
auto generalEmployee = std::dynamic_pointer_cast<GeneralEmployee>((*employeeIterator).second);
if (generalEmployee)
{
generalEmployee->setDesignation(designation);
}
return true;
}
std::shared_ptr<const Employee> EmployeeManagementService::getCurrentEmployee()
{
return m_dataStore.getAuthenticatedEmployee();
@@ -217,3 +235,17 @@ void EmployeeManagementService::saveEmployees()
employeeFileManager.save(employees);
generalEmployeeFileManager.save(generalEmployees);
}
std::vector<std::shared_ptr<Candidate>> EmployeeManagementService::getShorlistedCandidates()
{
candidateMap candidates = m_dataStore.getCandidates();
std::vector<std::shared_ptr<Candidate>> shortlistedCandidates;
for (auto& candidate : candidates)
{
if (candidate.second->getCandidateStatus() == Enums::CandidateStatus::SHORTLISTED)
{
shortlistedCandidates.push_back(candidate.second);
}
}
return shortlistedCandidates;
}
@@ -17,9 +17,11 @@ public:
EmployeeManagementService() : m_dataStore(DataStore::getInstance()) {};
void createEmployee(Enums::EmployeeType, Enums::EmployeeDesignation, const std::string&, const std::string&, const std::string&);
bool deactivateEmployee(const std::string&);
bool updateDesignation(const std::string&,Enums::EmployeeDesignation);
void updateProfile(const std::string&,const std::string&);
std::pair<Enums::EmployeeType, std::vector<std::shared_ptr<const Employee>>> searchEmployee(const std::string&);
std::shared_ptr<const Employee> getCurrentEmployee();
std::vector<std::shared_ptr<Candidate>> getShorlistedCandidates();
void loadEmployees();
void saveEmployees();
@@ -87,6 +87,29 @@ void PayslipManagementService::savePayrolls()
payrollFileManager.save(payrolls);
}
std::pair<std::shared_ptr<Payroll>, std::shared_ptr<Payslip>> PayslipManagementService::getPayslipForMonth(const std::string& employeeId, int year, int month)
{
auto& employees = m_dataStore.getEmployees();
auto employeeIterator = employees.find(employeeId);
if (employeeIterator == employees.end())
{
throw std::runtime_error("Employee not found!");
}
auto payroll = employeeIterator->second->getPayroll();
auto& payslips = employeeIterator->second->getEmployeePayslips();
for (const auto& payslipPair : payslips)
{
const auto& payslip = payslipPair.second;
{
if (payslip->getTimestamp().getYear() == year && payslip->getTimestamp().getMonth() == month)
{
return { payroll, payslip };
}
}
}
return { nullptr, nullptr };
}
void PayslipManagementService::loadPayslips()
{
FileManager<Payslip> payslipFileManager(Config::File::PAYSLIP_FILE);
@@ -13,8 +13,9 @@ public:
PayslipManagementService() : m_dataStore(DataStore::getInstance()) {};
void updateSalary(const std::string&, double, double, double, double, double);
void generatePayslips();
std::pair<std::shared_ptr<Payroll>, std::shared_ptr<Payslip>>getPayslipForMonth(const std::string&, int, int);
void loadPayrolls();
void savePayrolls();
void loadPayslips();
void savePayslips();
};
};
@@ -19,7 +19,8 @@ namespace Enums {
{
PENDING,
SHORTLISTED,
REJECTED
REJECTED,
HIRED
};
enum class NotificationStatus
@@ -13,7 +13,7 @@ void AdminMenu::run()
{
int choice;
util::clear();
std::cout << "Admin Menu\n1. Create User\n2. View Employees\n3. Deactivate Employee\n4. Search Employee\n5. Update Profile\n6. Logout\nEnter your Choice: ";
std::cout << "Admin Menu\n1. Create User\n2. View Employees\n3. Deactivate Employee\n4. Search Employee\n5. Update Profile\n6. Update Designation \n7. Add Shortlisted Candidate As Employee\n8. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
@@ -48,6 +48,12 @@ bool AdminMenu::handleOperation(int choice)
updateProfile(m_zenvyController);
break;
case 6:
updateDesignation(m_zenvyController);
break;
case 7:
addShortlistedCandidateAsEmployee(m_zenvyController);
break;
case 8:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
@@ -33,24 +33,12 @@ bool EmployeeMenu::handleOperation(int choice)
{
switch (choice)
{
/*case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;*/
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
/*case 4 :
m_zenvyController.raiseTicket();
break;
case 5 :
m_zenvyController.viewTicket();
break;
case 6:
m_zenvyController.viewTicketHistory();
break;*/
case 7:
viewEmployees(m_zenvyController);
break;
@@ -65,6 +65,9 @@ bool FinanceExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
@@ -13,7 +13,7 @@ void HRManagerMenu::run()
{
int choice;
util::clear();
std::cout << "HR Manager Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Create Employee\n9. Regularize Attendance\n10. Update Leave Request\n11. Register CandidateAsEmployee\n12. Update Profile\n13. Deactivate Employee\n14. View Profile\n15. Logout\nEnter your Choice: ";
std::cout << "HR Manager Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Create Employee\n9. Regularize Attendance\n10. Update Leave Request\n11. Update Profile\n12. Deactivate Employee\n13. View Profile\n14. Update Designation\n15. Add Shortlisted Candidate as Employee\n16. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
@@ -32,6 +32,9 @@ bool HRManagerMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
@@ -44,16 +47,22 @@ bool HRManagerMenu::handleOperation(int choice)
case 8:
createEmployee(m_zenvyController);
break;
case 12:
case 11:
updateProfile(m_zenvyController);
break;
case 13:
case 12:
deactivateEmployee(m_zenvyController);
break;
case 14:
case 13:
viewProfile(m_zenvyController);
break;
case 14:
updateDesignation(m_zenvyController);
break;
case 15:
addShortlistedCandidateAsEmployee(m_zenvyController);
break;
case 16:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
@@ -32,6 +32,9 @@ bool ITExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
@@ -30,12 +30,12 @@ static Enums::EmployeeType getEmployeeType(Enums::EmployeeType employeeType)
{ Enums::EmployeeType::TALENT_ACQUISITION, "Talent Executive" },
{ Enums::EmployeeType::GENERAL, "General Employee" }
};
auto it = employeeTypeOptions.find(employeeType);
if (it == employeeTypeOptions.end())
auto employeeOptionsIterator = employeeTypeOptions.find(employeeType);
if (employeeOptionsIterator == employeeTypeOptions.end())
{
throw std::runtime_error("You do not have the authority to create a new Employee!");
}
const auto& options = it->second;
const auto& options = employeeOptionsIterator->second;
std::cout << "Select Employee Type\n";
for (int index = 0; index < options.size(); ++index)
{
@@ -102,3 +102,101 @@ void createEmployee(std::shared_ptr<ZenvyController> controller)
std::cout << "\nCreated Employee Successfully.";
util::pressEnter();
}
void updateDesignation(std::shared_ptr<ZenvyController> m_zenvyController)
{
std::string selectedEmployeeId = selectEmployeeId(m_zenvyController->getEmployees(Enums::EmployeeType::GENERAL));
if (selectedEmployeeId.empty())
{
return;
}
Enums::EmployeeDesignation designation = getEmployeeDesignation();
if (m_zenvyController->updateDesignation(selectedEmployeeId, designation))
{
std::cout << "Assigned Employee Role Successfully\n";
util::pressEnter();
}
else
{
std::cout << "Employee not found\n";
util::pressEnter();
}
}
void displayCandidateDetails(const std::vector<std::shared_ptr<Candidate>>& shorlistedCandidates)
{
util::clear();
std::cout << std::left
<< std::setw(10) << "Index"
<< std::setw(10) << "ID"
<< std::setw(20) << "Name"
<< std::setw(15) << "Phone"
<< std::setw(15) << "Qualification"
<< std::setw(10) << "Status"
<< std::endl;
int index = 0;
for (auto& candidate : shorlistedCandidates)
{
std::cout << std::left
<< std::setw(10) << ++index
<< std::setw(10) << candidate->getCandidateId()
<< std::setw(20) << candidate->getCandidateName()
<< std::setw(15) << candidate->getCandidatePhone()
<< std::setw(15) << candidate->getCandidateQualification()
<< std::setw(10) << Enums::getCandidateStatusString(candidate->getCandidateStatus())
<< std::endl;
}
}
void addShortlistedCandidateAsEmployee(const std::shared_ptr<ZenvyController>& controller)
{
int index;
std::string name, email, phone;
util::clear();
std::vector<std::shared_ptr<Candidate>> shortlistedCandidates = controller->getShorlistedCandidates();
if (shortlistedCandidates.empty())
{
std::cout << "No candidates Found!";
util::pressEnter();
return;
}
displayCandidateDetails(shortlistedCandidates);
std::cout << "Enter the Index: ";
util::read(index);
auto currentEmployee = controller->getCurrentEmployee();
Enums::EmployeeType employeeType;
Enums::EmployeeDesignation employeeDesignation = Enums::EmployeeDesignation::INVALID;
if (index > 0 && index <= shortlistedCandidates.size())
{
employeeType = getEmployeeType(currentEmployee->getEmployeeType());
std::shared_ptr<Candidate> candidate = shortlistedCandidates[index - 1];
switch (employeeType)
{
case Enums::EmployeeType::INVALID:
std::cout << "Invalid Choice";
util::pressEnter();
return;
case Enums::EmployeeType::GENERAL:
employeeDesignation = getEmployeeDesignation();
if (employeeDesignation == Enums::EmployeeDesignation::INVALID)
{
std::cout << "Invalid Choice";
util::pressEnter();
return;
}
break;
}
std::cout << "Enter email: ";
util::read(email);
name = candidate->getCandidateName();
phone = candidate->getCandidatePhone();
controller->createEmployee(employeeType, employeeDesignation, email, name, phone);
candidate->setCandidateStatus(Enums::CandidateStatus::HIRED);
std::cout << "\nCreated Employee Successfully.";
util::pressEnter();
}
else
{
throw std::runtime_error("Enter a valid Index.");
}
}
+82 -26
View File
@@ -16,6 +16,7 @@
#include "Validator.h"
void createEmployee(std::shared_ptr<ZenvyController> controller);
void updateDesignation(std::shared_ptr<ZenvyController> m_zenvyController);
inline void viewPayslipHistory(std::shared_ptr<ZenvyController> controller)
{
@@ -87,6 +88,9 @@ inline void viewProfile(std::shared_ptr<ZenvyController> controller)
}
}
void displayCandidateDetails(const std::vector<std::shared_ptr<const Candidate>>& shorlistedCandidates);
void addShortlistedCandidateAsEmployee(const std::shared_ptr<ZenvyController>& controller);
inline void updateProfile(std::shared_ptr<ZenvyController> m_zenvyController)
{
int choice;
@@ -163,14 +167,28 @@ inline std::string selectEmployeeId(std::vector<std::shared_ptr<const Employee>>
<< std::setw(10) << "Index"
<< std::setw(15) << "Employee ID"
<< std::setw(20) << "Name"
<< std::setw(20) << "Employee Type" << std::endl;
<< std::setw(20) << "Employee Type"
<< std::setw(20) << "Employee Designation" << std::endl;
for (const auto& employee : employeeList)
{
std::cout << std::left << std::setw(10) << employee.first
auto generalEmployee = std::dynamic_pointer_cast<const GeneralEmployee>(employee.second);
std::cout << std::left
<< std::setw(10) << employee.first
<< std::setw(15) << employee.second->getId()
<< std::setw(20) << employee.second->getEmployeeName()
<< std::setw(20) << Enums::getEmployeeTypeString(employee.second->getEmployeeType())
<< std::endl;
<< std::setw(20) << Enums::getEmployeeTypeString(employee.second->getEmployeeType());
if (generalEmployee)
{
std::cout << std::left
<< std::setw(20) << Enums::getEmployeeDesignationString(generalEmployee->getDesignation())
<< std::endl;
}
else
{
std::cout << std::left
<< std::setw(20) << "NULL"
<< std::endl;
}
}
std::cout << "Enter the Index: ";
util::read(choice);
@@ -192,7 +210,7 @@ inline void deactivateEmployee(const std::shared_ptr<ZenvyController>& controlle
{
return;
}
if(controller->deactivateEmployee(selectedEmployeeId))
if (controller->deactivateEmployee(selectedEmployeeId))
{
std::cout << "Employee deactivated successfully\n";
util::pressEnter();
@@ -237,15 +255,15 @@ inline void viewEmployees(std::shared_ptr<ZenvyController> m_zenvyController)
util::pressEnter();
}
inline void searchEmployee(std::shared_ptr<ZenvyController>& m_zenvyController)
inline void searchEmployee(std::shared_ptr<ZenvyController> m_zenvyController)
{
std::string name;
util::clear();
std::cout << "Enter Employee Name: ";
util::read(name);
std::pair<Enums::EmployeeType, std::vector<std::shared_ptr<const Employee>>> searchResults = m_zenvyController->searchEmployee(name);
if (!(searchResults.second).empty())
{
std::string name;
util::clear();
std::cout << "Enter Employee Name: ";
util::read(name);
std::pair<Enums::EmployeeType, std::vector<std::shared_ptr<const Employee>>> searchResults = m_zenvyController->searchEmployee(name);
if (!(searchResults.second).empty())
{
std::cout << std::left
<< std::setw(10) << "ID"
<< std::setw(20) << "Name"
@@ -267,10 +285,10 @@ inline void searchEmployee(std::shared_ptr<ZenvyController>& m_zenvyController)
<< std::setw(15) << "HouseRentAllowance";
}
std::cout << std::endl;
for (const auto& employee : searchResults.second)
{
if (employee->getEmployeeAccountStatus() == Enums::AccountStatus::ACTIVE)
{
for (const auto& employee : searchResults.second)
{
if (employee->getEmployeeAccountStatus() == Enums::AccountStatus::ACTIVE)
{
std::cout << std::left
<< std::setw(10) << employee->getId()
<< std::setw(20) << employee->getEmployeeName()
@@ -286,8 +304,8 @@ inline void searchEmployee(std::shared_ptr<ZenvyController>& m_zenvyController)
{
std::cout << std::setw(15) << employee->getEmployeeTeamId();
}
if (searchResults.first == Enums::EmployeeType::FINANCE
|| searchResults.first == Enums::EmployeeType::HR
if (searchResults.first == Enums::EmployeeType::FINANCE
|| searchResults.first == Enums::EmployeeType::HR
|| searchResults.first == Enums::EmployeeType::ADMIN)
{
std::cout << std::left
@@ -299,12 +317,50 @@ inline void searchEmployee(std::shared_ptr<ZenvyController>& m_zenvyController)
<< std::setw(15) << employee->getPayroll()->getHouseRentAllowance();
}
std::cout << std::endl;
}
}
}
else
{
std::cout << "No Employee found with this name" << std::endl;
}
}
}
}
else
{
std::cout << "No Employee found with this name" << std::endl;
}
util::pressEnter();
}
inline void viewPayslip(std::shared_ptr<ZenvyController> controller)
{
int year, month;
util::clear();
std::cout << "Enter the year: ";
util::read(year);
std::cout << "Enter the month: ";
util::read(month);
auto employee = controller->getCurrentEmployee();
if (!employee)
{
std::cout << "No authenticated employee.\n";
util::pressEnter();
return;
}
auto result = controller->getPayslipForMonth(employee->getId(), year, month);
auto payroll = result.first;
auto payslip = result.second;
if (payroll && payslip)
{
util::clear();
std::cout << "Payslip for " << employee->getEmployeeName() << " (" << year << "-" << std::setw(2) << std::setfill('0') << month << ")\n\n";
std::cout << "Basic Salary : " << payroll->getBasicSalary() << "\n";
std::cout << "House Rent Allowance : " << payroll->getHouseRentAllowance() << "\n";
std::cout << "Food Allowance : " << payroll->getFoodAllowance() << "\n";
std::cout << "Employee PF Contribution : " << payroll->getEmployeePFContribution() << "\n";
std::cout << "Employer PF Contribution : " << payroll->getEmployerPFContribution() << "\n";
std::cout << "----------------------------------------\n";
std::cout << "Net Salary (after deductions): " << payslip->getSalary() << "\n";
std::cout << "Generated on: " << payslip->getTimestamp().toString() << "\n";
}
else
{
std::cout << "Payslip not available for " << year << "-" << month << ".\n";
}
util::pressEnter();
}
@@ -32,6 +32,9 @@ bool TalentExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
@@ -32,6 +32,9 @@ bool TeamExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;
@@ -32,6 +32,9 @@ bool TeamLeadMenu::handleOperation(int choice)
{
switch (choice)
{
case 2:
viewPayslip(m_zenvyController);
break;
case 3:
viewPayslipHistory(m_zenvyController);
break;