Payroll
Introduction
The Payroll module is the operational core of Damsy ERP for workforce administration. It covers organizational masters, employee lifecycle, attendance integration, monthly salary processing, statutory filings, and management information reports. Most companies treat Payroll as the system of record for employees, units, and compensation.
Purpose
Payroll exists to let HR and finance teams:
- Maintain company, branch, client, and unit structure
- Manage employee records, increments, leave balances, and PF/ESI identifiers
- Run site-wise salary calculation and payment workflows
- Produce statutory returns and internal MIS through Crystal Reports
- Close employment through full-and-final settlement
When to Use
Use Payroll when you need to:
- Configure or update organizational masters before transactional work
- Process monthly salary for deployed staff at client units
- Generate PF, ESI, professional tax, or income tax outputs
- Reconcile attendance before payment
- Handle arrear, bonus, or bank upload payment batches
Payroll assumes masters (units, designations, banks) and often approved attendance from the Attendance module are in place before salary process runs.
Overview / Architecture
Payroll is an MVC Area (Areas/Payroll) with a modern sidebar layout. The dashboard aggregates KPIs through PayRollDashBoard_DAL, which calls stored procedures scoped by Session["CompID"] and the default payroll period (StartMonth / StartYear).
Entry URL: /Payroll/PayrollDashboard/Index
PageID: Payroll
Styles: payroll-modern.css, payroll-dashboard.css, sidebar-unified.css
Controllers
Feature groups are implemented as separate MVC controllers under Areas/Payroll/Controllers/.
Dashboard
| Controller | Primary responsibility |
|---|---|
| PayrollDashboard | Module home, KPI tiles, quick navigation |
Masters
| Controller | Primary responsibility |
|---|---|
| CompanyConfiguration | Company-level payroll settings |
| Branch | Branch master |
| Client | Client master |
| ClientSegmentMaster | Client segmentation |
| Unit | Unit / site master |
| UnitParameter | Unit-level parameters |
| Department | Department master |
| Designation | Designation master |
| Bank | Bank master |
| StateMaster | State reference data |
| HolidayMaster | Holiday calendar |
| MinimumWageMaster | Minimum wage tables |
| IncomeTaxSlab | Income tax slabs |
| ESIChallanGroup / ESIZoneMaster | ESI configuration |
| PFChallanGroup | PF challan grouping |
| RecruitmentFee / RecruitmentFeeMaster | Recruitment fee setup |
Employee
| Controller | Primary responsibility |
|---|---|
| Employee | Employee master CRUD |
| Search | Employee search |
| EmployeeIncrement | Increment processing |
| HRManagement | HR operations |
| SiteJoinLeaveProcess | Site join / leave |
| LeaveBalanceEntry | Leave balance maintenance |
| PFESIUANEntry | PF/ESI UAN entry |
| PFSettlementDetail | PF settlement |
| FullandFinalSettlement | Full and final |
| AWLLetter | AWL letter documents |
Process
| Controller | Primary responsibility |
|---|---|
| Attendance | Payroll-side attendance views |
| SalaryVerification | Pre-process verification |
| SalaryProcessPaymentStatus | Process and payment status |
| ArrearBonusProcess | Arrear and bonus runs |
| CreateCashPaid / CreateCashPaidBankUpload | Cash / bank payment |
| ExcelUploadForm | Bulk Excel uploads |
| UnitRateRevision | Unit rate revisions |
| ITaxComputation | Income tax computation |
| ProfessionalTax | Professional tax processing |
Reports
| Controller | Primary responsibility |
|---|---|
| PayRollMisReport | Internal payroll MIS (Crystal) |
| PayRollStatutoryReport | Statutory reports (Crystal) |
Views / Layout
| Asset | Location / role |
|---|---|
| Module layout | Areas/Payroll/Views/Shared/_LayoutPayroll.cshtml |
| Dashboard views | Areas/Payroll/Views/PayrollDashboard/ |
| Shared shell | _SidebarBrand, _SidebarMenuSearch (root Shared) |
| Report viewers | .aspx pages under Payroll Area linking .rpt files |
Pages render inside the flat topbar + sidebar shell used by other modern modules.
DAL
Payroll data access lives under DAL/Payroll/ and related employee namespaces. Representative classes:
| DAL class | Typical use |
|---|---|
| PayRollDashBoard_DAL | Dashboard KPIs and summary lists |
| Employee_DAL / EmployeeSearch_DAL | Employee CRUD and search |
| Process_DAL | Salary process operations |
| EmployeeAttendance_DAL | Attendance integration |
| CreateCashPaid_DAL / CreateBankTransfer_DAL | Payment disbursement |
| ITaxComputation_DAL | Tax computation |
| BranchMaster_DAL, Client_DAL, UnitMaster_DAL | Masters |
Each DAL method builds SqlParameter[] arrays and invokes stored procedures through BaseHelper using MyConnectionString.
Business Objects
Primary namespace: BO.Payroll
| BO type | Role |
|---|---|
| PayRollDashBoard_BO | Dashboard metrics |
| Employee_BO (via Employee domain) | Employee payload |
| UnitMaster_BO, Client_BO, BranchMaster_BO | Organizational masters |
| EmployeeAttendance_BO | Attendance rows |
| SalaryPaymentStatus_BO | Payment status tracking |
| CreateCashPaid_BO | Payment batch data |
Controllers populate BO instances with CompID from session before calling DAL methods.
Typical Workflow
Monthly payroll from attendance through payment:
Data Flow
- User selects company at login →
Session["CompID"]set. - Dashboard loads via
PayrollDashboardController→PayRollDashBoard_DAL→ read SPs filtered by company and period. - Process screens post form data into BO objects → write SPs (
InsertUpdate*, process SPs). - Reports read processed salary tables → Crystal viewer renders PDF/print output.
All writes are company-scoped; cross-company leakage is prevented at the SP layer when parameters include CompID.
Reports
| Report group | Delivery | Notes |
|---|---|---|
| PayRollMisReport | Crystal .aspx viewers | Internal analytics, unit-wise sheets |
| PayRollStatutoryReport | Crystal .aspx viewers | PF, ESI, PT, tax statutory outputs |
| Excel exports | ClosedXML (select screens) | Bulk downloads where implemented |
Crystal runtime 13.0.2000.0 must be installed on the application server.
Permissions
| Gate | Requirement |
|---|---|
| Module flag | dtVerifyUser.Payroll == true |
| Session | Valid CompID on every action |
| Menu permissions | GetDataUserPermissions for individual screens |
| Verification | Salary payment may require Verification approval |
if (string.IsNullOrEmpty(Convert.ToString(Session["CompID"])))
return RedirectToAction("UserLogin", "Login", new { Area = "" });
Common Issues
| Symptom | Likely cause |
|---|---|
| Empty dashboard tiles | Missing SP data or wrong payroll period in session |
| Salary process fails | Unapproved attendance or open verification batch |
| Crystal report error | CR runtime missing or .rpt not published |
| Employee not in list | Unit permission or inactive employee flag |
Related Pages
- Attendance
- Verification
- Contracted Rates
- Registration — shared
EmployeeM - Crystal Reports
- Stored Procedures
Important Notes
Root EmployeeMController opens from Payroll with Session["Module"] set. Registration uses the same controller with MID=Registration.
StartMonth and StartYear from login drive default filters. Confirm the period before running process screens.
Common Mistakes
| Mistake | Consequence |
|---|---|
| Running salary process before attendance approval | Incorrect payable days |
| Skipping verification when enabled | Payment blocked or non-compliant |
| Editing masters mid-process | Orphaned rate or unit references |
| Assuming menu visibility equals module flag | User may deep-link without menu rows |
Next Steps
- Confirm organizational masters for the target company.
- Validate attendance approval for the payroll month.
- Walk through verification (if enabled) before payment.
- Run statutory MIS on a test unit before company-wide close.