Skip to content

Add dedicated payroll export screen with PDF and CSV support#403

Merged
Krisha190235 merged 3 commits into
mainfrom
dhruvi-0406/feature/payroll-export-clean
Jul 12, 2026
Merged

Add dedicated payroll export screen with PDF and CSV support#403
Krisha190235 merged 3 commits into
mainfrom
dhruvi-0406/feature/payroll-export-clean

Conversation

@dhruvi-0406

Copy link
Copy Markdown
Collaborator

Summary

  • Added a dedicated Payroll screen accessible from the Home screen header
  • Implemented payroll summary generation using selectable date ranges and payroll period types
  • Added CSV export support for payroll reports
  • Added PDF export support with native share and save functionality
  • Improved payroll export workflow for mobile devices by supporting PDF preview and file saving
  • Kept the implementation isolated to payroll-related functionality only
  • Removed unrelated modifications from previous implementation attempts

Testing

  • Verified navigation from Home screen to Payroll screen
  • Verified payroll summary generation using multiple date ranges
  • Verified PDF export generation and preview functionality
  • Verified PDF sharing and saving to Downloads/Google Drive
  • Verified CSV export functionality
  • Verified linting passes with no errors

Screenshots

Home Screen Payroll Header Icon

HomeScreen Payroll Header Icon

Payroll Screen Main UI

Payroll Screen Main UI

Payroll PDF Share Sheet

Payroll PDF Sharesheet

Payroll PDF Preview

Payroll PDF Preview

Payroll PDF Save To Downloads

Payroll PDF Save To Downloads

Payroll Export Success

Payroll Export Success

@Krisha190235

Krisha190235 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Hi, I going through open PRs as we move into T2 2026. This one's from T1 but the payroll export feature is genuinely useful, so I'd like to get it merged rather than close it. Just needs a few changes first, almost all in one file.
The payroll work itself — PayrollScreen.tsx and api/payroll.ts — is solid and correctly scoped (the backend already restricts /payroll to the requesting guard's own records). The issue is HomeScreen.tsx, which looks like it was based on an older copy and accidentally reverts several features that are now on main:

  • The t('home.…') i18n calls were replaced with hardcoded English ("Confirmed shifts", "Today's Earning", "Current Rating", etc.), which breaks the Hindi/Punjabi/Gujarati locales.
  • The guard-score integration was removed — the fetchGuardScore/getUserProfile imports and load block are gone, and the "Current Rating" card reverted from guardScore?.score to metrics.rating.
  • The Incident Reports button was removed from the header.
  • A "Test Notification" debug button (hardcoded to "Hospital Complex shift") was added — that shouldn't ship.

Cleanest fix: reset HomeScreen.tsx to main — git checkout main -- guard_app/src/screen/HomeScreen.tsx. Main already has the Payroll nav button, so nothing payroll-related is lost, and this restores all four items in one go. If you want the cash-outline icon swap, just re-apply that one line.

One more thing to fix: expo-print, expo-file-system, and expo-sharing are pinned at ^56, but the project is on Expo SDK 54 — that mismatch crashes the app on launch. Running npx expo install expo-print expo-file-system expo-sharing will repin them to SDK-54-compatible versions.

Once HomeScreen is reset and the deps are fixed, this is good to merge. Thanks for the work on this — the export flow is a nice addition.

@Krisha190235
Krisha190235 merged commit 4cb42c9 into main Jul 12, 2026
2 checks passed
@Krisha190235
Krisha190235 deleted the dhruvi-0406/feature/payroll-export-clean branch July 12, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants