Implement Payslip Generation Feature
<UserStory> EMP009 : Generate Payslips </UserStory> <Changes> - Updated Payslip model to store employee, salary, and date details - Added payslip storage to DataStore and file load/save support - Added logic to generate payslips once per month per employee - Restricted payslip generation to finance role - Linked payslips to employees during load and creation - Added month, year, and day helpers to Timestamp - Added payslip generation option to Finance Executive menu </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "InputHelper.h"
|
||||
#include "OutputHelper.h"
|
||||
#include "MenuHelper.h"
|
||||
#include "Timestamp.h"
|
||||
|
||||
void FinanceExecutiveMenu::run()
|
||||
{
|
||||
@@ -13,7 +14,7 @@ void FinanceExecutiveMenu::run()
|
||||
{
|
||||
int choice;
|
||||
util::clear();
|
||||
std::cout << "Finance Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Resolve Ticket\n9. Generate Payslip\n10. Update Payroll\n11. Update Profile\n12. View Profile \n13. Logout\nEnter your Choice: ";
|
||||
std::cout << "Finance Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Resolve Ticket\n9. Generate Payslips\n10. Update Payroll\n11. Update Profile\n12. View Profile \n13. Logout\nEnter your Choice: ";
|
||||
util::read(choice);
|
||||
if (!handleOperation(choice))
|
||||
{
|
||||
@@ -51,6 +52,15 @@ void FinanceExecutiveMenu::updatePayroll()
|
||||
}
|
||||
}
|
||||
|
||||
void FinanceExecutiveMenu::generatePayslips()
|
||||
{
|
||||
util::Timestamp currentTimestamp;
|
||||
util::clear();
|
||||
m_zenvyController->generatePayslips();
|
||||
std::cout << "Generated payslips for the month of " << currentTimestamp.getMonth() << "-" << currentTimestamp.getYear() << " successfully.";
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
bool FinanceExecutiveMenu::handleOperation(int choice)
|
||||
{
|
||||
switch (choice)
|
||||
@@ -61,6 +71,9 @@ bool FinanceExecutiveMenu::handleOperation(int choice)
|
||||
case 5:
|
||||
searchEmployee(m_zenvyController);
|
||||
break;
|
||||
case 9:
|
||||
generatePayslips();
|
||||
break;
|
||||
case 10:
|
||||
updatePayroll();
|
||||
break;
|
||||
|
||||
@@ -14,5 +14,6 @@ public:
|
||||
void run();
|
||||
bool handleOperation(int);
|
||||
void updatePayroll();
|
||||
void generatePayslips();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user