Review Fix: Handle Empty Payslip History
<SRS> SRS02: Employee Management </SRS> <Changes> - Enhanced viewPayslipHistory() in MenuHelper.h to handle empty payslip scenarios. - Displayed "No Payslips Generated" message when no records exist. </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -22,6 +22,12 @@ inline void viewPayslipHistory(std::shared_ptr<ZenvyController> controller)
|
||||
{
|
||||
auto employeePayslips = controller->getCurrentEmployee()->getEmployeePayslips();
|
||||
util::clear();
|
||||
if (employeePayslips.empty())
|
||||
{
|
||||
std::cout << "No Payslips Generated";
|
||||
util::pressEnter();
|
||||
return;
|
||||
}
|
||||
std::cout << "Payslips\n" << std::endl;
|
||||
std::cout << std::left
|
||||
<< std::setw(15) << "Date"
|
||||
|
||||
Reference in New Issue
Block a user