diff --git a/Areas/OTcalculate/Controllers/HodDashboardController.cs b/Areas/OTcalculate/Controllers/HodDashboardController.cs index 7491183..0f1f920 100644 --- a/Areas/OTcalculate/Controllers/HodDashboardController.cs +++ b/Areas/OTcalculate/Controllers/HodDashboardController.cs @@ -18,5 +18,9 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Controllers { return View(); } + public IActionResult OtReview() + { + return View(); + } } } diff --git a/Areas/OTcalculate/Services/OvertimePdfService.cs b/Areas/OTcalculate/Services/OvertimePdfService.cs index 1d3bd1c..97440c0 100644 --- a/Areas/OTcalculate/Services/OvertimePdfService.cs +++ b/Areas/OTcalculate/Services/OvertimePdfService.cs @@ -15,7 +15,7 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services int departmentId, string userFullName, string departmentName, - byte[]? logoImage = null // Optional logo image + byte[]? logoImage = null ) { records = records @@ -31,7 +31,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services page.Size(PageSizes.A4.Landscape()); page.Margin(30); - // Header section with logo and user info page.Content().Column(column => { column.Item().Row(row => @@ -103,7 +102,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services AddHeaderCell("Description", "#e3f2fd"); }); - // Data Rows // Data Rows double totalOTSum = 0; int totalBreakSum = 0; @@ -112,7 +110,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services if (!records.Any()) { - // Show message row if no records uint colspan = (uint)(departmentId == 2 ? 13 : 12); table.Cell().ColumnSpan(colspan) @@ -124,7 +121,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services .FontColor(Colors.Grey.Darken2) .Italic(); } - else { foreach (var r in records) @@ -165,7 +161,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services table.Cell().Background(rowBg).Border(0.25f).Padding(5).Text(r.OtDescription ?? "-").FontSize(9).WrapAnywhere().LineHeight(1.2f); } - // Totals Row var totalOTTimeSpan = TimeSpan.FromHours(totalOTSum); var totalBreakTimeSpan = TimeSpan.FromMinutes(totalBreakSum); @@ -196,7 +191,6 @@ namespace PSTW_CentralSystem.Areas.OTcalculate.Services return stream; } - private TimeSpan CalculateTotalOT(OtRegisterModel r) { TimeSpan office = (r.OfficeTo ?? TimeSpan.Zero) - (r.OfficeFrom ?? TimeSpan.Zero); diff --git a/Areas/OTcalculate/Views/HodDashboard/HodApproval.cshtml b/Areas/OTcalculate/Views/HodDashboard/HodApproval.cshtml index db6acb4..da357b1 100644 --- a/Areas/OTcalculate/Views/HodDashboard/HodApproval.cshtml +++ b/Areas/OTcalculate/Views/HodDashboard/HodApproval.cshtml @@ -2,16 +2,67 @@ ViewData["Title"] = "Overtime Approval"; Layout = "~/Views/Shared/_Layout.cshtml"; } -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -
| Name | +Submission Date | +Month/Year | +Action | +
|---|---|---|---|
| {{ submission.userName }} | +{{ formatDate(submission.submissionDate) }} | +{{ submission.monthYear }} | ++ |
| No overtime records submitted for review. | +|||
| {{ formatDate(record.otDate) }} | +{{ formatTime(record.officeFrom) }} | +{{ formatTime(record.officeTo) }} | +{{ record.officeBreak }} min | +{{ formatTime(record.outsideFrom) }} | +{{ formatTime(record.outsideTo) }} | +{{ record.outsideBreak }} min | +{{ formatHourMinute(calcTotalTime(record)) }} | +{{ calcBreakTotal(record) }} | +{{ formatHourMinute(calcNetHours(record)) }} | +{{ record.stationName || 'N/A' }} | +{{ record.otDays}} | +
+
+ {{ record.otDescription }}
+
+ |
+ + + + + + + - + | ++ + + | +
| No overtime records found for this user and period. | +||||||||||||||
| TOTAL | ++ | {{ formatHourMinute(totalHours) }} | +{{ formatHourMinute(totalBreak) }} | +{{ formatHourMinute(totalNetTime) }} | ++ | + | ||||||||