Compare commits

..

No commits in common. "Brac_devqc" and "dev_Chapal" have entirely different histories.

1482 changed files with 12499 additions and 37040 deletions

View File

@ -1,69 +0,0 @@
/*
AllowanceTypeToAllowanceDeduction_DB_Changes.sql
Moves the Allowance Type (EnumAllowanceType: 0 Non_Gross, 1 HouseRent, 2 Medical, 3 Conveynce, 4 Utilities_Other)
from the parameter (ADPARAMETERBASIC.allowanceType) to the allowance head
(AllowanceDeduction.AllowanceType).
Run this BEFORE deploying the matching code: the new code writes AllowanceDeduction.AllowanceType
and no longer writes ADPARAMETERBASIC.allowanceType.
Run order (inside this script): 1 add column -> 2 copy existing values -> 3 drop old column.
Step 2 must run before step 3, or the values are lost.
Every step is guarded, so the script is safe to run more than once.
*/
SET NOCOUNT ON;
GO
/* 1. Add AllowanceDeduction.AllowanceType */
IF COL_LENGTH('dbo.AllowanceDeduction', 'AllowanceType') IS NULL
BEGIN
ALTER TABLE dbo.AllowanceDeduction
ADD AllowanceType INT NOT NULL
CONSTRAINT DF_AllowanceDeduction_AllowanceType DEFAULT (0);
PRINT 'Added AllowanceDeduction.AllowanceType';
END
GO
/* 2. Copy the values already set on the parameters onto their allowance head.
An allowance with several parameters takes the highest non-zero value. */
IF COL_LENGTH('dbo.ADPARAMETERBASIC', 'allowanceType') IS NOT NULL
BEGIN
EXEC sp_executesql N'
UPDATE AD
SET AD.AllowanceType = X.AllowanceType
FROM dbo.AllowanceDeduction AD
JOIN (SELECT AllowDeductID, MAX(ISNULL(allowanceType, 0)) AS AllowanceType
FROM dbo.ADPARAMETERBASIC
GROUP BY AllowDeductID) X
ON X.AllowDeductID = AD.ALLOWDEDUCTID
WHERE AD.AllowanceType = 0
AND X.AllowanceType <> 0;';
PRINT 'Copied ADPARAMETERBASIC.allowanceType to AllowanceDeduction.AllowanceType';
END
GO
/* 3. Drop ADPARAMETERBASIC.allowanceType (its default constraint first, if any) */
IF COL_LENGTH('dbo.ADPARAMETERBASIC', 'allowanceType') IS NOT NULL
BEGIN
DECLARE @df SYSNAME, @sql NVARCHAR(MAX);
SELECT @df = dc.name
FROM sys.default_constraints dc
JOIN sys.columns c
ON c.object_id = dc.parent_object_id
AND c.column_id = dc.parent_column_id
WHERE dc.parent_object_id = OBJECT_ID('dbo.ADPARAMETERBASIC')
AND c.name = 'allowanceType';
IF @df IS NOT NULL
BEGIN
SET @sql = N'ALTER TABLE dbo.ADPARAMETERBASIC DROP CONSTRAINT ' + QUOTENAME(@df) + N';';
EXEC sp_executesql @sql;
END
ALTER TABLE dbo.ADPARAMETERBASIC DROP COLUMN allowanceType;
PRINT 'Dropped ADPARAMETERBASIC.allowanceType';
END
GO

118
CLAUDE.md
View File

@ -61,9 +61,7 @@ but several specifics are stale — prefer *this* file wherever the two disagree
at `e:\HRMGIT\` alongside a sibling `IntegrationSuite` project (this checkout is a single at `e:\HRMGIT\` alongside a sibling `IntegrationSuite` project (this checkout is a single
self-contained repo and no `IntegrationSuite` exists), lists `npm run lint` as a working command (it self-contained repo and no `IntegrationSuite` exists), lists `npm run lint` as a working command (it
is broken — see below), describes `Ease.Core` as "referenced as the `Ease.NetCore` NuGet package" is broken — see below), describes `Ease.Core` as "referenced as the `Ease.NetCore` NuGet package"
(the live one is the project in this repo), and counts "~250+" services (there are ~450 service classes, ~310 of them DI-registered), describes the UI (the live one is the project in this repo), and counts "~250+" services (there are ~450 service classes, ~310 of them DI-registered).
kit as a PrimeNG/Kendo/Bootstrap mix (PrimeNG and Bootstrap are gone), and gives an absolute
`https://localhost:44374/api` dev base URL (it is the relative `/api`, see *Frontend*).
## Build & run ## Build & run
@ -108,7 +106,7 @@ npm test # ng test (Karma, entry src/test.ts)
Both SPAs `ng serve` on 4200, so only one of the two can run at a time. Both SPAs `ng serve` on 4200, so only one of the two can run at a time.
- `npm run lint` is **broken**: `angular.json` still points at the `@angular-devkit/build-angular:tslint` - `npm run lint` is **broken**: `angular.json` still points at the `@angular-devkit/build-angular:tslint`
builder (with a `tslint.json`), which is not installed. `@angular-eslint/builder` and `eslint` 9 are builder (with a `tslint.json`), which no longer exists in Angular 19. The `@angular-eslint/*` and `eslint` 9 devDependencies are
installed, but there is no ESLint config file and no `@angular-eslint/builder:lint` target yet, so installed, but there is no ESLint config file and no `@angular-eslint/builder:lint` target yet, so
wiring ESLint up means adding both. wiring ESLint up means adding both.
- `npm test` works, but coverage is nominal — 18 `.spec.ts` files across the whole app. Single spec: - `npm test` works, but coverage is nominal — 18 `.spec.ts` files across the whole app. Single spec:
@ -119,9 +117,8 @@ Both SPAs `ng serve` on 4200, so only one of the two can run at a time.
[`deploy.ps1`](deploy.ps1) does the whole thing: bumps `HRM.UI/ClientApp/src/version.json` [`deploy.ps1`](deploy.ps1) does the whole thing: bumps `HRM.UI/ClientApp/src/version.json`
(`YYYYMMDD-NN`, counter auto-increments per day), runs `ng build --configuration production (`YYYYMMDD-NN`, counter auto-increments per day), runs `ng build --configuration production
--base-href <baseHref>`, `dotnet publish` for `win-x64` into `<outputFolder>_<version>`, copies --base-href <baseHref>`, `dotnet publish` for `win-x64`, copies `dist/babylon` into the publish
`dist/babylon` into its `wwwroot` and the whole `HRM.UI/RDLC` folder into its `RDLC` (publish alone copies folder's `wwwroot`, and writes an Angular `web.config` (SPA rewrites + no-cache for
only the RDLC files the csproj lists), and writes an Angular `web.config` (SPA rewrites + no-cache for
`index.html`/`version.json`). Edit `$baseHref`/`$outputFolder` at the top per client/environment `index.html`/`version.json`). Edit `$baseHref`/`$outputFolder` at the top per client/environment
before running. `VersionCheckService` (`ClientApp/src/app/version-check.service.ts`) polls before running. `VersionCheckService` (`ClientApp/src/app/version-check.service.ts`) polls
`version.json` every 5 minutes and prompts a reload when the server version changes — keep the `version.json` every 5 minutes and prompts a reload when the server version changes — keep the
@ -246,29 +243,6 @@ Every Excel interface in the app is served by the one
[DataUploadController](HRM.UI/Controllers/CommonInterface/DataUploadController.cs) (`api/dataUpload`) [DataUploadController](HRM.UI/Controllers/CommonInterface/DataUploadController.cs) (`api/dataUpload`)
— do not add a separate controller for a new uploader. — do not add a separate controller for a new uploader.
The older regular uploads (employee basic, life cycle, allowance, fund data, …; screen
`/common-interface/data-upload/:id`) all post to `regularExcelInterface`, and
`RegularDataUploadService.UploadData` switches on `EnumRegularDataUpload`. Their expected columns are declared
in `DataUploadColumnDefinationService` (file `BasicDataUploadProcessService.cs`), so a new column needs both:
declare it there and read it in the matching `Import…` method.
### Large lists: virtual paging
A list or report that can return many rows uses `<app-virtual-grid>` + `VirtualPagingDA.GetPage`: SQL Server
pages, searches, sorts and counts, and Export to Excel is streamed from the server. Follow the 4 steps in
[HRM.DA/DA/VirtualPaging/README.md](HRM.DA/DA/VirtualPaging/README.md) (worked examples: Discontinue Employee
Details, Employee Detail Information). Needs SQL Server 2016+.
### PF percentage is per employee
`SalaryCalculator.Process` calls `PFNEW()`, which takes the PF % from `Employee.PFPercentage`, not from
`SystemInformation` as the old `PF()` does (`PF()` is now used only by `ProcessLTA`). A Live PF member with no
percentage gets a PF of 0. The value is set through a life-cycle event (`EmpLifeCycle.PFPercentage`, copied to
`Employee` by `HREmployeeDA.UpdatePFPercentage`) or the employee / life-cycle uploads; the Logic key
`confirmation` / `autopfmembership` decides whether a confirmation also makes the employee a PF member.
**No `_DB_Changes.sql` adds these two columns**: without `EmpLifeCycle.PFPercentage` every life-cycle
insert/update fails, and without `Employee.PFPercentage` setting the percentage fails.
### Employee Bulk Upload ### Employee Bulk Upload
The whole information of many employees in one spreadsheet — one row per employee, carrying that The whole information of many employees in one spreadsheet — one row per employee, carrying that
@ -436,40 +410,6 @@ Two things to know before building on it:
effectively unused. The per-recipient rows are accurate throughout — it is the header that lags. effectively unused. The per-recipient rows are accurate throughout — it is the header that lags.
The UI compensates with a spinner, not with real numbers. The UI compensates with a spinner, not with real numbers.
### Cross-cutting: real-time (SignalR) and background jobs
One SignalR hub serves the whole app: `AppHub` at **`/api/hubs/app`** (`HRM.UI/Realtime/`, wired by
`services.AddRealtime(...)` + `endpoints.MapRealtime()` in `Startup`). Never add a second hub; tell features apart
by topic and group.
- **Auth** is the normal JWT: the hub is `[Authorize]` and the `JWToken` cookie is read by Startup's
`OnMessageReceived`, so the browser sends nothing extra (no token in the URL). It sits under `/api` so the dev
proxy (`proxy.json`, `"ws": true`) and IIS treat it like any API call. Production IIS should have the
**WebSocket Protocol** feature on (without it SignalR falls back to SSE/long polling and still works).
- **Groups are server-chosen** (`RealtimeGroups`): a connection joins its payroll type's group on connect and a
job's group only through `SubscribeJob`, which checks the caller. Clients never name a group.
- **Sending**: inject `IRealtimePublisher` (`ToUserAsync`, `ToPayrollTypeAsync`, `ToAllAsync`), never
`IHubContext`. Messages arrive in Angular through `RealtimeService.on(topic)`. The client methods are
`IAppClient.JobProgress` and `IAppClient.Event(topic, payload)`; prefer a new topic over a new method.
The hub uses the Newtonsoft protocol, so a BO serialises exactly as in the REST API.
- **Long work with live progress**: `IJobRunner.Start(new JobRequest { Key, Title, OwnerUserId, PayrollTypeId,
Audience, Work = progress => ... })` returns a `JobSnapshot` (`runId`) at once; the work runs on a hosted
service (Channel queue, `Realtime:MaxConcurrentJobs`), one job per `Key` at a time (a second start returns the
running one). The work reports through **`IJobProgress`** (`HRM.BO/BackgroundJob`), which is what HRM.DA
services take as a parameter — HRM.DA never references SignalR. Throttling, ETA and sequence numbers are done
by the runner. Copy everything the work needs from `CurrentUser` before starting: there is no HttpContext later.
- **Angular**: `RealtimeService` (`_services/realtime/`) is the single, lazy connection (auto-reconnect, closes on
logout, reconnects on a new token). `watchJob(runId)` follows a job and survives reloads, reconnects and a
missing connection (it re-reads `GET api/jobs/{runId}` / polls). `<app-job-progress [runId]>` from
`RealtimeSharedModule` is the reusable progress UI.
- Job state is **in memory** (`Realtime:FinishedJobRetentionMinutes`): a restart loses it, and more than one
server would need a Redis backplane plus a database job store. Settings: the optional `Realtime` section
(`RealtimeSettings`). Client package `@microsoft/signalr` is pinned to the server's major (10.0.x).
- Worked example: Salary Process — `SalaryController` `SalaryProcess-start` / `SalaryProcess-active`,
`SalaryProcessService.SalaryProcess(..., IJobProgress)` and `SalaryProcessProgress`, which maps
`SalaryCalculator`'s existing `ProgressStatus` events (13 phases, one step per employee) to a real percentage.
The old synchronous `SalaryProcess` endpoint is unchanged.
### Cross-cutting: approval workflow ### Cross-cutting: approval workflow
Most "apply → approve" features (leave, attendance regularization, claims, requisitions) route through Most "apply → approve" features (leave, attendance regularization, claims, requisitions) route through
@ -498,16 +438,16 @@ calendar's Users dropdown once came back silently empty for exactly this reason.
column: use the pattern in `CalendarItemDA.UserEmailExpression`, which checks `COL_LENGTH` once per process column: use the pattern in `CalendarItemDA.UserEmailExpression`, which checks `COL_LENGTH` once per process
and builds `COALESCE(EmailAddress, Email)` from whichever columns exist. Server-side SQL errors that the UI and builds `COALESCE(EmailAddress, Email)` from whichever columns exist. Server-side SQL errors that the UI
swallows land in `HRM.UI/Log/Error.log` (`ExceptionLog`), the first place to look. swallows land in `HRM.UI/Log/Error.log` (`ExceptionLog`), the first place to look.
Two places don't follow that pattern yet. `UserDA.Insert` and `Update` write only `Email`, so saving a user fails on a Two places don't follow that pattern yet. `UserDA.Insert` writes only `Email`, so creating a user fails on a
database that lacks it (the pending `UsersEmailColumn_DB_Changes.sql` adds it; its header wrongly says Insert database that lacks it (the pending `UsersEmailColumn_DB_Changes.sql` adds it; its header wrongly says Insert
writes both columns). `UserService.MapObject` writes both columns). `UserService.MapObject`
reads only `Email` (the `EmailAddress` line is commented out), so the user list's `email` is blank wherever reads only `Email` (the `EmailAddress` line is commented out), so the user list's `email` is blank wherever
addresses live in `EmailAddress`. addresses live in `EmailAddress`.
Gotcha in user approval: `UserDA.Approve` writes whatever `UserStatus` the client posts; the server works Gotcha in user approval: `UserDA.Approve` always sets `Status = Approved` (5), whatever the request was. So
nothing out. `users-list.component.ts` sends `Inactive` when approving a pending deactivation (status 9) and "approving" an `Inactive_Not_Yet_Approve` (9) or `Inactive` (8) user **re-activates** them, and a deactivation
`Approved` otherwise, and the "maker cannot approve their own change" check for users is only in that can never actually be approved. The user list labels that action "Re-activate" for this reason; the fix
component too. (Its comment saying the server always sets Approved is out of date.) belongs in the server.
### Authentication pages: maker-checker and audit log ### Authentication pages: maker-checker and audit log
@ -518,24 +458,6 @@ change is saved with an `EnumAuthStatus` (`HRM.BO/HRBasic/Enums.cs`) pending sta
`Approve` / `Reject`, `RoleService` for roles and permissions). Follow that state set for any new `Approve` / `Reject`, `RoleService` for roles and permissions). Follow that state set for any new
Authentication page rather than inventing a status column. Authentication page rather than inventing a status column.
**Super User IDs can be negative.** Test "has a user" / "was edited" as `!= 0`, never `> 0` (a role's maker is
`ModifiedBy` when it is not 0, else `CreatedBy`), in C# and in Angular alike. `AuthController.ValidateResetToken`
still checks `data.UserID <= 0`, so a reset link for a negative-ID Super User always reads as invalid.
### Login, OTP and forgot password
- **MFA** is on when `LDAPSettings.isMFA` is true (`MFATimer` = minutes); the code length and mail/SMS channel
are Logic keys under `mfa`. `login` then returns an `mfaSessionId`, and `verify-mfa` issues the token. The
challenge is held in **in-process memory**, so it does not survive a restart or a second server.
- `login`, `verify-mfa` and `resend-otp` are rate-limited per IP (`LoginPolicy` / `MfaPolicy` /
`ResendOtpPolicy` in `Startup`). The forgot-password endpoints are not.
- The OTP flow writes a trace to `C:\Log\OTP log <date>.txt`; `C:\Log` must exist on the server.
- **Forgot password** mails a link to `#/reset-password?token=…`. Nothing is stored: the token
(`HRM.UI/Helpers/PasswordResetTokenHelper.cs`) is AES-GCM encrypted with a key derived from
`AppSettings.Secret`, expires after `ForgotPasswordSettings.LinkExpiryMinutes`, and carries a fingerprint of
the current password, which makes it single-use. The link's base address is `EmailSettings.WebAddress`
(`http://localhost:4200/` in Development), so set that per deployment.
The **System Audit Log** page (`SystemAuditHistoryService`, `HRM.DA/DA/Users/SystemAuditHistoryDA.cs`) writes The **System Audit Log** page (`SystemAuditHistoryService`, `HRM.DA/DA/Users/SystemAuditHistoryDA.cs`) writes
nothing itself: it reads `Z_ROLE`, `Z_ROLEPERMISSION`, `Z_USERS`, `Z_USERROLE`, `Z_USERACCESSTYPE`, which nothing itself: it reads `Z_ROLE`, `Z_ROLEPERMISSION`, `Z_USERS`, `Z_USERROLE`, `Z_USERACCESSTYPE`, which
**database triggers** (`trRole`, `trRolePermission`, `trUsers`, `truserrole`, `trUserAccessType`) fill. Only **database triggers** (`trRole`, `trRolePermission`, `trUsers`, `truserrole`, `trUserAccessType`) fill. Only
@ -578,9 +500,7 @@ When behavior differs between clients, look for or add a Logic key rather than b
**This checkout is not that repo.** It is `HRM-10` (`origin` = `103.197.204.162:3025/CelHRTeam/HRM-10`), **This checkout is not that repo.** It is `HRM-10` (`origin` = `103.197.204.162:3025/CelHRTeam/HRM-10`),
a fresh import whose history starts at one squashed commit (`838b8d4` "first commit"). Since then it a fresh import whose history starts at one squashed commit (`838b8d4` "first commit"). Since then it
uses ordinary short-lived branches: `main` is the integration branch (PR target), with per-developer uses ordinary short-lived branches: `main` is the integration branch (PR target), with per-developer
branches (`dev_<name>`, `dev_<name>_<feature>`, `shamim`) merged back into it. Client branches have started here too: branches (`dev_<name>`, `dev_<name>_<feature>`, `shamim`) merged back into it.
`Brac_Master` (with `Brac_Master_<name>` developer branches) is ahead of `main`, so check which line a change
belongs to before choosing a PR target.
None of the older history exists here: every commit hash quoted elsewhere in this file (`c8588ce67`, None of the older history exists here: every commit hash quoted elsewhere in this file (`c8588ce67`,
`91369150c`, `ac179c03e`, `73f466cd0`, `bfd085e0e`) is from the original `CelHRTeam/cel.hrm` repo, and `91369150c`, `ac179c03e`, `73f466cd0`, `bfd085e0e`) is from the original `CelHRTeam/cel.hrm` repo, and
`git show`/`git log` recovery commands only work in a clone of that repo, not here. `git show`/`git log` recovery commands only work in a clone of that repo, not here.
@ -618,7 +538,7 @@ What actually drives the DB connection:
Other live sections: `AppSettings` (`Secret`, `DefaultDB`, `RDLCLocation`, `downloadFolder`, Other live sections: `AppSettings` (`Secret`, `DefaultDB`, `RDLCLocation`, `downloadFolder`,
attendance import settings), `EmailSettings`, `EmployeeApiInfo`, `AdminPendingJob`, attendance import settings), `EmailSettings`, `EmployeeApiInfo`, `AdminPendingJob`,
`MobileAppSettings`, `FundInfo`, `OpenAI`, `LDAPSettings`, `ForgotPasswordSettings`, `Calendar` (bound to `MobileAppSettings`, `FundInfo`, `OpenAI`, `LDAPSettings`, `Calendar` (bound to
`HRM.BO/Configuration/CalendarSettings.cs`), plus many payroll/fund GL-head keys. `HRM.BO/Configuration/CalendarSettings.cs`), plus many payroll/fund GL-head keys.
`Startup.cs` has large commented-out blocks — verify against live code before assuming a feature is `Startup.cs` has large commented-out blocks — verify against live code before assuming a feature is
@ -793,7 +713,6 @@ Four pieces decide where a page load actually lands, and they are easy to break
`/ess/landing-page`, `SuperUser` stays. So anything that lands on `''` ends up on a dashboard. `/ess/landing-page`, `SuperUser` stays. So anything that lands on `''` ends up on a dashboard.
- `AppMainComponent`'s constructor calls `authService.logout()` when the load is **not** a reload - `AppMainComponent`'s constructor calls `authService.logout()` when the load is **not** a reload
(`performance.navigation.type`), which is why opening a deep link in a fresh tab signs the user out. (`performance.navigation.type`), which is why opening a deep link in a fresh tab signs the user out.
The exception is `#/reset-password`: it logs out but stays on the page.
- `<app-login [hidden]="!isLoginForm()">` sits in - `<app-login [hidden]="!isLoginForm()">` sits in
[app.main.component.html](HRM.UI/ClientApp/src/app/app.main.component.html) — `[hidden]`, **not [app.main.component.html](HRM.UI/ClientApp/src/app/app.main.component.html) — `[hidden]`, **not
`*ngIf`**. So `LoginComponent`'s constructor runs once at bootstrap on *every* route, not just on `*ngIf`**. So `LoginComponent`'s constructor runs once at bootstrap on *every* route, not just on
@ -825,21 +744,6 @@ One trap it documents: custom properties declared on `:host` do **not** resolve
portals to the document root (`appendTo: 'root'` — dropdown/calendar popups). Use SCSS variables that portals to the document root (`appendTo: 'root'` — dropdown/calendar popups). Use SCSS variables that
compile to literals for those blocks, not `var(--…)`. compile to literals for those blocks, not `var(--…)`.
### GoHR theme (runtime, per deployment)
The app's colours and font are chosen **at runtime, per deployment**, not at build time.
`src/main.ts` calls `applyGoHrTheme()` ([src/app/gohr-theme/theme-loader.ts](HRM.UI/ClientApp/src/app/gohr-theme/theme-loader.ts)),
which reads `src/assets/gohr-theme/theme-settings.json`, `palettes.json` and `fonts.json` and writes the
chosen palette onto `:root` as `--gh-*` custom properties (derived hover/ring/menu shades and contrast text
included). Every themed rule lives in `src/styles/theme/gohr-theme.scss` and reads those variables; if a
JSON file is missing, the defaults compiled into that SCSS stay in place (the loader never throws).
- To change a deployment's look, edit only `theme-settings.json` (`palette`, `font`, `fontSize`, `menu`,
`topbar`, `background` — the file's `_help` block lists the allowed values). On a server that is
`wwwroot/assets/gohr-theme/theme-settings.json`; no rebuild, just a browser reload.
- In component styles use the `--gh-*` variables rather than hardcoded colours, so the screen follows the
palette. They are set on `:root`, so unlike `:host` properties they do resolve inside Kendo popups.
## Adding a feature: the full vertical slice ## Adding a feature: the full vertical slice
A typical feature commit touches, in order: A typical feature commit touches, in order:

View File

@ -194,7 +194,6 @@ namespace HRM.BO
public bool IsTaxProjection { get; set; } public bool IsTaxProjection { get; set; }
public bool IsDependsOnAttendance { get; set; } public bool IsDependsOnAttendance { get; set; }
public bool ISDEPENDSONSPECIALHOUR { get; set; } public bool ISDEPENDSONSPECIALHOUR { get; set; }
public bool IsOnBalancing { get; set; }
public bool IsDependsOnOTHour { get; set; } public bool IsDependsOnOTHour { get; set; }
public bool IsWithException { get; set; } public bool IsWithException { get; set; }
public EnumPeriodicity Periodicity { get; set; } public EnumPeriodicity Periodicity { get; set; }

View File

@ -65,10 +65,6 @@ namespace HRM.BO
public int Approvedby { get; set; } public int Approvedby { get; set; }
public DateTime ApprovedDate { get; set; } public DateTime ApprovedDate { get; set; }
public EnumAuthStatus ApprovalStatus { get; set; } public EnumAuthStatus ApprovalStatus { get; set; }
public EnumAllowanceType AllowanceType { get; set; }
public bool IsOnBalancing { get; set; }
public double GetAmount(double basicSalary, double grossSalary) public double GetAmount(double basicSalary, double grossSalary)
{ {
if (this.ValueType == EnumValueType.Amount) return this.MonthlyAmount; if (this.ValueType == EnumValueType.Amount) return this.MonthlyAmount;

View File

@ -16,7 +16,6 @@ namespace HRM.BO
Name = string.Empty; Name = string.Empty;
NameInBangla = string.Empty; NameInBangla = string.Empty;
AllowOrDeductType = EnumAllowOrDeduct.Allowance; AllowOrDeductType = EnumAllowOrDeduct.Allowance;
AllowanceType = EnumAllowanceType.Non_Gross;
_status = EnumStatus.Active; _status = EnumStatus.Active;
} }
@ -28,7 +27,6 @@ namespace HRM.BO
public string Name { get; set; } public string Name { get; set; }
public string NameInBangla { get; set; } public string NameInBangla { get; set; }
public EnumAllowOrDeduct AllowOrDeductType { get; set; } public EnumAllowOrDeduct AllowOrDeductType { get; set; }
public EnumAllowanceType AllowanceType { get; set; }
public int payrolltypeid { get; set; } public int payrolltypeid { get; set; }
//#region Property Error List: DataUpload //#region Property Error List: DataUpload

View File

@ -1,137 +1,43 @@
using Ease.Core.Model; using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO namespace HRM.BO
{ {
public class ComponentUploadSetup : BasicBaseObject public class ComponentUploadSetup : BasicBaseObject
{ {
#region Constructor #region Constructor
public ComponentUploadSetup() public ComponentUploadSetup()
{ {
_isDamageManagement = false; EmployeeID = 0;
ItemID = 0;
Description = string.Empty;
} }
#endregion #endregion
#region Properties #region Properties
#region EmployeeID public int EmployeeID { get; set; }
private int _employeeID; public EnumComponentType ComponentType { get; set; }
public int EmployeeID public int ItemID { get; set; }
{ public string Description { get; set; }
get { return _employeeID; }
set { _employeeID = value; }
}
#endregion
#region EmployeeName
private string _employeeName;
public string EmployeeName
{
get { return _employeeName; }
set { _employeeName = value; }
}
#endregion
#region ApproverID
private int _approverID;
public int ApproverID
{
get { return _approverID; }
set { _approverID = value; }
}
#endregion
#region ApproverName
private string _approverName;
public string ApproverName
{
get { return _approverName; }
set { _approverName = value; }
}
#endregion
#region ComponentType
private EnumComponentType _componentType;
public EnumComponentType ComponentType
{
get { return _componentType; }
set { _componentType = value; }
}
#endregion
#region ItemID
private int _itemID;
public int ItemID
{
get { return _itemID; }
set { _itemID = value; }
}
#endregion
#region Description
private string _description;
public string Description
{
get { return _description; }
set { _description = value; }
}
#endregion
#region IsDamageManagement
private bool _isDamageManagement;
public bool IsDamageManagement
{
get { return _isDamageManagement; }
set { _isDamageManagement = value; }
}
#endregion
#region DamageManagementDescription
private string _damageManagementDescription;
public string DamageManagementDescription
{
get { return _damageManagementDescription; }
set { _damageManagementDescription = value; }
}
#endregion
#region ComponentTypeName
private string _componentTypeName;
public string ComponentTypeName
{
get { return _componentTypeName; }
set { _componentTypeName = value; }
}
#endregion
#endregion #endregion
#region Service Factory //#region Service Factory
internal static IComponentUploadSetupService Service //internal static IComponentUploadSetupService Service
{ //{
get { return Services.Factory.CreateService<IComponentUploadSetupService>(typeof(IComponentUploadSetupService)); } // get { return Services.Factory.CreateService<IComponentUploadSetupService>(typeof(IComponentUploadSetupService)); }
} //}
#endregion //#endregion
} }
public interface IComponentUploadSetupService public interface IComponentUploadSetupService
{ {
List<ComponentUploadSetup> Get(); List<ComponentUploadSetup> Get();
DataTable GetUploadedComponent(DateTime uploadMonth);
List<ComponentUploadSetup> Get(int empId); List<ComponentUploadSetup> Get(int empId);
List<ComponentUploadSetup> GetByApproverID(int apprvrID); int Save(ComponentUploadSetup componentSetup);
DataTable GetUploadedComponentReportData(DateTime fromDate, DateTime toDate);
DataTable GetUploadedComponentEmpReportData(DateTime uploadMonth, int componentId, string empIds);
void Save(List<ComponentUploadSetup> componentSetups);
void Delete(int id); void Delete(int id);
void DeleteSingleComponent(ComponentUploadSetup oComponentUploadSetup); bool IsExist(int empId, EnumComponentType ComponentType, int itemId);
DataTable GetUploadedComponentEmpReportData(DateTime salaryMonth, string empIds);
List<ComponentUploadSetup> LoadComponentType(int payrollTypeID);
bool IsExist(int empId, int apprvrId, EnumComponentType componentType, int itemId);
bool HasApproverSetup(int approverId);
bool HasUploaderSetup(int employeeId);
} }
} }

View File

@ -1,247 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HRM.BO
{
public class UploadedComponent : BasicBaseObject
{
#region Constructor
public UploadedComponent() { }
#endregion
#region Properties
#region IsDamageManagement
private bool _isDamageManagement;
public bool IsDamageManagement
{
get { return _isDamageManagement; }
set { _isDamageManagement = value; }
}
#endregion
#region SalaryMonth
private DateTime _salaryMonth;
public DateTime SalaryMonth
{
get { return _salaryMonth; }
set { _salaryMonth = value; }
}
#endregion
#region UploadedBy
private int _uploadedBy;
public int UploadedBy
{
get { return _uploadedBy; }
set { _uploadedBy = value; }
}
#endregion
#region UploadedDate
private DateTime _uploadedDate;
public DateTime UploadedDate
{
get { return _uploadedDate; }
set { _uploadedDate = value; }
}
#endregion
#region ItemID
private int _approvedBy;
public int? ApprovedBy
{
get { return _approvedBy; }
set { _approvedBy = (int)value; }
}
#endregion
#region ApprovedDate
private DateTime _approvedDate;
public DateTime ApprovedDate
{
get { return _approvedDate; }
set { _approvedDate = value; }
}
#endregion
private int _componentID;
#region ComponentID
public int ComponentID
{
get { return _componentID; }
set { _componentID = value; }
}
#endregion
#region ComponentType
private EnumComponentType _componentType;
public EnumComponentType ComponentType
{
get { return _componentType; }
set { _componentType = value; }
}
#endregion
#region UploadedComponentEmps
private List<UploadedComponentEmp> _uploadedComponentEmps;
public List<UploadedComponentEmp> UploadedComponentEmps
{
get
{
//if (this.ID > 0 && _uploadedComponentEmps == null)
//{
// _uploadedComponentEmps = UploadedComponent.Service.GetUploadedComponentEmp(this.ID);
//}
return _uploadedComponentEmps;
}
set
{
_uploadedComponentEmps = value;
}
}
#endregion
#endregion
}
#region UploadedComponentEmp
[Serializable]
public class UploadedComponentEmp : BasicBaseObject
{
#region ctr
public UploadedComponentEmp() { }
#endregion
#region Properties
#region UploadedComponentID
private int _uploadedComponentID;
public int UploadedComponentID
{
get { return _uploadedComponentID; }
set { _uploadedComponentID = value; }
}
#endregion
#region EmployeeID
private int _employeeID;
public int EmployeeID
{
get { return _employeeID; }
set { _employeeID = value; }
}
#endregion
#region Amount
private double _amount;
public double Amount
{
get { return _amount; }
set { _amount = value; }
}
#endregion
#region Reason
private string _reason;
public string Reason
{
get { return _reason; }
set { _reason = value; }
}
#endregion
#region TotalAmount
private double _totalAmount;
public double TotalAmount
{
get { return _totalAmount; }
set { _totalAmount = value; }
}
#endregion
#region DeductionMonth
private DateTime _deductionMonth;
public DateTime DeductionMonth
{
get { return _deductionMonth; }
set { _deductionMonth = value; }
}
#endregion
#region DeductionAmount
private double _deductionAmount;
public double DeductionAmount
{
get { return _deductionAmount; }
set { _deductionAmount = value; }
}
#endregion
#region Remarks
private string _remarks;
public string Remarks
{
get { return _remarks; }
set { _remarks = value; }
}
#endregion
#region No of installment
private int _nOfInstallment;
public int NoOfInstallment
{
get { return _nOfInstallment; }
set { _nOfInstallment = value; }
}
#endregion
#endregion
}
#endregion
public interface IUploadedComponentService
{
void Save(UploadedComponent component);
void SaveWithADParameter(UploadedComponent component, DateTime salaryMonth);
List<UploadedComponent> Get(DateTime fromDate, DateTime toDate);
List<UploadedComponentEmp> GetUploadedComponentEmp(int iD);
List<UploadedComponent> Get(int componentId, int uploaderID, DateTime salaryMonth);
List<UploadedComponent> Get(int uploaderID, DateTime salaryMonth);
DataTable GetByID(int uploadedComponentID);
DataTable GetByIDandUploaderID(int uploadedComponentID, int uploaderId);
void Delete(int uploadedComponentID);
void DeleteUploadedComponentEmp(int uploadedComponentID);
UploadedComponent GetExistingComponent(int uploaderID, int componentID, EnumComponentType componentType, DateTime salaryMonth);
List<UploadedComponent> GetByApprover(int approverID, DateTime salaryMonth);
List<UploadedComponent> GetByApprover(int approverID);
DataTable GetByUploaderDT(int employeeID);
}
}

View File

@ -1,79 +0,0 @@
using System;
using System.Threading;
namespace HRM.BO
{
/// <summary>
/// How a long-running piece of work (salary process, bulk upload, ...) tells the outside world how far it got.
///
/// It lives in HRM.BO on purpose: HRM.DA services take it as a plain parameter and never know who listens.
/// HRM.UI implements it (background job runner + SignalR), so HRM.DA keeps no reference to ASP.NET or SignalR.
/// Every member is safe to call as often as you like - the implementation throttles what it actually sends.
/// A null IJobProgress means "nobody is listening": callers must check for null (or use TryReport below).
/// </summary>
public interface IJobProgress
{
/// <summary>Set when the application is shutting down or the job was cancelled. Work may check it between steps.</summary>
CancellationToken CancellationToken { get; }
/// <summary>
/// Reports where the work is.
/// </summary>
/// <param name="percent">0 - 100 of the whole job. Values out of range are clamped; it never goes backwards.</param>
/// <param name="stage">Short name of the current stage, e.g. "Calculating Income Tax". Null keeps the previous one.</param>
/// <param name="detail">Optional extra line, e.g. an employee name. Null clears it.</param>
/// <param name="current">Optional items done in the current stage (shown as current / total).</param>
/// <param name="total">Optional items in the current stage.</param>
void Report(double percent, string stage = null, string detail = null, int? current = null, int? total = null);
}
public static class JobProgressExtensions
{
/// <summary>
/// Null-safe AND exception-safe Report. Business code (salary process, uploads, ...) must report through this:
/// progress only watches the work, so a fault in reporting must never be able to stop or change the work.
/// </summary>
public static void TryReport(this IJobProgress progress, double percent, string stage = null, string detail = null,
int? current = null, int? total = null)
{
if (progress == null)
return;
try
{
progress.Report(percent, stage, detail, current, total);
}
catch
{
// progress is best-effort; the work goes on regardless
}
}
}
/// <summary>
/// Maps a sub-task's own 0 - 100 onto a slice [from, to] of an outer job's bar. Lets a service report its
/// own progress (e.g. the salary save, 0 - 100) without knowing which part of the whole job it is.
/// </summary>
public sealed class JobProgressScope : IJobProgress
{
private readonly IJobProgress _outer;
private readonly double _from;
private readonly double _to;
public JobProgressScope(IJobProgress outer, double from, double to)
{
_outer = outer;
_from = Math.Max(0, Math.Min(100, from));
_to = Math.Max(_from, Math.Min(100, to));
}
public CancellationToken CancellationToken => _outer != null ? _outer.CancellationToken : CancellationToken.None;
public void Report(double percent, string stage = null, string detail = null, int? current = null, int? total = null)
{
if (_outer == null)
return;
double p = Math.Max(0, Math.Min(100, percent));
_outer.Report(_from + (_to - _from) * p / 100.0, stage, detail, current, total);
}
}
}

View File

@ -72,17 +72,6 @@ namespace HRM.BO
#endregion #endregion
#region ReligionIDs / ReligionNames : string (BonusReligion, not Bonus columns)
// Comma-separated ReligionIDs of this bonus (table BonusReligion).
// null = not loaded: Save leaves the BonusReligion rows untouched.
public string ReligionIDs { get; set; }
// Comma-separated religion names, for display only.
public string ReligionNames { get; set; }
#endregion
//#region Service Factory IBonusService : IBonusService //#region Service Factory IBonusService : IBonusService
@ -210,8 +199,6 @@ namespace HRM.BO
List<Bonus> GetAllBonus(int payrollTypeID, EnumStatus status, string code, string name); List<Bonus> GetAllBonus(int payrollTypeID, EnumStatus status, string code, string name);
DataSet GetCCWiseBonusSummary(DateTime bMonthDate, string bonus); DataSet GetCCWiseBonusSummary(DateTime bMonthDate, string bonus);
DataSet GetCCWiseBonus(DateTime bMonthDate, string bonus); DataSet GetCCWiseBonus(DateTime bMonthDate, string bonus);
List<Religion> GetReligions(int bonusID);
List<int> GetReligionEmployeeIDs(int bonusID, int payrollTypeID);
} }
#endregion #endregion

View File

@ -1,18 +0,0 @@
namespace HRM.BO.Configuration
{
/// <summary>
/// "ForgotPasswordSettings" section of appsettings.json.
/// </summary>
public class ForgotPasswordSettings
{
public const int DefaultLinkExpiryMinutes = 10;
// How long the password reset link stays valid (minutes). Missing / 0 / negative = DefaultLinkExpiryMinutes.
public int LinkExpiryMinutes { get; set; } = DefaultLinkExpiryMinutes;
public int GetLinkExpiryMinutes()
{
return LinkExpiryMinutes > 0 ? LinkExpiryMinutes : DefaultLinkExpiryMinutes;
}
}
}

View File

@ -123,7 +123,6 @@ namespace HRM.BO
public bool IsShownInTaxSheet { get; set; } // R public bool IsShownInTaxSheet { get; set; } // R
public EnumPFMembershipType PFMemberType { get; set; } public EnumPFMembershipType PFMemberType { get; set; }
public DateTime? PFMemberShiptDate { get; set; } public DateTime? PFMemberShiptDate { get; set; }
public double PFPercentage { get; set; }
public int? BranchID { get; set; } public int? BranchID { get; set; }
public string AccountNo { get; set; } public string AccountNo { get; set; }
public int? OutPayBranchID { get; set; } public int? OutPayBranchID { get; set; }
@ -514,7 +513,6 @@ namespace HRM.BO
List<Employee> GetForSuperUser(); List<Employee> GetForSuperUser();
Employee GetByCardID(int id); Employee GetByCardID(int id);
Employee Get(string emloyeeNo, int payrollTypeID); Employee Get(string emloyeeNo, int payrollTypeID);
Employee GetByEmpNo(string EmpNo);
Employee GetFromAll(string emloyeeNo, int payrollTypeID); Employee GetFromAll(string emloyeeNo, int payrollTypeID);
Employee GetwitoutchekPayrolltype(String employeeNo); Employee GetwitoutchekPayrolltype(String employeeNo);
Employee GetParentEmployee(int employeeID); Employee GetParentEmployee(int employeeID);

View File

@ -1961,15 +1961,6 @@ namespace HRM.BO
Individual = 2 Individual = 2
} }
public enum EnumAllowanceType
{
Non_Gross = 0,
HouseRent = 1,
Medical = 2,
Conveynce = 3,
Utilities_Other=4
}
public enum EnumPFTranType public enum EnumPFTranType
{ {
@ -2449,9 +2440,7 @@ namespace HRM.BO
ITReport177Yearly = 1005, ITReport177Yearly = 1005,
TAXReconciliation = 1006, TAXReconciliation = 1006,
BasePay = 1008, BasePay = 1008,
ITReport177Quaterly = 1010, ITReport177Quaterly = 1010
ComponentUploadReport = 1021,
LFABankAdvice = 1201
} }
@ -2567,7 +2556,6 @@ namespace HRM.BO
Objective = 62, Objective = 62,
SecondLineManagerObjectiveRating = 63, SecondLineManagerObjectiveRating = 63,
CVUpload = 64, CVUpload = 64,
EssComponentUpload = 66,
EmployeeLineManagerUpload = 200, EmployeeLineManagerUpload = 200,
CoordinatorUpload = 201, CoordinatorUpload = 201,
TaxAdjustmentDataUpload = 203, TaxAdjustmentDataUpload = 203,

View File

@ -168,14 +168,6 @@ namespace HRM.BO
} }
} }
#endregion #endregion
#region PFPercentage : double
private double? _pFPercentage;
public double? PFPercentage
{
get { return _pFPercentage; }
set { _pFPercentage = value; }
}
#endregion
#region EmployeeID : ID #region EmployeeID : ID
private int _employeeID; private int _employeeID;
public int EmployeeID public int EmployeeID
@ -585,7 +577,6 @@ namespace HRM.BO
List<EmpLifeCycle> GetEmpID(int nEmpID, DateTime effectDate); List<EmpLifeCycle> GetEmpID(int nEmpID, DateTime effectDate);
EmpLifeCycle GetLastPosition(int nEmpID); EmpLifeCycle GetLastPosition(int nEmpID);
void UpdateApprovalStatus(List<EmpLifeCycle> oEmpLifeCycles, int currentPayrollTypeID); void UpdateApprovalStatus(List<EmpLifeCycle> oEmpLifeCycles, int currentPayrollTypeID);
bool IsAutoPFMembership();
int Save(EmpLifeCycle item, DateTime nextPayProcessDate, int payrollTypeID); int Save(EmpLifeCycle item, DateTime nextPayProcessDate, int payrollTypeID);
int Save(List<EmpLifeCycle> items, DateTime nextPayProcessDate); int Save(List<EmpLifeCycle> items, DateTime nextPayProcessDate);
void Delete(EmpLifeCycle item, DateTime nextPayProcessDate); void Delete(EmpLifeCycle item, DateTime nextPayProcessDate);

View File

@ -1,173 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace HRM.BO
{
#region LFAPayment
/// <summary>One Leave Fare Assistance payment batch (dbo.LFAPayment), as SalaryProcess is for the salary.</summary>
public class LFAPayment : AuditTrailBase, IworkflowInterface
{
public LFAPayment()
{
BatchNumber = string.Empty;
Details = new List<LFAPaymentDetail>();
}
public string BatchNumber { get; set; }
public int PayrollTypeID { get; set; }
/// <summary>The last date of the month of PAYROLLTYPE.NEXTPAYPROCESSDATE.</summary>
public DateTime SalaryMonth { get; set; }
/// <summary>The last date of the calendar year the LFA is for.</summary>
public DateTime LFAYear { get; set; }
public DateTime PaymentDate { get; set; }
public string Remarks { get; set; }
public bool IsTaxUpdated { get; set; }
/// <summary>Null = not submitted yet, as SalaryProcess.WFStatus.</summary>
public enumwfStatus? WFStatus { get; set; }
public int? ApprovedBy { get; set; }
public DateTime? ApprovedDate { get; set; }
public List<LFAPaymentDetail> Details { get; set; }
#region IworkflowInterface Members
public string ObjectDescription
{
get { return "LFA payment batch " + BatchNumber; }
}
/// <summary>The workflow type (WFTYPE 33), as SalaryProcess returns 30.</summary>
public int SetupID
{
get { return LFAPaymentApproval.WFTypeID; }
}
public int ObjectID
{
get { return this.ID; }
}
#endregion
}
#endregion
#region LFAPaymentDetail
/// <summary>One employee of a batch (dbo.LFAPaymentDetail): a snapshot of the employee and of the calculation.</summary>
public class LFAPaymentDetail : AuditTrailBase
{
public int LFAPaymentID { get; set; }
public int EmployeeID { get; set; }
public DateTime LFAYear { get; set; }
public DateTime JoiningDate { get; set; }
public DateTime? ConfirmationDate { get; set; }
public int? GradeID { get; set; }
public int? DesignationID { get; set; }
public int? DepartmentID { get; set; }
public int? CostCenterID { get; set; }
public int? BranchID { get; set; }
public string AccountNo { get; set; }
public double? JoiningBasic { get; set; }
/// <summary>Basic as of 31 December of the preceding year; null when the employee joined in the LFA year.</summary>
public double? LastDecBasic { get; set; }
/// <summary>The basic the LFA was calculated on.</summary>
public double BasicSalary { get; set; }
/// <summary>What the policy gives, before rounding to whole taka.</summary>
public double CalculatedAmount { get; set; }
/// <summary>The LFA amount to pay.</summary>
public double Amount { get; set; }
public string Remarks { get; set; }
}
#endregion
#region LFAEmployee
/// <summary>What the LFA calculation needs to know of one employee (not a table).</summary>
public class LFAEmployee
{
public int EmployeeID { get; set; }
public string EmployeeNo { get; set; }
public string Name { get; set; }
public int PayrollTypeID { get; set; }
public EnumEmployeeStatus Status { get; set; }
public bool IsConfirmed { get; set; }
public DateTime JoiningDate { get; set; }
public DateTime? ConfirmationDate { get; set; }
public int? GradeID { get; set; }
public string GradeName { get; set; }
public int? DesignationID { get; set; }
public string DesignationName { get; set; }
public int? DepartmentID { get; set; }
public string DepartmentName { get; set; }
/// <summary>The parent of the employee's department.</summary>
public string DivisionName { get; set; }
public int? CostCenterID { get; set; }
public int? BranchID { get; set; }
public string AccountNo { get; set; }
public double JoiningBasic { get; set; }
public double LastDecBasic { get; set; }
/// <summary>The batch that already has this employee's LFA of the year; empty = none.</summary>
public string PaidBatchNumber { get; set; }
/// <summary>The employee already has an LFA payment for the preceding year.</summary>
public bool IsPaidLastYear { get; set; }
}
#endregion
#region ILFAPaymentService
public interface ILFAPaymentService
{
LFAPayment Get(int id);
LFAPaymentInfo GetInfo(int payrollTypeID);
byte[] GetUploadTemplate();
LFAPaymentReadResult ReadUpload(Stream stream, string fileName, long fileLength, DateTime paymentDate,
int payrollTypeID);
LFAPaymentReadResult Calculate(LFAPaymentRequest request, int payrollTypeID);
LFAPaymentProcessResult Process(LFAPaymentRequest request, int payrollTypeID, int userID);
List<LFAPaymentHistory> GetHistory(DateTime fromDate, DateTime toDate, int payrollTypeID);
// LFA Payment Undo
List<LFAPaymentBatch> GetUndoBatches(int payrollTypeID);
List<LFAPaymentBatchEmployee> GetBatchEmployees(int lfaPaymentID, int payrollTypeID);
LFAPaymentUndoResult Undo(LFAPaymentUndoRequest request, int payrollTypeID, int userID);
// LFA Payment Approval (as Salary Approval)
LFAApprovalInfo GetApprovalInfo(int? employeeID);
List<LFAPaymentBatch> GetApprovalBatches(int payrollTypeID);
List<WFFlowHistory> GetFlowHistory(int lfaPaymentID, int payrollTypeID);
LFAApprovalResult ApproveDirect(LFAApprovalRequest request, int payrollTypeID, int userID);
LFAApprovalResult SubmitForApproval(LFAApprovalRequest request, int payrollTypeID, int? employeeID, int userID);
LFAApproverBatch GetApproverBatch(int wfMovementTranID, int? employeeID);
LFAApprovalResult ApproveFromApprover(LFAApproverActionRequest request, int? employeeID, int userID);
LFAApprovalResult RevertFromApprover(LFAApproverActionRequest request, int? employeeID);
// LFA Bank Advice (report viewer, EnumReportType.LFABankAdvice)
List<LFAPaymentBatch> GetBankAdviceBatches(int payrollTypeID);
System.Data.DataSet GetBankAdvice(int lfaPaymentID, string sEmpIDs, int bankID, int payrollTypeID);
}
#endregion
}

View File

@ -1,78 +0,0 @@
using System;
using System.Collections.Generic;
namespace HRM.BO
{
#region LFA Payment Approval (not tables)
/// <summary>
/// LFA Payment Approval works exactly as Salary Approval: the Logic key lfaapproval/workflow decides
/// between Direct Approve ("No") and the approval workflow ("Yes"), whose approvers are set up for
/// WFTYPE 33 in Work Flow Setup and act from the Payment Approval page (/payment-approval/lfa).
/// </summary>
public static class LFAPaymentApproval
{
/// <summary>WFTYPE.WFTYPEID of LFA Payment (Salary 30, Bonus 31, Leave Encashment 32).</summary>
public const int WFTypeID = 33;
/// <summary>Logic configuration: lfaapproval / workflow = Yes | No.</summary>
public const string LogicParent = "lfaapproval";
public const string LogicChild = "workflow";
}
/// <summary>What the LFA Payment Approval page needs to know before it shows its buttons.</summary>
public class LFAApprovalInfo
{
/// <summary>lfaapproval/workflow = Yes: batches go through the approval workflow.</summary>
public bool IsWorkflowRequired { get; set; }
/// <summary>The login is linked with an employee (the workflow needs an initiator employee).</summary>
public bool HasEmployee { get; set; }
/// <summary>At least one approval rule is set up for LFA Payment in Work Flow Setup.</summary>
public bool HasWorkflowSetup { get; set; }
}
/// <summary>Approve (Direct) or Submit for approval one batch.</summary>
public class LFAApprovalRequest
{
public int LFAPaymentID { get; set; }
public string Remarks { get; set; }
}
/// <summary>An approver approves or reverts the workflow step (WFMovementTran) they received.</summary>
public class LFAApproverActionRequest
{
public int WFMovementTranID { get; set; }
public string Remarks { get; set; }
}
public class LFAApprovalResult
{
public bool Done { get; set; }
public string Message { get; set; }
/// <summary>True when the batch is now fully approved.</summary>
public bool Approved { get; set; }
}
/// <summary>The batch an approver opened from the Payment Approval page.</summary>
public class LFAApproverBatch
{
public LFAApproverBatch()
{
Employees = new List<LFAPaymentBatchEmployee>();
}
public LFAPaymentBatch Batch { get; set; }
public List<LFAPaymentBatchEmployee> Employees { get; set; }
/// <summary>The login is a pending approver of this step and may Approve or Revert it.</summary>
public bool CanAct { get; set; }
/// <summary>Why the login cannot act (already acted, not their step, batch undone ...).</summary>
public string Message { get; set; }
}
#endregion
}

View File

@ -1,78 +0,0 @@
using System;
using System.Collections.Generic;
namespace HRM.BO
{
#region LFA Payment Undo (not tables)
/// <summary>One batch of the LFA Payment Undo page.</summary>
public class LFAPaymentBatch
{
public int LFAPaymentID { get; set; }
public string BatchNumber { get; set; }
public DateTime SalaryMonth { get; set; }
public DateTime LFAYear { get; set; }
public DateTime PaymentDate { get; set; }
public string Remarks { get; set; }
public enumwfStatus? WFStatus { get; set; }
public bool IsTaxUpdated { get; set; }
public int HeadCount { get; set; }
public double TotalAmount { get; set; }
public string CreatedByName { get; set; }
public DateTime CreationDate { get; set; }
public string ApprovedByName { get; set; }
public DateTime? ApprovedDate { get; set; }
// approval workflow (WFTYPE 33): the latest step of the batch, if it was ever submitted
public int? WFMovementTranID { get; set; }
public int? UniqueNumber { get; set; }
/// <summary>The batch is back with the person who submitted it (an approver reverted it to them).</summary>
public bool IsAtInitiator { get; set; }
/// <summary>Who has to act now, e.g. "Md. Karim [D1004]".</summary>
public string PendingWith { get; set; }
/// <summary>Approval state in words (Not Submitted, Pending Approval, Approved, ...).</summary>
public string StatusText { get; set; }
public bool CanUndo { get; set; }
/// <summary>Why the batch cannot be undone; empty when it can.</summary>
public string UndoBlockedReason { get; set; }
}
/// <summary>One employee of a batch, on the LFA Payment Undo page.</summary>
public class LFAPaymentBatchEmployee
{
public int LFAPaymentDetailID { get; set; }
public int EmployeeID { get; set; }
public string EmployeeNo { get; set; }
public string Name { get; set; }
public string DesignationName { get; set; }
public string DepartmentName { get; set; }
public DateTime JoiningDate { get; set; }
public double BasicSalary { get; set; }
public double Amount { get; set; }
}
/// <summary>What to undo: the whole batch (no DetailIDs) or only these employees of it.</summary>
public class LFAPaymentUndoRequest
{
public LFAPaymentUndoRequest()
{
DetailIDs = new List<int>();
}
public int LFAPaymentID { get; set; }
/// <summary>LFAPaymentDetailIDs of the employees to remove; empty = the whole batch.</summary>
public List<int> DetailIDs { get; set; }
}
public class LFAPaymentUndoResult
{
public bool Undone { get; set; }
public string Message { get; set; }
public int RemovedCount { get; set; }
/// <summary>True when the batch itself was deleted (whole batch, or its last employee).</summary>
public bool BatchRemoved { get; set; }
}
#endregion
}

View File

@ -1,149 +0,0 @@
using System;
using System.Collections.Generic;
namespace HRM.BO
{
#region Template layout
/// <summary>
/// The LFA payment upload sheet. The downloadable workbook is generated from this and an uploaded
/// one is read against it.
/// </summary>
public static class LFAPaymentUploadTemplate
{
public const string SheetName = "LFA Payment";
public const string FileName = "LFA-Payment-Template.xlsx";
public const string ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
public const int MaxUploadMegabytes = 10;
public const int MaxRows = 20000;
public const int HeadingRow = 1;
public const int FirstDataRow = 2;
/// <summary>How many rows of the template are formatted as text.</summary>
public const int FormattedDataRows = 1000;
public const int EmployeeNoColumn = 1;
public const int NameColumn = 2;
public const int MaxRemarksLength = 500;
/// <summary>Employee ID is the Employee No. Name only helps whoever fills the file; it is not checked.</summary>
public static readonly string[] Headings = { "Employee ID", "Name" };
public static readonly double[] Widths = { 18, 40 };
}
#endregion
#region Upload and process data
/// <summary>One uploaded row: what the user gives. Every amount is worked out by the server.</summary>
public class LFAPaymentInput
{
public int RowNo { get; set; }
public string EmployeeNo { get; set; }
}
/// <summary>The page's payment information and rows, to calculate or to process.</summary>
public class LFAPaymentRequest
{
public DateTime? PaymentDate { get; set; }
public string Remarks { get; set; }
public List<LFAPaymentInput> Rows { get; set; }
/// <summary>The total the page shows; processing stops when the calculation no longer gives it.</summary>
public double ExpectedTotal { get; set; }
}
/// <summary>One calculated row, as the New LFA Payment grid shows it.</summary>
public class LFAPaymentRow : LFAPaymentInput
{
public int EmployeeID { get; set; }
public string Name { get; set; }
public string GradeName { get; set; }
public string DesignationName { get; set; }
public string DivisionName { get; set; }
public string DepartmentName { get; set; }
public DateTime JoiningDate { get; set; }
public DateTime? ConfirmationDate { get; set; }
/// <summary>Joining Date to Payment Date, e.g. "2 Years 9 Months 27 Days".</summary>
public string ServiceLength { get; set; }
public double JoiningBasic { get; set; }
public double? LastDecBasic { get; set; }
public double BasicSalary { get; set; }
public double Amount { get; set; }
public DateTime PaymentDate { get; set; }
}
/// <summary>Why a row (or, with RowNo 0, the file) cannot be paid.</summary>
public class LFAPaymentIssue
{
public int RowNo { get; set; }
public string EmployeeNo { get; set; }
public string EmployeeName { get; set; }
public string Message { get; set; }
}
public class LFAPaymentReadResult
{
public LFAPaymentReadResult()
{
Rows = new List<LFAPaymentRow>();
Issues = new List<LFAPaymentIssue>();
}
public DateTime SalaryMonth { get; set; }
/// <summary>The rows that can be paid.</summary>
public List<LFAPaymentRow> Rows { get; set; }
/// <summary>Every problem of every other row.</summary>
public List<LFAPaymentIssue> Issues { get; set; }
public void AddIssue(int rowNo, string employeeNo, string employeeName, string message)
{
Issues.Add(new LFAPaymentIssue
{
RowNo = rowNo,
EmployeeNo = employeeNo,
EmployeeName = employeeName,
Message = message
});
}
}
public class LFAPaymentProcessResult
{
public bool Saved { get; set; }
public string Message { get; set; }
public string BatchNumber { get; set; }
/// <summary>Set when nothing was saved because the rows no longer pass.</summary>
public LFAPaymentReadResult Validation { get; set; }
}
/// <summary>The current salary month of the payroll type and the next batch number.</summary>
public class LFAPaymentInfo
{
public int PayrollTypeID { get; set; }
public DateTime SalaryMonth { get; set; }
public string NextBatchNumber { get; set; }
}
/// <summary>One row of the Payment History tab.</summary>
public class LFAPaymentHistory
{
public int LFAPaymentDetailID { get; set; }
public string BatchNumber { get; set; }
public DateTime PaymentDate { get; set; }
public string EmployeeNo { get; set; }
public string Name { get; set; }
public string DesignationName { get; set; }
public string DepartmentName { get; set; }
public DateTime JoiningDate { get; set; }
public double BasicSalary { get; set; }
public double Amount { get; set; }
}
#endregion
}

View File

@ -791,8 +791,6 @@ namespace HRM.BO
#endregion #endregion
public double ActualPassegeFreeAmount { get; set; }
// #region Functions // #region Functions
// public static SalaryMonthly Get(int nID) // public static SalaryMonthly Get(int nID)

View File

@ -173,11 +173,7 @@ namespace HRM.BO
} }
#endregion #endregion
public EnumAllowanceType AllowanceType { get; set; }
public bool IsOnBalancing { get; set; }
public double ActualPassegeFreeAmount { get; set; }
#region Service Factory ISalaryMonthlyService : ISalaryMonthlyService #region Service Factory ISalaryMonthlyService : ISalaryMonthlyService

View File

@ -462,9 +462,6 @@ namespace HRM.BO
bool GetBySMonth(DateTime sMonth, int payrollTypeID); bool GetBySMonth(DateTime sMonth, int payrollTypeID);
List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees); List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees);
/// <summary>Same as SalaryProcess, reporting real progress to <paramref name="progress"/> (null = none).</summary>
List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees, IJobProgress progress);
List<int> GetCategoryEmployeeIDs(int categoryID, int payrollTypeID, DateTime salaryMonth);
int Save(SalaryProcess item); int Save(SalaryProcess item);
void Delete(int id); void Delete(int id);

View File

@ -99,28 +99,18 @@ namespace HRM.BO
//#endregion //#endregion
#endregion #endregion
//public string getEmpID(List<IncomeTax> items)
//{
// string str = "";
// items.ForEach(x =>
// {
// if (x != null)
// str = str + x.EmployeeID + ",";
// });
// if (str.Length > 0) str = str.Substring(0, str.Length - 1);
// return str;
//}
// Comma-separated employee IDs of the rows, for "employeeID IN (...)".
// Each employee once: income-tax data has many rows per employee, and building the string by
// repeated concatenation made Bonus Approve take minutes on a large payroll.
public string getEmpID(List<IncomeTax> items) public string getEmpID(List<IncomeTax> items)
{ {
return string.Join(",", items.Where(x => x != null).Select(x => x.EmployeeID).Distinct()); string str = "";
items.ForEach(x =>
{
if (x != null)
str = str + x.EmployeeID + ",";
});
if (str.Length > 0) str = str.Substring(0, str.Length - 1);
return str;
} }

View File

@ -136,7 +136,6 @@ namespace HRM.BO
public int? EmployeeID { get; set; } public int? EmployeeID { get; set; }
public string MobileNo { get; set; } public string MobileNo { get; set; }
public string Email { get; set; } //erec public string Email { get; set; } //erec
public Employee Employee { get; set; } // Not a database field (linked employee, filled where needed e.g. forgot password)
//public string EmailAddress { get; set; } //public string EmailAddress { get; set; }
public string ADloginID { get; set; } public string ADloginID { get; set; }
@ -193,7 +192,6 @@ namespace HRM.BO
void Approve(User user); void Approve(User user);
int GetUserId(int employeeid, EnumUserType type); int GetUserId(int employeeid, EnumUserType type);
User GetByLoginIDbyEmail(string sEmail); User GetByLoginIDbyEmail(string sEmail);
User GetUserForPasswordReset(string loginID);
void DoActiveAndIntacive(User oUser); void DoActiveAndIntacive(User oUser);
//void SaveAllUsers(List<User> oUsers); //void SaveAllUsers(List<User> oUsers);

View File

@ -22,15 +22,15 @@ namespace HRM.DA
{ {
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable, TaxProjection,isBalancing)" + "INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable, TaxProjection)" +
" VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n,%b)", " VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n)",
item.ID, item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, item.PercentOfBasic, item.ID, item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, item.PercentOfBasic,
item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.GFPercentOfGross, item.MinAmount, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.GFPercentOfGross, item.MinAmount,
item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.IsTaxable, item.IsTaxProjection, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.IsTaxable, item.IsTaxProjection,
item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.ISDEPENDSONSPECIALHOUR, item.IsWithException, item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.ISDEPENDSONSPECIALHOUR, item.IsWithException,
item.Periodicity, item.AllowOrDeductType, item.Gender, item.CreatedBy, item.CreatedDate, item.Periodicity, item.AllowOrDeductType, item.Gender, item.CreatedBy, item.CreatedDate,
item.PayrollTypeID, DateTime.Now, item.EntitleType, item.PercentOfEarnedBasic, item.PayrollTypeID, DateTime.Now, item.EntitleType, item.PercentOfEarnedBasic,
item.IsFractionateApplicable, 0, item.IsOnBalancing); item.IsFractionateApplicable, 0);
} }
internal static void Insert(TransactionContext tc, ADParameter.ADParameterGrade item) internal static void Insert(TransactionContext tc, ADParameter.ADParameterGrade item)
@ -57,13 +57,13 @@ namespace HRM.DA
internal static void Update(TransactionContext tc, ADParameter item) internal static void Update(TransactionContext tc, ADParameter item)
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"UPDATE ADPARAMETERBASIC SET allowDeductID=%n, IsForConfirmOnly=%b, FlatAmount=%n, PercentOfBasic=%n, PercentOfGross=%n, GFFlatAmount=%n, GFPercentOfBasic=%n, GFPercentOfGross=%n, MinAmount=%n, MaxAmount=%n, IsCurrentlyActive=%b, TaxablePercentage=%n, IsTaxable=%b, IsTaxProjection=%b, IsDependsOnAttendance=%b, IsDependsOnOTHour=%b, IsWithException=%b, Periodicity=%n, ALLOWORDEDUCT=%n, Gender=%n, ModifiedBy=%n, ModifiedDate=%d, ENTITLETYPE=%n, PercentOfEarnedBasic=%n, IsFractionateApplicable=%n,isBalancing=%b" + "UPDATE ADPARAMETERBASIC SET allowDeductID=%n, IsForConfirmOnly=%b, FlatAmount=%n, PercentOfBasic=%n, PercentOfGross=%n, GFFlatAmount=%n, GFPercentOfBasic=%n, GFPercentOfGross=%n, MinAmount=%n, MaxAmount=%n, IsCurrentlyActive=%b, TaxablePercentage=%n, IsTaxable=%b, IsTaxProjection=%b, IsDependsOnAttendance=%b, IsDependsOnOTHour=%b, IsWithException=%b, Periodicity=%n, ALLOWORDEDUCT=%n, Gender=%n, ModifiedBy=%n, ModifiedDate=%d, ENTITLETYPE=%n, PercentOfEarnedBasic=%n, IsFractionateApplicable=%n" +
" WHERE ADParameterID=%n", item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, " WHERE ADParameterID=%n", item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount,
item.PercentOfBasic, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.PercentOfBasic, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic,
item.GFPercentOfGross, item.MinAmount, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.GFPercentOfGross, item.MinAmount, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage,
item.IsTaxable, item.IsTaxProjection, item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.IsTaxable, item.IsTaxProjection, item.IsDependsOnAttendance, item.IsDependsOnOTHour,
item.IsWithException, item.Periodicity, item.AllowOrDeductType, item.Gender, item.ModifiedBy, item.IsWithException, item.Periodicity, item.AllowOrDeductType, item.Gender, item.ModifiedBy,
item.ModifiedDate, item.EntitleType, item.PercentOfEarnedBasic, item.IsFractionateApplicable, item.IsOnBalancing, item.ID); item.ModifiedDate, item.EntitleType, item.PercentOfEarnedBasic, item.IsFractionateApplicable, item.ID);
} }
#endregion #endregion

View File

@ -20,9 +20,9 @@ namespace HRM.DA
internal static void Insert(TransactionContext tc, AllowanceDeduction item) internal static void Insert(TransactionContext tc, AllowanceDeduction item)
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"INSERT INTO AllowanceDeduction(ALLOWDEDUCTID, code, name, allowOrDeduct, CreatedBy, CreationDate, SequenceNo, Status, payrolltypeid, nameinbangla, AllowanceType)" + "INSERT INTO AllowanceDeduction(ALLOWDEDUCTID, code, name, allowOrDeduct, CreatedBy, CreationDate, SequenceNo, Status, payrolltypeid, nameinbangla)" +
" VALUES(%n, %s, %s, %n, %n, %d, %n, %n, %n, %u, %n)", item.ID, item.Code, item.Name, item.AllowOrDeductType, " VALUES(%n, %s, %s, %n, %n, %d, %n, %n, %n, %u)", item.ID, item.Code, item.Name, item.AllowOrDeductType,
item.CreatedBy, item.CreatedDate, item.Sequence, item.Status , item.payrolltypeid, item.NameInBangla, item.AllowanceType); item.CreatedBy, item.CreatedDate, item.Sequence, item.Status , item.payrolltypeid, item.NameInBangla);
} }
#endregion #endregion
@ -33,8 +33,8 @@ namespace HRM.DA
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"UPDATE AllowanceDeduction SET code=%s, name=%s, allowOrDeduct=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" + "UPDATE AllowanceDeduction SET code=%s, name=%s, allowOrDeduct=%n, ModifiedBy=%n, ModifiedDate=%d, SequenceNo=%n, Status=%n" +
" , payrolltypeid=%n, nameinbangla=%u, AllowanceType=%n WHERE ALLOWDEDUCTID=%n", item.Code, item.Name, item.AllowOrDeductType, item.ModifiedBy, " , payrolltypeid=%n, nameinbangla=%u WHERE ALLOWDEDUCTID=%n", item.Code, item.Name, item.AllowOrDeductType, item.ModifiedBy,
item.ModifiedDate, item.Sequence, item.Status, item.payrolltypeid, item.NameInBangla, item.AllowanceType, item.ID); item.ModifiedDate, item.Sequence, item.Status, item.payrolltypeid, item.NameInBangla, item.ID);
} }
#endregion #endregion

View File

@ -9,125 +9,71 @@ namespace HRM.DA
public class ComponentUploadSetupDA public class ComponentUploadSetupDA
{ {
#region Constructor #region Constructor
public ComponentUploadSetupDA() { }
public ComponentUploadSetupDA()
{
}
#endregion #endregion
#region Insert function #region Insert function
public static void Insert(TransactionContext tc, ComponentUploadSetup oItem) public static void Insert(TransactionContext tc, ComponentUploadSetup oItem)
{ {
tc.ExecuteNonQuery("INSERT INTO ComponentUploadSetup(ComponentUploadSetupID, EmployeeID, ApproverID, ComponentType, ItemID, Description,IsDamageManagement)" + tc.ExecuteNonQuery(
" VALUES(%n, %n, %n, %n,%n, %s, %b)", oItem.ID, oItem.EmployeeID, oItem.ApproverID, (EnumComponentType)oItem.ComponentType, oItem.ItemID, oItem.Description, oItem.IsDamageManagement); "INSERT INTO ComponentUploadSetup(ComponentUploadSetupID, EmployeeID, ComponentType, ItemID, Description)" +
" VALUES(%n, %n, %n,%n, %s)", oItem.ID, oItem.EmployeeID, (EnumComponentType)oItem.ComponentType,
oItem.ItemID, oItem.Description);
} }
#endregion #endregion
#region Update function #region Update function
public static void Update(TransactionContext tc, ComponentUploadSetup oItem) public static void Update(TransactionContext tc, ComponentUploadSetup oItem)
{ {
tc.ExecuteNonQuery("UPDATE ComponentUploadSetup SET EmployeeID=%n, ApproverID = %n, ComponentType=%n,ItemID=%n, Description=%s" + tc.ExecuteNonQuery(
" WHERE ComponentUploadSetupID=%n", oItem.EmployeeID, oItem.ApproverID, (EnumComponentType)oItem.ComponentType, oItem.ItemID, oItem.Description, oItem.ID); "UPDATE ComponentUploadSetup SET EmployeeID=%n, ComponentType=%n,ItemID=%n, Description=%s" +
" WHERE ComponentUploadSetupID=%n", oItem.EmployeeID, (EnumComponentType)oItem.ComponentType,
oItem.ItemID, oItem.Description, oItem.ID);
} }
#endregion #endregion
#region Get function #region Get function
public static DataSet GetUploadedComponent(TransactionContext tc, DateTime uploadMonth)
{
return tc.ExecuteDataSet(@"Select Distinct A.Name ComponentName, UC.ComponentId From ALLOWANCEDEDUCTION A
Join UploadedComponent UC On UC.ComponentId = A.AllowDeductId Where UC.SalaryMonth = %d", GlobalFunctions.LastDateOfMonth(uploadMonth));
}
public static IDataReader Get(TransactionContext tc) public static IDataReader Get(TransactionContext tc)
{ {
return tc.ExecuteReader("SELECT * FROM ComponentUploadSetup ORDER BY EmployeeID"); return tc.ExecuteReader("SELECT * FROM ComponentUploadSetup ORDER BY EmployeeID");
} }
public static IDataReader Get(TransactionContext tc, int empid) public static IDataReader Get(TransactionContext tc, int empid)
{ {
return tc.ExecuteReader("SELECT * FROM ComponentUploadSetup WHERE EmployeeID=%n", empid); return tc.ExecuteReader("SELECT * FROM ComponentUploadSetup WHERE EmployeeID=%n", empid);
//return tc.ExecuteReader("SELECT DISTinct EmployeeID, PropductSerial= STUFF((SELECT ', ' + DESCRIPTION From ComponentUploadSetup WHERE employeeid = c.EmployeeID FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') From ComponentUploadSetup c where c.employeeid =%n", empid); //return tc.ExecuteReader("SELECT DISTinct EmployeeID, PropductSerial= STUFF((SELECT ', ' + DESCRIPTION From ComponentUploadSetup WHERE employeeid = c.EmployeeID FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') From ComponentUploadSetup c where c.employeeid =%n", empid);
} }
public static IDataReader GetByEmpIDandItemID(TransactionContext tc, int empid, int itemID)
{
return tc.ExecuteReader("SELECT * FROM ComponentUploadSetup WHERE EmployeeID=%n and ItemID=%n Order by COMPONENTUPLOADSETUPID desc", empid, itemID);
//return tc.ExecuteReader("SELECT DISTinct EmployeeID, PropductSerial= STUFF((SELECT ', ' + DESCRIPTION From ComponentUploadSetup WHERE employeeid = c.EmployeeID FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') From ComponentUploadSetup c where c.employeeid =%n", empid);
}
public static IDataReader GetByApproverID(TransactionContext tc, int apprvrID)
{
return tc.ExecuteReader("SELECT CUS.*, UCE.UploadedComponentID FROM ComponentUploadSetup AS CUS RIGHT JOIN UploadedComponent UCE ON UCE.UploadedBy = CUS.EMPLOYEEID WHERE CUS.ApproverID=%n", apprvrID);
}
public static DataSet GetUploadedComponentReportData(TransactionContext tc, DateTime fromDate, DateTime toDate)
{
string sql = SQLParser.MakeSQL(@"SELECT UE.EmployeeNo UploaderNo, UE.Name UploaderName, CONVERT(VARCHAR, U.UploadedDate, 106) UploadDate, A.Name ComponentName,
UA.EmployeeNo ApproverNo, UA.Name ApproverName, CONVERT(VARCHAR, U.ApprovedDate, 106) ApproveDate
FROM UploadedComponent U
LEFT JOIN Employee UE ON UE.EmployeeId = U.UploadedBy
LEFT JOIN Employee UA ON UA.EmployeeId = U.ApprovedBy
LEFT JOIN ALLOWANCEDEDUCTION A ON A.AllowDeductId = U.ComponentId
WHERE U.UploadedDate BETWEEN %d AND %d", fromDate, toDate);
return tc.ExecuteDataSet(sql);
}
public static DataSet GetUploadedComponentEmpReportData(TransactionContext tc, DateTime salaryMonth, int componentId, string empIds)
{
string sql = SQLParser.MakeSQL(@"SELECT UCE.UploadedComponentEmpId, UE.EmployeeNo UploadedEmpNo, UE.Name UploadedEmpName, UCE.Amount, CONVERT(VARCHAR, UCE.CreatedDate, 106) UploadedDate, A.Name ComponentName
FROM UploadedComponentEmp UCE
LEFT JOIN Employee UE ON UE.EmployeeId = UCE.EmployeeId
LEFT JOIN UploadedComponent UC ON UC.UploadedComponentId = UCE.UploadedComponentId
LEFT JOIN ALLOWANCEDEDUCTION A ON A.AllowDeductId = UC.ComponentId
WHERE UCE.EmployeeId In (%q) And UC.ComponentId = %n And UC.SalaryMonth = %d", empIds, componentId, GlobalFunctions.LastDateOfMonth(salaryMonth));
return tc.ExecuteDataSet(sql);
}
public static DataSet GetUploadedComponentEmpReportData(TransactionContext tc, DateTime salaryMonth, string empIds)
{
string sql = SQLParser.MakeSQL(@"SELECT UCE.UploadedComponentEmpId, UE.EmployeeNo UploadedEmpNo, UE.Name UploadedEmpName, UCE.Amount, CONVERT(VARCHAR, UCE.CreatedDate, 106) UploadedDate, A.Name ComponentName
FROM UploadedComponentEmp UCE
LEFT JOIN Employee UE ON UE.EmployeeId = UCE.EmployeeId
LEFT JOIN UploadedComponent UC ON UC.UploadedComponentId = UCE.UploadedComponentId
LEFT JOIN ALLOWANCEDEDUCTION A ON A.AllowDeductId = UC.ComponentId
WHERE UCE.EmployeeId In (%q) And UC.SalaryMonth = %d", empIds, GlobalFunctions.LastDateOfMonth(salaryMonth));
return tc.ExecuteDataSet(sql);
}
#endregion #endregion
#region Delete function #region Delete function
public static void Delete(TransactionContext tc, int id) public static void Delete(TransactionContext tc, int id)
{ {
tc.ExecuteNonQuery("DELETE FROM ComponentUploadSetup WHERE ComponentUploadSetupID=%n", id); tc.ExecuteNonQuery("DELETE FROM ComponentUploadSetup WHERE ComponentUploadSetupID=%n", id);
} }
public static void DeleteSingleComponent(TransactionContext tc, int empId, int apprvrId, EnumComponentType ComponentType, int itemId)
public static bool IsExist(TransactionContext tc, int empId, EnumComponentType ComponentType, int itemId)
{ {
tc.ExecuteNonQuery("DELETE FROM ComponentUploadSetup WHERE EmployeeID=%n AND ApproverID = %n AND COMPONENTTYPE=%n AND ItemID=%n", empId, apprvrId, ComponentType, itemId); bool Exist = false;
Object obj =
tc.ExecuteScalar(
"Select COUNT (*) FROM ComponentUploadSetup WHERE EmployeeID=%n AND COMPONENTTYPE=%n AND ItemID=%n",
empId, ComponentType, itemId);
Exist = Convert.ToInt32(obj) > 0 ? true : false;
return Exist;
} }
public static bool IsExist(TransactionContext tc, int empId, int apprvrId, EnumComponentType ComponentType, int itemId)
{
object obj = tc.ExecuteScalar("Select COUNT (*) FROM ComponentUploadSetup WHERE EmployeeID=%n AND ApproverID = %n AND COMPONENTTYPE=%n AND ItemID=%n", empId, apprvrId, ComponentType, itemId);
return Convert.ToInt32(obj) > 0;
}
// True when the employee is set as the approver of at least one component upload setup.
public static bool HasApproverSetup(TransactionContext tc, int approverId)
{
object obj = tc.ExecuteScalar("Select COUNT(*) FROM ComponentUploadSetup WHERE ApproverID=%n", approverId);
return Convert.ToInt32(obj) > 0;
}
// True when the employee has at least one component upload setup (i.e. can upload components).
public static bool HasUploaderSetup(TransactionContext tc, int employeeId)
{
object obj = tc.ExecuteScalar("Select COUNT(*) FROM ComponentUploadSetup WHERE EmployeeID=%n", employeeId);
return Convert.ToInt32(obj) > 0;
}
public static void DeleteExisting(TransactionContext tc, ComponentUploadSetup oItem)
{
tc.ExecuteNonQuery(
"DELETE FROM ComponentUploadSetup WHERE EmployeeID=%n AND ApproverID=%n",
oItem.EmployeeID, oItem.ApproverID);
}
#endregion #endregion
} }
} }

View File

@ -1,142 +0,0 @@
using Ease.Core.DataAccess;
using HRM.BO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HRM.DA
{
internal class UploadedComponentDA
{
#region Insert function
internal static void Insert(TransactionContext tc, UploadedComponent item)
{
tc.ExecuteNonQuery("INSERT INTO UploadedComponent(UploadedComponentID, SalaryMonth, ComponentID, ComponentType, UploadedBy, UploadedDate, IsDamageManagement)" +
" VALUES(%n, %d, %n, %n, %n, %D, %b)", item.ID, item.SalaryMonth, item.ComponentID, (int)(EnumComponentType)item.ComponentType, item.UploadedBy, item.UploadedDate, DataReader.GetNullValue(item.IsDamageManagement));
}
internal static void InsertUploadedComponentEmp(TransactionContext tc, UploadedComponentEmp item)
{
tc.ExecuteNonQuery("INSERT INTO UploadedComponentEmp(UploadedComponentEmpID, UploadedComponentID, EmployeeID, Amount, CreatedDate, Reason, TotalAmount, DeductionMonth, DeductionAmount, Remarks)" +
" VALUES(%n, %n, %n, %n, %d, %s, %n, %d, %n, %s)", item.ID, item.UploadedComponentID, item.EmployeeID, item.Amount, item.CreatedDate, DataReader.GetNullValue(item.Reason), DataReader.GetNullValue(item.TotalAmount), DataReader.GetNullValue(item.DeductionMonth), DataReader.GetNullValue(item.DeductionAmount), DataReader.GetNullValue(item.Remarks));
}
#endregion
#region Get Function
public static IDataReader Get(TransactionContext tc, DateTime fromDate, DateTime toDate)
{
return tc.ExecuteReader("SELECT * FROM UploadedComponent Where UploadedDate Between %d And %d ORDER BY UploadedDate Desc", fromDate, toDate);
}
internal static DataSet GetByID(TransactionContext tc, int uploadedComponentID)
{
string sql = SQLParser.MakeSQL(@"Select UC.*, UCE.EmployeeID, UCE.Amount from UploadedComponent As UC
Join UploadedComponentEmp As UCE On UCE.UploadedComponentID = UC.UploadedComponentID
Where UC.UploadedComponentID = %n
Order By UC.UploadedDate", uploadedComponentID);
return tc.ExecuteDataSet(sql);
}
internal static DataSet GetByID_DT(TransactionContext tc, int uploadedComponentID)
{
string sql = SQLParser.MakeSQL(@"
SELECT E.EmployeeNo, E.Name, UCE.Amount
FROM UploadedComponent As UC
JOIN UploadedComponentEmp As UCE ON UCE.UploadedComponentID = UC.UploadedComponentID
JOIN Employee As E ON E.EmployeeID = UCE.EmployeeID
WHERE UC.UploadedComponentID = %n
ORDER BY UC.UploadedDate", uploadedComponentID);
return tc.ExecuteDataSet(sql);
}
internal static DataSet GetByIDandUploaderID_DT(TransactionContext tc, int uploadedComponentID, int uploaderID)
{
string sql = SQLParser.MakeSQL(@"
SELECT E.EmployeeNo, E.Name, UCE.Amount
FROM UploadedComponent As UC
JOIN UploadedComponentEmp As UCE ON UCE.UploadedComponentID = UC.UploadedComponentID
JOIN Employee As E ON E.EmployeeID = UCE.EmployeeID
WHERE UC.UploadedComponentID = %n AND UC.UploadedBy = %n
ORDER BY UC.UploadedDate", uploadedComponentID, uploaderID);
return tc.ExecuteDataSet(sql);
}
internal static IDataReader GetUploadedComponentEmp(TransactionContext tc, int componentID)
{
return tc.ExecuteReader("SELECT * FROM UploadedComponentEmp WHERE UploadedComponentID=%n", componentID);
}
internal static IDataReader Get(TransactionContext tc, int componentID, int uploaderID, DateTime salaryMonth)
{
return tc.ExecuteReader("SELECT * FROM UploadedComponent WHERE UploadedBy=%n AND SalaryMonth = %d AND ComponentId=%n", uploaderID, GlobalExtensions.LastDateOfMonth(salaryMonth), componentID);
}
internal static IDataReader Get(TransactionContext tc, int uploaderID, DateTime salaryMonth)
{
return tc.ExecuteReader("SELECT * FROM UploadedComponent WHERE UploadedBy=%n AND SalaryMonth = %d", uploaderID, GlobalExtensions.LastDateOfMonth(salaryMonth));
}
internal static IDataReader GetByApprover(TransactionContext tc, int approverID, DateTime salaryMonth)
{
return tc.ExecuteReader("SELECT UCE.* FROM UploadedComponent UCE WHERE EXISTS " +
"(SELECT 1 FROM ComponentUploadSetup CUS WHERE CUS.EMPLOYEEID = UCE.UploadedBy AND CUS.ApproverID =%n AND UCE.SalaryMonth =%d);",
approverID, GlobalExtensions.LastDateOfMonth(salaryMonth));
}
internal static IDataReader GetByApprover(TransactionContext tc, int approverID)
{
return tc.ExecuteReader("SELECT UCE.* FROM UploadedComponent UCE WHERE EXISTS " +
"(SELECT 1 FROM ComponentUploadSetup CUS WHERE CUS.EMPLOYEEID = UCE.UploadedBy AND CUS.ApproverID =%n);",
approverID);
}
internal static DataSet GetByUploaderDT(TransactionContext tc, int empID)
{
string sql = SQLParser.MakeSQL(@"
Select uc.*, e.EmployeeNo, e.Name, comp.DESCRIPTION from UploadedComponent uc
inner join COMPONENTUPLOADSETUP comp ON comp.ITEMID = uc.ComponentID
AND comp.COMPONENTTYPE = uc.ComponentType
AND comp.EMPLOYEEID = uc.UploadedBy
left join Employee e on comp.APPROVERID = e.EMPLOYEEID
where uc.UploadedBy = %n order by uc.SalaryMonth desc ", empID);
return tc.ExecuteDataSet(sql);
}
#endregion
#region Update Function
internal static void Update(TransactionContext tc, UploadedComponent item)
{
tc.ExecuteNonQuery("UPDATE UploadedComponent SET SalaryMonth=%d, ComponentID=%n, ComponentType=%n, ApprovedBy=%n, ApprovedDate=%d" +
" WHERE UploadedComponentID=%n", item.SalaryMonth, item.ComponentID, (int)(EnumComponentType)item.ComponentType, item.ApprovedBy, item.ApprovedDate, item.ID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int uploadedComponentID)
{
tc.ExecuteNonQuery("DELETE FROM UploadedComponent WHERE UploadedComponentID=%n", uploadedComponentID);
}
internal static void DeleteUploadedComponentEmp(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM UploadedComponentEmp WHERE UploadedComponentID=%n", nID);
}
#endregion
#region IsExist
public static IDataReader GetExistingComponent(TransactionContext tc, int uploaderID, int componentID, EnumComponentType componentType, DateTime salaryMonth)
{
return tc.ExecuteReader("SELECT * FROM UploadedComponent WHERE UploadedBy=%n AND ComponentID=%n AND ComponentType=%n AND SalaryMonth=%d", uploaderID, componentID, (int)componentType, GlobalExtensions.LastDateOfMonth(salaryMonth));
}
#endregion
#region ADParameter of the grade
/// <summary>The allowance/deduction parameter that covers the grade (GP's ADParameterDA.GetADParamByGradeAndAD).</summary>
internal static IDataReader GetADParamByGradeAndAD(TransactionContext tc, int gradeID, int allowDedID)
{
return tc.ExecuteReader(@"SELECT A.* FROM ADPARAMETERBASIC A, ADPARAMETERGRADE AG WHERE A.ADPARAMETERID=AG.ADPARAMETERID
AND AG.GRADEID=%n AND A.ALLOWDEDUCTID=%n", gradeID, allowDedID);
}
#endregion
}
}

View File

@ -121,45 +121,6 @@ namespace HRM.DA
#endregion #endregion
#region BonusReligion
internal static void InsertReligion(TransactionContext tc, int bonusReligionID, int bonusID, int religionID)
{
tc.ExecuteNonQuery("INSERT INTO BonusReligion(BonusReligionID, BonusID, ReligionID) VALUES(%n, %n, %n)",
bonusReligionID, bonusID, religionID);
}
internal static void DeleteReligions(TransactionContext tc, int bonusID)
{
tc.ExecuteNonQuery("DELETE FROM BonusReligion WHERE BonusID=%n", bonusID);
}
internal static IDataReader GetReligions(TransactionContext tc, int bonusID)
{
return tc.ExecuteReader(
"SELECT br.BonusID, br.ReligionID, r.Name FROM BonusReligion br INNER JOIN Religion r ON r.ReligionID = br.ReligionID" +
" WHERE br.BonusID=%n ORDER BY r.SequenceNo, r.Name", bonusID);
}
// Live employees of the payroll type whose religion is one of the bonus's religions
internal static IDataReader GetReligionEmployeeIDs(TransactionContext tc, int bonusID, int payrollTypeID)
{
return tc.ExecuteReader(
"SELECT e.EmployeeID FROM Employee e WHERE e.Status=%n AND e.PayrollTypeID=%n" +
" AND e.ReligionID IN (SELECT br.ReligionID FROM BonusReligion br WHERE br.BonusID=%n) ORDER BY e.EmployeeNo",
(int)EnumEmployeeStatus.Live, payrollTypeID, bonusID);
}
internal static IDataReader GetReligionsByPayrollType(TransactionContext tc, int payrollTypeID)
{
return tc.ExecuteReader(
"SELECT br.BonusID, br.ReligionID, r.Name FROM BonusReligion br INNER JOIN Religion r ON r.ReligionID = br.ReligionID" +
" INNER JOIN Bonus b ON b.BonusID = br.BonusID WHERE b.PayrollTypeID=%n ORDER BY br.BonusID, r.SequenceNo, r.Name",
payrollTypeID);
}
#endregion
#region CC Wise Bonus Summary #region CC Wise Bonus Summary
internal static DataSet GetCCWiseBonusSummary(TransactionContext tc, DateTime bMonthDate, string bonus) internal static DataSet GetCCWiseBonusSummary(TransactionContext tc, DateTime bMonthDate, string bonus)
{ {

View File

@ -741,9 +741,7 @@ AND BP.PayrollTypeID=%n", emps, FromDate, ToDate, payrollTypeID);
internal static DataTable GetUnApprovedBonuses(TransactionContext tc, DateTime dMonthDate, int payrollTypeID) internal static DataTable GetUnApprovedBonuses(TransactionContext tc, DateTime dMonthDate, int payrollTypeID)
{ {
return tc.ExecuteDataTable("SELECT *, b.name, (SELECT Count(*) FROM bonusProcessDetail bdetail WHERE bdetail.bonusProcessid = bp.bonusProcessid) Count, " + return tc.ExecuteDataTable("SELECT *, b.name, (SELECT Count(*) FROM bonusProcessDetail bdetail WHERE bdetail.bonusProcessid = bp.bonusProcessid) Count, " +
"(CASE WHEN EXISTS (SELECT 1 FROM SalaryApprovalAttachment saa WHERE saa.ReferenceID = bp.bonusProcessid) THEN 1 ELSE 0 END) IsAttachment, " + "(CASE WHEN EXISTS (SELECT 1 FROM SalaryApprovalAttachment saa WHERE saa.ReferenceID = bp.bonusProcessid) THEN 1 ELSE 0 END) IsAttachment " +
"(SELECT STRING_AGG(r.Name, ', ') WITHIN GROUP (ORDER BY r.SequenceNo, r.Name) FROM BonusReligion br " +
"INNER JOIN Religion r ON r.ReligionID = br.ReligionID WHERE br.BonusID = bp.bonusid) ReligionNames " +
"FROM bonusProcess bp, bonus b WHERE b.bonusid = bp.bonusid AND bp.IsApprove = %b AND bp.BonusMonth = %d AND bp.PayrollTypeID = %n", "FROM bonusProcess bp, bonus b WHERE b.bonusid = bp.bonusid AND bp.IsApprove = %b AND bp.BonusMonth = %d AND bp.PayrollTypeID = %n",
false, dMonthDate, payrollTypeID); false, dMonthDate, payrollTypeID);
} }

View File

@ -26,8 +26,8 @@ namespace HRM.DA
public static void Insert(TransactionContext tc, EmpLifeCycle item) public static void Insert(TransactionContext tc, EmpLifeCycle item)
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"INSERT INTO EmpLifeCycle(EmpLifeCycleID,EffectDate,NodeID,GrossSalary,BasicSalary,GradeID,CategoryID,CompanyID,FunctionID,DesignationID,LocationID,DepartmentID,IsConfirm,pFMemberType,IsDiscontinue,IsContinue,EmployeeID,StatusDetailID,Remarks,Description,Status,CreatedBy, CreationDate, SequenceNo,SalaryMonth,IsCurrentMonthIncluded,CostCenterID,GradeSalaryAssesmentID,EmployeeCCID,IncrementNo,PayrollTypeID,ComplainID,PunishmentID,ApprovalStatus,PFPercentage)" + "INSERT INTO EmpLifeCycle(EmpLifeCycleID,EffectDate,NodeID,GrossSalary,BasicSalary,GradeID,CategoryID,CompanyID,FunctionID,DesignationID,LocationID,DepartmentID,IsConfirm,pFMemberType,IsDiscontinue,IsContinue,EmployeeID,StatusDetailID,Remarks,Description,Status,CreatedBy, CreationDate, SequenceNo,SalaryMonth,IsCurrentMonthIncluded,CostCenterID,GradeSalaryAssesmentID,EmployeeCCID,IncrementNo,PayrollTypeID,ComplainID,PunishmentID,ApprovalStatus)" +
" VALUES( %n , %D , %n , %n , %n , %n , %n , %n , %n , %n , %n , %n , %b , %n , %b , %b , %n , %n , %s , %s , %n , %n , %D , %n , %D , %b , %n , %n , %n ,%n, %n,%n,%n,%n,%n )", " VALUES( %n , %D , %n , %n , %n , %n , %n , %n , %n , %n , %n , %n , %b , %n , %b , %b , %n , %n , %s , %s , %n , %n , %D , %n , %D , %b , %n , %n , %n ,%n, %n,%n,%n,%n )",
item.ID, item.EffectDate, item.NodeID, item.GrossSalary, item.BasicSalary, item.ID, item.EffectDate, item.NodeID, item.GrossSalary, item.BasicSalary,
item.GradeID, item.CategoryID, item.GradeID, item.CategoryID,
item.CompanyID, item.FunctionID, item.CompanyID, item.FunctionID,
@ -37,7 +37,7 @@ namespace HRM.DA
item.Description, item.EmployeeStatus, DataReader.GetNullValue(item.CreatedBy, 0), item.Description, item.EmployeeStatus, DataReader.GetNullValue(item.CreatedBy, 0),
item.CreatedDate, item.Sequence, item.SalaryMonth, item.IsCurrentMonthIncluded, item.CreatedDate, item.Sequence, item.SalaryMonth, item.IsCurrentMonthIncluded,
item.CostCenterID, item.GradeSalaryAssesmentID, item.CostCenterID, item.GradeSalaryAssesmentID,
item.EmployeeCCID, item.IncrementNo, DataReader.GetNullValue(item.PayrollTypeID, 0), DataReader.GetNullValue(item.ComplainID, 0), DataReader.GetNullValue(item.PunishmentID, 0), item.ApprovalStatus, item.PFPercentage); item.EmployeeCCID, item.IncrementNo, DataReader.GetNullValue(item.PayrollTypeID, 0), DataReader.GetNullValue(item.ComplainID, 0), DataReader.GetNullValue(item.PunishmentID, 0), item.ApprovalStatus);
//1 //2 //3 //4 //5 //6 //7 //8 //9 //10 //11 //12 //13 //14 //15 //16 //17 //18 //19 //20 //21 //21 //22 //23 //24 //25 //1 //2 //3 //4 //5 //6 //7 //8 //9 //10 //11 //12 //13 //14 //15 //16 //17 //18 //19 //20 //21 //21 //22 //23 //24 //25
} }
@ -49,7 +49,7 @@ namespace HRM.DA
{ {
tc.ExecuteNonQuery(@"UPDATE EmpLifeCycle set EffectDate=%D,NodeID=%n,GrossSalary=%n,BasicSalary=%n,GradeID=%n,CategoryID=%n,CompanyID=%n,FunctionID=%n,DesignationID=%n, tc.ExecuteNonQuery(@"UPDATE EmpLifeCycle set EffectDate=%D,NodeID=%n,GrossSalary=%n,BasicSalary=%n,GradeID=%n,CategoryID=%n,CompanyID=%n,FunctionID=%n,DesignationID=%n,
LocationID=%n,DepartmentID=%n,IsConfirm=%b,pFMemberType=%n,IsDiscontinue=%b,IsContinue=%b,EmployeeID=%n,StatusDetailID=%n,Remarks=%s,Description=%s,Status=%n,CreatedBy=%n, CreationDate=%D, LocationID=%n,DepartmentID=%n,IsConfirm=%b,pFMemberType=%n,IsDiscontinue=%b,IsContinue=%b,EmployeeID=%n,StatusDetailID=%n,Remarks=%s,Description=%s,Status=%n,CreatedBy=%n, CreationDate=%D,
SequenceNo=%n,SalaryMonth=%D,IsCurrentMonthIncluded=%b,CostCenterID=%n,GradeSalaryAssesmentID=%n,EmployeeCCID=%n,IncrementNo=%n,PayrollTypeID=%n,ComplainID=%n,PunishmentID=%n,ApprovalStatus=%n,PFPercentage=%n SequenceNo=%n,SalaryMonth=%D,IsCurrentMonthIncluded=%b,CostCenterID=%n,GradeSalaryAssesmentID=%n,EmployeeCCID=%n,IncrementNo=%n,PayrollTypeID=%n,ComplainID=%n,PunishmentID=%n,ApprovalStatus=%n
WHERE EmpLifeCycleID=%n", item.EffectDate, item.NodeID, item.GrossSalary, item.BasicSalary, WHERE EmpLifeCycleID=%n", item.EffectDate, item.NodeID, item.GrossSalary, item.BasicSalary,
item.GradeID, item.CategoryID, item.GradeID, item.CategoryID,
item.CompanyID, item.FunctionID, item.CompanyID, item.FunctionID,
@ -59,7 +59,7 @@ WHERE EmpLifeCycleID=%n", item.EffectDate, item.NodeID, item.GrossSalary, item.B
item.Description, item.EmployeeStatus, DataReader.GetNullValue(item.CreatedBy, 0), item.Description, item.EmployeeStatus, DataReader.GetNullValue(item.CreatedBy, 0),
item.CreatedDate, item.Sequence, item.SalaryMonth, item.IsCurrentMonthIncluded, item.CreatedDate, item.Sequence, item.SalaryMonth, item.IsCurrentMonthIncluded,
item.CostCenterID, item.GradeSalaryAssesmentID, item.CostCenterID, item.GradeSalaryAssesmentID,
item.EmployeeCCID, item.IncrementNo, DataReader.GetNullValue(item.PayrollTypeID, 0), DataReader.GetNullValue(item.ComplainID, 0), DataReader.GetNullValue(item.PunishmentID, 0), item.ApprovalStatus, item.PFPercentage, item.ID); item.EmployeeCCID, item.IncrementNo, DataReader.GetNullValue(item.PayrollTypeID, 0), DataReader.GetNullValue(item.ComplainID, 0), DataReader.GetNullValue(item.PunishmentID, 0), item.ApprovalStatus, item.ID);
} }
public static void UpdateApprovalStatus(TransactionContext tc, EmpLifeCycle item) public static void UpdateApprovalStatus(TransactionContext tc, EmpLifeCycle item)

View File

@ -318,12 +318,6 @@ namespace HRM.DA
} }
public static void UpdatePFPercentage(TransactionContext tc, int EmployeeID, double pfPercentage)
{
tc.ExecuteNonQuery("UPDATE Employee SET PFPercentage=%n WHERE EmployeeID=%n",
pfPercentage, EmployeeID);
}
public static void UpdateEndofContact(TransactionContext tc, int EmployeeID, DateTime dt) public static void UpdateEndofContact(TransactionContext tc, int EmployeeID, DateTime dt)
{ {
tc.ExecuteNonQuery("UPDATE Employee SET ENDOFCONTRACTDATE= %d WHERE EmployeeID=%n", tc.ExecuteNonQuery("UPDATE Employee SET ENDOFCONTRACTDATE= %d WHERE EmployeeID=%n",

View File

@ -1,319 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using Ease.Core.DataAccess;
using Ease.Core.DataAccess.SQL;
using HRM.BO;
using Microsoft.Data.SqlClient;
namespace HRM.DA
{
#region LFAPaymentDA
internal class LFAPaymentDA
{
#region Constructor
private LFAPaymentDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, LFAPayment item)
{
tc.ExecuteNonQuery(
"INSERT INTO LFAPayment(LFAPaymentID, BatchNumber, PayrollTypeID, SalaryMonth, LFAYear, PaymentDate," +
" Remarks, IsTaxUpdated, WFStatus, ApprovedBy, ApprovedDate, CreatedBy, CreationDate)" +
" VALUES(%n, %s, %n, %d, %d, %d, %u, %b, %n, %n, %D, %n, %D)",
item.ID, item.BatchNumber, item.PayrollTypeID, item.SalaryMonth, item.LFAYear, item.PaymentDate,
item.Remarks, item.IsTaxUpdated, (int?)item.WFStatus, item.ApprovedBy,
DataReader.GetNullValue(item.ApprovedDate), item.CreatedBy, item.CreatedDate);
}
#endregion
#region Update / Delete function
/// <summary>Stamps who changed the batch (some of its employees were undone).</summary>
internal static void UpdateModified(TransactionContext tc, int lfaPaymentID, int modifiedBy, DateTime modifiedDate)
{
tc.ExecuteNonQuery("UPDATE LFAPayment SET ModifiedBy=%n, ModifiedDate=%D WHERE LFAPaymentID=%n",
modifiedBy, modifiedDate, lfaPaymentID);
}
/// <summary>Sets the batch's approval status (Not_yet_Initiated while it is in the workflow), as SalaryProcess.WFStatus.</summary>
internal static void UpdateWFStatus(TransactionContext tc, int lfaPaymentID, enumwfStatus? wfStatus)
{
tc.ExecuteNonQuery("UPDATE LFAPayment SET WFStatus=%n WHERE LFAPaymentID=%n", (int?)wfStatus, lfaPaymentID);
}
/// <summary>The batch is approved: Direct Approve, or the last approver of the workflow.</summary>
internal static void Approve(TransactionContext tc, int lfaPaymentID, int approvedBy, DateTime approvedDate)
{
tc.ExecuteNonQuery("UPDATE LFAPayment SET WFStatus=%n, ApprovedBy=%n, ApprovedDate=%D WHERE LFAPaymentID=%n",
(int)enumwfStatus.Approve, approvedBy, approvedDate, lfaPaymentID);
}
/// <summary>
/// Deletes the approval workflow of an undone batch (WFTYPE 33 steps, their approvers and notifications).
/// Batch IDs are reused (MAX + 1), so an old workflow must never stay behind for a new batch to inherit.
/// </summary>
internal static void DeleteWorkflow(TransactionContext tc, int lfaPaymentID)
{
const string trans = "SELECT WFMOVEMENTTRANID FROM WFMOVEMENTTRAN WHERE WFTYPEID=%n AND OBJECTID=%n";
tc.ExecuteNonQuery("DELETE FROM WFMOVEMENTTASK WHERE WFMOVEMENTTRANID IN (" + trans + ")",
LFAPaymentApproval.WFTypeID, lfaPaymentID);
tc.ExecuteNonQuery("DELETE FROM WFMOVEMENTNEXT WHERE WFMOVEMENTTRANID IN (" + trans + ")",
LFAPaymentApproval.WFTypeID, lfaPaymentID);
tc.ExecuteNonQuery("DELETE FROM WFMOVEMENTTRAN WHERE WFTYPEID=%n AND OBJECTID=%n",
LFAPaymentApproval.WFTypeID, lfaPaymentID);
}
/// <summary>Deletes the batch header; its detail rows must be deleted first.</summary>
internal static void Delete(TransactionContext tc, int lfaPaymentID)
{
tc.ExecuteNonQuery("DELETE FROM LFAPayment WHERE LFAPaymentID=%n", lfaPaymentID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM LFAPayment WHERE LFAPaymentID=%n", nID);
}
/// <summary>
/// The batch, locked until the transaction ends: an approval or a second undo of the same batch
/// waits instead of running at the same time.
/// </summary>
internal static IDataReader GetForUpdate(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM LFAPayment WITH (UPDLOCK, ROWLOCK) WHERE LFAPaymentID=%n", nID);
}
/// <summary>
/// LFA Payment Undo and Approval: every batch of the payroll type with its head count, total and approval
/// workflow state (latest step, who has it now, whether it is back with the initiator), newest first.
/// </summary>
internal static IDataReader GetBatches(TransactionContext tc, int payrollTypeID)
{
return tc.ExecuteReader(
@"SELECT p.LFAPaymentID, p.BatchNumber, p.SalaryMonth, p.LFAYear, p.PaymentDate, p.Remarks, p.WFStatus,
p.IsTaxUpdated, p.CreationDate, ISNULL(u.UserName, u.LoginID) AS CreatedByName,
p.ApprovedDate, ISNULL(ua.UserName, ua.LoginID) AS ApprovedByName,
ISNULL(s.HeadCount, 0) AS HeadCount,
ISNULL(s.TotalAmount, 0) AS TotalAmount,
lt.WFMOVEMENTTRANID AS WFMovementTranID, lt.UNIQUENUMBER AS UniqueNumber,
CASE WHEN EXISTS (SELECT 1 FROM WFMOVEMENTNEXT n
WHERE n.WFMOVEMENTTRANID = lt.WFMOVEMENTTRANID AND n.STATUS = %n
AND n.EMPLOYEEID = it.InitiatorEmpID) THEN 1 ELSE 0 END AS IsAtInitiator,
STUFF((SELECT ', ' + e.NAME + ' [' + e.EMPLOYEENO + ']'
FROM WFMOVEMENTNEXT n INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = n.EMPLOYEEID
WHERE n.WFMOVEMENTTRANID = lt.WFMOVEMENTTRANID AND n.STATUS = %n
FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 2, '') AS PendingWith
FROM LFAPayment p
LEFT JOIN (SELECT dt.LFAPaymentID, COUNT(*) AS HeadCount, SUM(dt.Amount) AS TotalAmount
FROM LFAPaymentDetail dt GROUP BY dt.LFAPaymentID) s ON s.LFAPaymentID = p.LFAPaymentID
LEFT JOIN Users u ON u.UserID = p.CreatedBy
LEFT JOIN Users ua ON ua.UserID = p.ApprovedBy
OUTER APPLY (SELECT TOP 1 t.WFMOVEMENTTRANID, t.UNIQUENUMBER FROM WFMOVEMENTTRAN t
WHERE t.WFTYPEID = %n AND t.OBJECTID = p.LFAPaymentID
ORDER BY t.WFMOVEMENTTRANID DESC) lt
OUTER APPLY (SELECT TOP 1 f.FROMEMPLOYEEID AS InitiatorEmpID FROM WFMOVEMENTTRAN f
WHERE f.UNIQUENUMBER = lt.UNIQUENUMBER ORDER BY f.WFMOVEMENTTRANID) it
WHERE p.PayrollTypeID=%n
ORDER BY p.PaymentDate DESC, p.LFAPaymentID DESC",
(int)EnumwfStatus.Received, (int)EnumwfStatus.Received,
LFAPaymentApproval.WFTypeID, payrollTypeID);
}
/// <summary>
/// The approval workflow state of one batch: its latest step (WFMovementTranID, UniqueNumber), the
/// employee who submitted it (InitiatorEmpID) and whether it is back with them now (IsAtInitiator).
/// No row when the batch was never submitted.
/// </summary>
internal static IDataReader GetWorkflowState(TransactionContext tc, int lfaPaymentID)
{
return tc.ExecuteReader(
@"SELECT lt.WFMOVEMENTTRANID AS WFMovementTranID, lt.UNIQUENUMBER AS UniqueNumber, it.InitiatorEmpID,
CASE WHEN EXISTS (SELECT 1 FROM WFMOVEMENTNEXT n
WHERE n.WFMOVEMENTTRANID = lt.WFMOVEMENTTRANID AND n.STATUS = %n
AND n.EMPLOYEEID = it.InitiatorEmpID) THEN 1 ELSE 0 END AS IsAtInitiator
FROM (SELECT TOP 1 t.WFMOVEMENTTRANID, t.UNIQUENUMBER FROM WFMOVEMENTTRAN t
WHERE t.WFTYPEID = %n AND t.OBJECTID = %n ORDER BY t.WFMOVEMENTTRANID DESC) lt
OUTER APPLY (SELECT TOP 1 f.FROMEMPLOYEEID AS InitiatorEmpID FROM WFMOVEMENTTRAN f
WHERE f.UNIQUENUMBER = lt.UNIQUENUMBER ORDER BY f.WFMOVEMENTTRANID) it",
(int)EnumwfStatus.Received, LFAPaymentApproval.WFTypeID, lfaPaymentID);
}
/// <summary>
/// True when the employee is a pending approver of this step and the step is still the latest one of
/// its workflow (an approver who already acted, or a step that moved on, cannot act again).
/// </summary>
internal static bool IsPendingApprover(TransactionContext tc, int wfMovementTranID, int employeeID)
{
object found = tc.ExecuteScalar(
@"SELECT COUNT(*) FROM WFMOVEMENTTRAN t
INNER JOIN WFMOVEMENTNEXT n ON n.WFMOVEMENTTRANID = t.WFMOVEMENTTRANID
WHERE t.WFMOVEMENTTRANID = %n AND t.WFTYPEID = %n AND n.EMPLOYEEID = %n AND n.STATUS = %n
AND t.WFMOVEMENTTRANID = (SELECT MAX(x.WFMOVEMENTTRANID) FROM WFMOVEMENTTRAN x
WHERE x.UNIQUENUMBER = t.UNIQUENUMBER)",
wfMovementTranID, LFAPaymentApproval.WFTypeID, employeeID, (int)EnumwfStatus.Received);
return found != null && found != DBNull.Value && Convert.ToInt32(found) > 0;
}
/// <summary>The highest running number of the batches that start with this prefix; 0 = none yet.</summary>
internal static int GetLastBatchNo(TransactionContext tc, int payrollTypeID, string batchPrefix)
{
object last = tc.ExecuteScalar(
"SELECT MAX(CAST(SUBSTRING(BatchNumber, %n, 20) AS INT)) FROM LFAPayment" +
" WHERE PayrollTypeID=%n AND LEFT(BatchNumber, %n)=%s",
batchPrefix.Length + 1, payrollTypeID, batchPrefix.Length, batchPrefix);
return last == null || last == DBNull.Value ? 0 : Convert.ToInt32(last);
}
/// <summary>
/// The same, holding the payroll type's batches until the transaction ends: two users processing at
/// the same time then wait for each other instead of taking the same number or the same employee.
/// </summary>
internal static int GetLastBatchNoForUpdate(TransactionContext tc, int payrollTypeID, string batchPrefix)
{
object last = tc.ExecuteScalar(
"SELECT MAX(CAST(SUBSTRING(BatchNumber, %n, 20) AS INT)) FROM LFAPayment WITH (UPDLOCK, HOLDLOCK)" +
" WHERE PayrollTypeID=%n AND LEFT(BatchNumber, %n)=%s",
batchPrefix.Length + 1, payrollTypeID, batchPrefix.Length, batchPrefix);
return last == null || last == DBNull.Value ? 0 : Convert.ToInt32(last);
}
/// <summary>
/// Everything the LFA calculation needs of the given Employee Nos, whatever their payroll type and
/// status (the caller says why one cannot be paid). The numbers go in as one parameter, as in
/// EmployeeDA.GetByEmpIDList (STRING_SPLIT, SQL Server 2016+).
/// - joining salary: the employee's first salary record;
/// (the 31 December basic comes from EmployeeGradeSalaryService.GetBasicOnDate, as the bonus uses it);
/// - cost center: the current one with the highest percentage.
/// </summary>
internal static IDataReader GetEmployees(TransactionContext tc, List<string> employeeNos, DateTime lfaYear)
{
// LFAYear is a month end, so "this year" / "last year" are date ranges of the calendar year
DateTime yearStart = new DateTime(lfaYear.Year, 1, 1);
DateTime lastYearStart = yearStart.AddYears(-1);
string sql = SQLParser.MakeSQL(@"SET NOCOUNT ON;
IF OBJECT_ID('tempdb..#lfaEmp') IS NOT NULL DROP TABLE #lfaEmp;
CREATE TABLE #lfaEmp (EmployeeID int NOT NULL PRIMARY KEY);
INSERT INTO #lfaEmp (EmployeeID)
SELECT e.EMPLOYEEID FROM EMPLOYEE e
WHERE e.EMPLOYEENO IN (SELECT value FROM STRING_SPLIT(@employeeNos, ',') WHERE value <> '');
SELECT e.EMPLOYEEID, e.EMPLOYEENO, e.NAME, e.PAYROLLTYPEID, e.STATUS, e.ISCONFIRMED, e.JOININGDATE,
e.DATEOFCONFIRMATION, e.GRADEID, g.DESCRIPTION AS GradeName, e.DESIGNATIONID, ds.NAME AS DesignationName,
e.DEPARTMENTID, d.DESCRIPTION AS DepartmentName, pd.DESCRIPTION AS DivisionName,
cc.COSTCENTERID, e.BRANCHID, e.ACCOUNTNO,
ISNULL(jn.BASICSALARY, 0) AS JoiningBasic,
py.BatchNumber AS PaidBatchNumber,
CASE WHEN pv.LFAPaymentDetailID IS NULL THEN 0 ELSE 1 END AS IsPaidLastYear
FROM #lfaEmp t
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = t.EmployeeID
LEFT JOIN GRADES g ON g.GRADEID = e.GRADEID
LEFT JOIN DESIGNATION ds ON ds.DESIGNATIONID = e.DESIGNATIONID
LEFT JOIN DEPARTMENT d ON d.DEPARTMENTID = e.DEPARTMENTID
LEFT JOIN DEPARTMENT pd ON pd.DEPARTMENTID = d.PARENTID
LEFT JOIN (SELECT s.EMPLOYEEID, s.BASICSALARY,
ROW_NUMBER() OVER (PARTITION BY s.EMPLOYEEID ORDER BY s.EFFECTDATE, s.GRADESALARYID) AS RowNo
FROM GRADESALARYASSIGNMENT s INNER JOIN #lfaEmp x ON x.EmployeeID = s.EMPLOYEEID) jn
ON jn.EMPLOYEEID = e.EMPLOYEEID AND jn.RowNo = 1
LEFT JOIN (SELECT c.EMPLOYEEID, c.COSTCENTERID,
ROW_NUMBER() OVER (PARTITION BY c.EMPLOYEEID ORDER BY c.PERCENTAGE DESC, c.ID DESC) AS RowNo
FROM EMPCOSTCENTER c INNER JOIN #lfaEmp x ON x.EmployeeID = c.EMPLOYEEID
WHERE c.CurrentCC = %b) cc
ON cc.EMPLOYEEID = e.EMPLOYEEID AND cc.RowNo = 1
LEFT JOIN (SELECT dt.EmployeeID, p.BatchNumber
FROM LFAPaymentDetail dt INNER JOIN LFAPayment p ON p.LFAPaymentID = dt.LFAPaymentID
WHERE dt.LFAYear >= %d AND dt.LFAYear < %d) py ON py.EmployeeID = e.EMPLOYEEID
OUTER APPLY (SELECT TOP 1 x.LFAPaymentDetailID FROM LFAPaymentDetail x
WHERE x.EmployeeID = e.EMPLOYEEID AND x.LFAYear >= %d AND x.LFAYear < %d) pv
ORDER BY e.EMPLOYEENO;
DROP TABLE #lfaEmp;",
true, yearStart, yearStart.AddYears(1), lastYearStart, yearStart);
// must be a SqlParameter[]: Ease.Core casts the array to SqlParameter[]
SqlParameter[] parameters =
{
SqlHelperExtension.CreateInParam("@employeeNos", SqlDbType.VarChar, string.Join(",", employeeNos), -1) // varchar(max)
};
return tc.ExecuteReader(CommandType.Text, sql, parameters);
}
/// <summary>
/// Every employee's basic on a date: the latest salary record that starts before it. A copy of
/// EmployeeGradeSalaryDA.GetBasicOnDate, kept for LFA so that it runs in the LFA transaction.
/// </summary>
internal static IDataReader GetBasicOnDate(TransactionContext tc, DateTime effectdate)
{
return tc.ExecuteReader(@"SELECT g.EMPLOYEEID, g.BASICSALARY FROM GRADESALARYASSIGNMENT g
where g.empGradeSalaryid = (select Max(mx.empGradeSalaryid) from GRADESALARYASSIGNMENT mx
where g.EMPLOYEEID = mx.EMPLOYEEID and mx.EFFECTDATE < %d )
order by g.EMPLOYEEID ",
effectdate);
}
/// <summary>Payment History tab: every employee of the batches of the payment date range.</summary>
internal static IDataReader GetHistory(TransactionContext tc, DateTime fromDate, DateTime toDate, int payrollTypeID)
{
return tc.ExecuteReader(
@"SELECT dt.LFAPaymentDetailID, p.BatchNumber, p.PaymentDate, e.EMPLOYEENO, e.NAME, ds.NAME AS DesignationName,
d.DESCRIPTION AS DepartmentName, dt.JoiningDate, dt.BasicSalary, dt.Amount
FROM LFAPayment p
INNER JOIN LFAPaymentDetail dt ON dt.LFAPaymentID = p.LFAPaymentID
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = dt.EmployeeID
LEFT JOIN DESIGNATION ds ON ds.DESIGNATIONID = dt.DesignationID
LEFT JOIN DEPARTMENT d ON d.DEPARTMENTID = dt.DepartmentID
WHERE p.PayrollTypeID=%n AND p.PaymentDate BETWEEN %d AND %d
ORDER BY p.PaymentDate DESC, p.LFAPaymentID DESC, e.EMPLOYEENO",
payrollTypeID, fromDate, toDate);
}
/// <summary>
/// LFA Bank Advice: the employees of one batch with an amount to pay, with the bank account kept on the
/// detail row when the batch was processed. empIDs = joined ints made by the service (empty = whole batch);
/// bankID 0 = every bank.
/// </summary>
internal static DataSet GetBankAdvice(TransactionContext tc, int lfaPaymentID, string empIDs, int bankID, int payrollTypeID)
{
string sql = SQLParser.MakeSQL(
@"SELECT e.EMPLOYEENO, e.NAME, e.EMAILADDRESS, ds.NAME AS DesignationName, d.DESCRIPTION AS DepartmentName,
ISNULL(cc.DESCRIPTION, '') AS CostCenter, dt.AccountNo, ISNULL(bk.NAME, '') AS BankName,
ISNULL(br.NAME, '') AS BranchName, ISNULL(br.ROUTINGNO, '') AS RoutingNo, dt.Amount,
p.BatchNumber, p.PaymentDate, p.LFAYear
FROM LFAPayment p
INNER JOIN LFAPaymentDetail dt ON dt.LFAPaymentID = p.LFAPaymentID
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = dt.EmployeeID
LEFT JOIN DESIGNATION ds ON ds.DESIGNATIONID = dt.DesignationID
LEFT JOIN DEPARTMENT d ON d.DEPARTMENTID = dt.DepartmentID
LEFT JOIN CRG cc ON cc.CRGID = dt.CostCenterID
LEFT JOIN BRANCHES br ON br.BRANCHID = dt.BranchID
LEFT JOIN BANKS bk ON bk.BANKID = br.BANKID
WHERE p.LFAPaymentID=%n AND p.PayrollTypeID=%n AND dt.Amount > 0",
lfaPaymentID, payrollTypeID);
if (!string.IsNullOrEmpty(empIDs))
sql += SQLParser.MakeSQL(" AND dt.EmployeeID IN (%q)", empIDs);
if (bankID > 0)
sql += SQLParser.MakeSQL(" AND br.BANKID=%n", bankID);
sql += " ORDER BY bk.NAME, e.EMPLOYEENO";
return tc.ExecuteDataSet(sql);
}
#endregion
}
#endregion
}

View File

@ -1,133 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
using Microsoft.Data.SqlClient;
namespace HRM.DA
{
#region LFAPaymentDetailDA
internal class LFAPaymentDetailDA
{
#region Constructor
private LFAPaymentDetailDA()
{
}
#endregion
#region Insert function
/// <summary>
/// Inserts every row of a batch in one SqlBulkCopy, inside the caller's transaction (as
/// BonusProcessDA.InsertBulk). IDs must already be set.
/// </summary>
internal static void InsertBulk(TransactionContext tc, List<LFAPaymentDetail> items)
{
if (items == null || items.Count == 0)
return;
// column names exactly as in the table (bulk copy mapping is case-sensitive)
DataTable table = new DataTable("LFAPaymentDetail");
table.Columns.Add("LFAPaymentDetailID", typeof(int));
table.Columns.Add("LFAPaymentID", typeof(int));
table.Columns.Add("EmployeeID", typeof(int));
table.Columns.Add("LFAYear", typeof(DateTime));
table.Columns.Add("JoiningDate", typeof(DateTime));
table.Columns.Add("ConfirmationDate", typeof(DateTime));
table.Columns.Add("GradeID", typeof(int));
table.Columns.Add("DesignationID", typeof(int));
table.Columns.Add("DepartmentID", typeof(int));
table.Columns.Add("CostCenterID", typeof(int));
table.Columns.Add("BranchID", typeof(int));
table.Columns.Add("AccountNo", typeof(string));
table.Columns.Add("JoiningBasic", typeof(decimal));
table.Columns.Add("LastDecBasic", typeof(decimal));
table.Columns.Add("BasicSalary", typeof(decimal));
table.Columns.Add("CalculatedAmount", typeof(decimal));
table.Columns.Add("Amount", typeof(decimal));
table.Columns.Add("Remarks", typeof(string));
table.Columns.Add("CreatedBy", typeof(int));
table.Columns.Add("CreationDate", typeof(DateTime));
foreach (LFAPaymentDetail item in items)
{
table.Rows.Add(item.ID, item.LFAPaymentID, item.EmployeeID, item.LFAYear, item.JoiningDate,
Null(item.ConfirmationDate), Null(item.GradeID), Null(item.DesignationID), Null(item.DepartmentID),
Null(item.CostCenterID), Null(item.BranchID), Null(item.AccountNo), Null(Money(item.JoiningBasic)),
Null(Money(item.LastDecBasic)), Money(item.BasicSalary), Money(item.CalculatedAmount),
Money(item.Amount), Null(item.Remarks), item.CreatedBy, item.CreatedDate);
}
using (SqlBulkCopy bulkCopy = new SqlBulkCopy((SqlConnection)tc.Connection, SqlBulkCopyOptions.CheckConstraints,
(SqlTransaction)tc.Transaction))
{
bulkCopy.BulkCopyTimeout = 6000; // in seconds
bulkCopy.DestinationTableName = "LFAPaymentDetail";
foreach (DataColumn column in table.Columns)
bulkCopy.ColumnMappings.Add(column.ColumnName, column.ColumnName);
bulkCopy.WriteToServer(table);
}
}
private static object Null(object value)
{
return value ?? DBNull.Value;
}
// money columns: 4 places, as SQL Server rounds a number literal to money
private static decimal? Money(double? value)
{
return value == null ? (decimal?)null : Math.Round((decimal)value.Value, 4, MidpointRounding.AwayFromZero);
}
#endregion
#region Get Function
internal static IDataReader GetByPaymentID(TransactionContext tc, int paymentID)
{
return tc.ExecuteReader("SELECT * FROM LFAPaymentDetail WHERE LFAPaymentID=%n ORDER BY LFAPaymentDetailID", paymentID);
}
/// <summary>LFA Payment Undo: the employees of one batch.</summary>
internal static IDataReader GetBatchEmployees(TransactionContext tc, int paymentID)
{
return tc.ExecuteReader(
@"SELECT dt.LFAPaymentDetailID, dt.EmployeeID, e.EMPLOYEENO, e.NAME, ds.NAME AS DesignationName,
d.DESCRIPTION AS DepartmentName, dt.JoiningDate, dt.BasicSalary, dt.Amount
FROM LFAPaymentDetail dt
INNER JOIN EMPLOYEE e ON e.EMPLOYEEID = dt.EmployeeID
LEFT JOIN DESIGNATION ds ON ds.DESIGNATIONID = dt.DesignationID
LEFT JOIN DEPARTMENT d ON d.DEPARTMENTID = dt.DepartmentID
WHERE dt.LFAPaymentID=%n
ORDER BY e.EMPLOYEENO",
paymentID);
}
#endregion
#region Delete function
/// <summary>Deletes every employee of the batch.</summary>
internal static void DeleteByPaymentID(TransactionContext tc, int paymentID)
{
tc.ExecuteNonQuery("DELETE FROM LFAPaymentDetail WHERE LFAPaymentID=%n", paymentID);
}
/// <summary>Deletes these employees of the batch (IDs the service has already checked).</summary>
internal static void Delete(TransactionContext tc, int paymentID, List<int> detailIDs)
{
// %q: a list of ints joined by this code, never user text
tc.ExecuteNonQuery("DELETE FROM LFAPaymentDetail WHERE LFAPaymentID=%n AND LFAPaymentDetailID IN (%q)",
paymentID, string.Join(",", detailIDs));
}
#endregion
}
#endregion
}

View File

@ -21,20 +21,6 @@ namespace HRM.DA
#endregion #endregion
#region Category employees (Salary Process screen, no employee selected)
// Live employees of the payroll type in the category whose salary of the month is not processed yet
internal static IDataReader GetCategoryEmployeeIDs(TransactionContext tc, int categoryID, int payrollTypeID, DateTime salaryMonth)
{
return tc.ExecuteReader(
"SELECT e.EmployeeID FROM Employee e WHERE e.Status=%n AND e.PayrollTypeID=%n AND e.CategoryID=%n" +
" AND NOT EXISTS (SELECT 1 FROM SalaryMonthly sm WHERE sm.EmployeeID = e.EmployeeID AND sm.SalaryMonth=%d AND sm.PayrollTypeID=%n)" +
" ORDER BY e.EmployeeNo",
(int)EnumEmployeeStatus.Live, payrollTypeID, categoryID, salaryMonth, payrollTypeID);
}
#endregion
#region Insert function #region Insert function
internal static void Insert(TransactionContext tc, SalaryProcess item) internal static void Insert(TransactionContext tc, SalaryProcess item)

View File

@ -185,13 +185,6 @@ namespace HRM.DA
return tc.ExecuteReader(sql); return tc.ExecuteReader(sql);
} }
// Active (Active / Approved) user of the given type - same status rule as login
internal static IDataReader GetActiveByLoginID(TransactionContext tc, string sLogInID, EnumUserType type)
{
return tc.ExecuteReader("SELECT * FROM Users WHERE lower(LOGINID)=%s AND UserType=%n AND (Status=%n OR Status=%n)",
sLogInID.ToLower(), type, EnumAuthStatus.Active, EnumAuthStatus.Approved);
}
internal static IDataReader GetByLoginIDByEmail(TransactionContext tc, string sEmail) internal static IDataReader GetByLoginIDByEmail(TransactionContext tc, string sEmail)
{ {
string sql = SQLParser.MakeSQL(@"SELECT * FROM Users WHERE lower(Email)=%s", sEmail.ToLower()); string sql = SQLParser.MakeSQL(@"SELECT * FROM Users WHERE lower(Email)=%s", sEmail.ToLower());

View File

@ -548,7 +548,6 @@ Union
WHEN WT.wftypeid =30 THEN '/payment-approval/salary' WHEN WT.wftypeid =30 THEN '/payment-approval/salary'
WHEN WT.wftypeid =31 THEN '/payment-approval/bonus' WHEN WT.wftypeid =31 THEN '/payment-approval/bonus'
WHEN WT.wftypeid =32 THEN '/payment-approval/leaveencashment' WHEN WT.wftypeid =32 THEN '/payment-approval/leaveencashment'
WHEN WT.wftypeid =33 THEN '/payment-approval/lfa'
ELSE 'none' END AS link,0 count FROM WFMovementTran WT, WFMovementNext WN ELSE 'none' END AS link,0 count FROM WFMovementTran WT, WFMovementNext WN
WHERE WN.Status = 1 AND WN.EmployeeId = %n AND WT.wftypeid <> 4 WHERE WN.Status = 1 AND WN.EmployeeId = %n AND WT.wftypeid <> 4
AND WT.WFMovementTranID = WN.WFMovementTranID AND WT.WFMovementTranID = WN.WFMovementTranID

View File

@ -51,7 +51,6 @@ namespace HRM.DA
oADParameter.ModifiedBy = oReader.GetInt32("ModifiedBy", 0); oADParameter.ModifiedBy = oReader.GetInt32("ModifiedBy", 0);
oADParameter.ModifiedDate = oReader.GetDateTime("ModifiedDate"); oADParameter.ModifiedDate = oReader.GetDateTime("ModifiedDate");
oADParameter.EntitleType = (EnumEntitleType)oReader.GetInt32("EntitleType").Value; oADParameter.EntitleType = (EnumEntitleType)oReader.GetInt32("EntitleType").Value;
oADParameter.IsOnBalancing = oReader.GetBoolean("isBalancing").Value;
this.SetObjectState(oADParameter, Ease.Core.ObjectState.Saved); this.SetObjectState(oADParameter, Ease.Core.ObjectState.Saved);
} }
@ -939,88 +938,7 @@ namespace HRM.DA
return nAmount; return nAmount;
} }
public double GetGradeDefinedAmountForMonth(Employee employee, double basicSalary,
double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param, int nFrac)
{
ADParameterEmployee adEmp = null;
double nAmount = 0.0;
switch (param.EntitleType)
{
case EnumEntitleType.Grade:
if (param.PercentOfBasic > 0)
nAmount = nAmount + param.FlatAmount * nFrac +
basicSalary * param.PercentOfBasic / 100.0;
//nAmount = basicSalary * this.PercentOfBasic / 100.0;// + this.FlatAmount;
else if (param.PercentOfGross > 0)
nAmount = nAmount + param.FlatAmount * nFrac +
grossSalary * param.PercentOfGross / 100.0;
//nAmount = grossSalary * this.PercentOfGross / 100.0;// + this.FlatAmount;
else
nAmount = param.FlatAmount * nFrac;
//bool IsGradFather = (employee.GrandFather != null && employee.GrandFather.Allowance == true);
//if (IsGradFather == true)
//{
// nAmount = 0;
// if (this.GFPercentOfBasic > 0)
// nAmount = nAmount + this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo + basicSalary * this.GFPercentOfBasic / 100.0;
// //nAmount = basicSalary * this.PercentOfBasic / 100.0;// + this.FlatAmount;
// else if (this.GFPercentOfGross > 0)
// nAmount = nAmount + this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo + grossSalary * this.GFPercentOfGross / 100.0;
// //nAmount = grossSalary * this.PercentOfGross / 100.0;// + this.FlatAmount;
// else
// nAmount = this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo;
//}
if (param.NotApplicable.Exists(x => x.EmployeeID == employee.ID) == true)
{
nAmount = 0;
}
else
{
adEmp = param.Exception.Find(x => x.EmployeeID == employee.ID);
if (adEmp != null)
{
switch (adEmp.ValueType)
{
case EnumValueType.Amount:
nAmount = adEmp.MonthlyAmount * nFrac;
break;
case EnumValueType.Other:
if (param.PercentOfBasic > 0 || adEmp.MonthlyAmount > 0)
nAmount = basicSalary * adEmp.MonthlyAmount /
100.0; //* oEmpGradeSalary.FractionofFromTo; //+ this.FlatAmount;
else if (param.PercentOfGross > 0 || adEmp.MonthlyAmount > 0)
nAmount = grossSalary * adEmp.MonthlyAmount /
100.0; //* oEmpGradeSalary.FractionofFromTo; //+ this.FlatAmount;
break;
}
}
}
break;
case EnumEntitleType.Individual:
throw new Exception("You have choosed the wrong overloaded function to calculate"
+ " Individual Allowance" + " Employee:(" + employee.EmployeeNo + ")" +
employee.Name + "; Item Name:" + param.AllowanceDeduction.Name);
}
if (param.MinAmount != 0 || param.MaxAmount != 0)
{
if (nAmount < param.MinAmount)
{
nAmount = param.MinAmount;
}
if (nAmount > param.MaxAmount)
{
nAmount = param.MaxAmount;
}
}
return nAmount;
}
public double GetGradeDefinedAmount(Employee employee, double basicSalary, public double GetGradeDefinedAmount(Employee employee, double basicSalary,
double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param) double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param)
{ {

View File

@ -21,7 +21,6 @@ namespace HRM.DA
oAllowanceDeduction.Name = oReader.GetString("name"); oAllowanceDeduction.Name = oReader.GetString("name");
oAllowanceDeduction.NameInBangla = oReader.GetString("nameinbangla", true, null); oAllowanceDeduction.NameInBangla = oReader.GetString("nameinbangla", true, null);
oAllowanceDeduction.AllowOrDeductType = (EnumAllowOrDeduct)oReader.GetInt32("allowOrDeduct").Value; oAllowanceDeduction.AllowOrDeductType = (EnumAllowOrDeduct)oReader.GetInt32("allowOrDeduct").Value;
oAllowanceDeduction.AllowanceType = (EnumAllowanceType)oReader.GetInt32("AllowanceType", 0);
oAllowanceDeduction.Sequence = oReader.GetInt32("SequenceNo").Value; oAllowanceDeduction.Sequence = oReader.GetInt32("SequenceNo").Value;
oAllowanceDeduction.Status = (EnumStatus)oReader.GetInt32("Status").Value; oAllowanceDeduction.Status = (EnumStatus)oReader.GetInt32("Status").Value;
//oAllowanceDeduction.Periodicity = (EnumPeriodicity)oReader.GetInt32("Periodicity").Value; //oAllowanceDeduction.Periodicity = (EnumPeriodicity)oReader.GetInt32("Periodicity").Value;

View File

@ -4,7 +4,6 @@ using Ease.Core.DataAccess;
using System.Collections.Generic; using System.Collections.Generic;
using Ease.Core.Utility; using Ease.Core.Utility;
using HRM.BO; using HRM.BO;
using System.Data;
namespace HRM.DA namespace HRM.DA
{ {
@ -12,31 +11,26 @@ namespace HRM.DA
{ {
#region Private functions and declaration #region Private functions and declaration
public ComponentUploadSetupService() { } public ComponentUploadSetupService()
{
}
private void MapObject(ComponentUploadSetup componentSetup, DataReader oReader) private void MapObject(ComponentUploadSetup componentSetup, DataReader oReader)
{ {
base.SetObjectID(componentSetup, oReader.GetInt32("ComponentUploadSetupID", true, 0)); base.SetObjectID(componentSetup, oReader.GetInt32("ComponentUploadSetupID").Value);
componentSetup.EmployeeID = oReader.GetInt32("EmployeeID", true, 0); componentSetup.EmployeeID = oReader.GetInt32("EmployeeID").Value;
componentSetup.ApproverID = oReader.GetInt32("ApproverID", true, 0); componentSetup.ItemID = oReader.GetInt32("ItemID", 0);
componentSetup.ItemID = oReader.GetInt32("ItemID", true, 0); componentSetup.ComponentType = (EnumComponentType)oReader.GetInt32("ComponentType");
componentSetup.ComponentType = (EnumComponentType)oReader.GetInt32("ComponentType", true, 0); componentSetup.Description = oReader.GetString("Description");
componentSetup.Description = oReader.GetString("Description", true, null);
componentSetup.IsDamageManagement = oReader.GetBoolean("IsDamageManagement", true, false);
this.SetObjectState(componentSetup, Ease.Core.ObjectState.Saved); this.SetObjectState(componentSetup, Ease.Core.ObjectState.Saved);
} }
protected override T CreateObject<T>(DataReader oReader) protected override T CreateObject<T>(DataReader oReader)
{ {
ComponentUploadSetup componentSetup = new ComponentUploadSetup(); ComponentUploadSetup componentSetup = new ComponentUploadSetup();
MapObject(componentSetup, oReader); MapObject(componentSetup, oReader);
return componentSetup as T; return componentSetup as T;
} }
private ComponentUploadSetup CreateObject(DataReader oReader)
{
ComponentUploadSetup componentSetup = new ComponentUploadSetup();
MapObject(componentSetup, oReader);
return componentSetup;
}
#endregion #endregion
@ -45,6 +39,7 @@ namespace HRM.DA
public List<ComponentUploadSetup> Get() public List<ComponentUploadSetup> Get()
{ {
List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>(); List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>();
TransactionContext tc = null; TransactionContext tc = null;
try try
{ {
@ -57,45 +52,24 @@ namespace HRM.DA
catch (Exception e) catch (Exception e)
{ {
#region Handle Exception #region Handle Exception
if (tc != null) if (tc != null)
tc.HandleError(); tc.HandleError();
ExceptionLog.Write(e); ExceptionLog.Write(e);
throw new ServiceException(e.Message, e); throw new ServiceException(e.Message, e);
#endregion #endregion
} }
return componentSetups; return componentSetups;
} }
public DataTable GetUploadedComponent(DateTime uploadMonth)
{
DataTable dtUploadedComponent = new DataTable();
List <ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = ComponentUploadSetupDA.GetUploadedComponent(tc, uploadMonth);
dtUploadedComponent = (ds != null && (ds.Tables != null && ds.Tables.Count > 0)) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtUploadedComponent;
}
public List<ComponentUploadSetup> Get(int empid) public List<ComponentUploadSetup> Get(int empid)
{ {
List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>(); List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>();
TransactionContext tc = null; TransactionContext tc = null;
try try
{ {
@ -108,168 +82,50 @@ namespace HRM.DA
catch (Exception e) catch (Exception e)
{ {
#region Handle Exception #region Handle Exception
if (tc != null) if (tc != null)
tc.HandleError(); tc.HandleError();
ExceptionLog.Write(e); ExceptionLog.Write(e);
throw new ServiceException(e.Message, e); throw new ServiceException(e.Message, e);
#endregion #endregion
} }
return componentSetups; return componentSetups;
} }
public List<ComponentUploadSetup> GetByEmpIDandItemID(int empId, int itemId) public int Save(ComponentUploadSetup componentSetup)
{
List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(ComponentUploadSetupDA.GetByEmpIDandItemID(tc, empId, itemId));
componentSetups = this.CreateObjects<ComponentUploadSetup>(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return componentSetups;
}
public List<ComponentUploadSetup> GetByApproverID(int apprvrID)
{
List<ComponentUploadSetup> componentSetups = new List<ComponentUploadSetup>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(ComponentUploadSetupDA.GetByApproverID(tc, apprvrID));
componentSetups = this.CreateObjects<ComponentUploadSetup>(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return componentSetups;
}
public DataTable GetUploadedComponentReportData(DateTime fromDate, DateTime toDate)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = ComponentUploadSetupDA.GetUploadedComponentReportData(tc, fromDate, toDate);
tc.End();
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0].Copy();
return new DataTable();
}
catch (Exception e)
{
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
}
}
public DataTable GetUploadedComponentEmpReportData(DateTime salaryMonth, int componentId, string empIds)
{
DataTable dtComponentSetups = new DataTable();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = ComponentUploadSetupDA.GetUploadedComponentEmpReportData(tc, salaryMonth, componentId, empIds);
dtComponentSetups = (ds != null && (ds.Tables != null && ds.Tables.Count > 0)) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtComponentSetups;
}
public DataTable GetUploadedComponentEmpReportData(DateTime salaryMonth, string empIds)
{
DataTable dtComponentSetups = new DataTable();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = ComponentUploadSetupDA.GetUploadedComponentEmpReportData(tc, salaryMonth, empIds);
dtComponentSetups = (ds != null && (ds.Tables != null && ds.Tables.Count > 0)) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtComponentSetups;
}
public void Save(List<ComponentUploadSetup> componentSetups)
{ {
TransactionContext tc = null; TransactionContext tc = null;
try try
{ {
tc = TransactionContext.Begin(true); tc = TransactionContext.Begin(true);
int id;
foreach (ComponentUploadSetup componentSetup in componentSetups)
{
if (componentSetup.IsNew) if (componentSetup.IsNew)
{ {
id = tc.GenerateID("ComponentUploadSetup", "ComponentUploadSetupID"); int id = tc.GenerateID("ComponentUploadSetup", "ComponentUploadSetupID");
base.SetObjectID(componentSetup, id); base.SetObjectID(componentSetup, (id));
ComponentUploadSetupDA.Insert(tc, componentSetup); ComponentUploadSetupDA.Insert(tc, componentSetup);
} }
else else
{ {
ComponentUploadSetupDA.Update(tc, componentSetup); ComponentUploadSetupDA.Update(tc, componentSetup);
} }
}
tc.End(); tc.End();
return componentSetup.ID;
} }
catch (Exception e) catch (Exception e)
{ {
#region Handle Exception #region Handle Exception
if (tc != null) if (tc != null)
tc.HandleError(); tc.HandleError();
ExceptionLog.Write(e); ExceptionLog.Write(e);
throw new Exception("Failed to Component Upload Setup. Because " + e.Message, e); throw new Exception("Failed to Component Upload Setup. Because " + e.Message, e);
#endregion #endregion
} }
} }
public void Delete(int id) public void Delete(int id)
@ -284,182 +140,44 @@ namespace HRM.DA
catch (Exception e) catch (Exception e)
{ {
#region Handle Exception #region Handle Exception
if (tc != null) if (tc != null)
tc.HandleError(); tc.HandleError();
ExceptionLog.Write(e); ExceptionLog.Write(e);
throw new ServiceException(e.Message, e); throw new ServiceException(e.Message, e);
#endregion #endregion
} }
} }
public void DeleteSingleComponent(ComponentUploadSetup oComponentUploadSetup) public bool IsExist(int empId, EnumComponentType ComponentType, int itemId)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
ComponentUploadSetupDA.DeleteSingleComponent(tc, oComponentUploadSetup.EmployeeID, oComponentUploadSetup.ApproverID, oComponentUploadSetup.ComponentType, oComponentUploadSetup.ItemID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
public bool IsExist(int empId, int apprvrId, EnumComponentType componentType, int itemId)
{ {
bool exist = false; bool Exist = false;
TransactionContext tc = null; TransactionContext tc = null;
try try
{ {
tc = TransactionContext.Begin(); tc = TransactionContext.Begin();
exist = ComponentUploadSetupDA.IsExist(tc, empId, apprvrId, componentType, itemId);
Exist = ComponentUploadSetupDA.IsExist(tc, empId, ComponentType, itemId);
tc.End(); tc.End();
} }
catch (Exception e) catch (Exception e)
{ {
#region Handle Exception #region Handle Exception
if (tc != null) if (tc != null)
tc.HandleError(); tc.HandleError();
ExceptionLog.Write(e); ExceptionLog.Write(e);
throw new ServiceException(e.Message, e); throw new ServiceException(e.Message, e);
#endregion #endregion
} }
return exist;
}
/// <summary>The employee is the approver of at least one component upload setup.</summary> return Exist;
public bool HasApproverSetup(int approverId)
{
bool exist = false;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
exist = ComponentUploadSetupDA.HasApproverSetup(tc, approverId);
tc.End();
} }
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return exist;
}
/// <summary>The employee has at least one component upload setup (may upload components).</summary>
public bool HasUploaderSetup(int employeeId)
{
bool exist = false;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
exist = ComponentUploadSetupDA.HasUploaderSetup(tc, employeeId);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return exist;
}
public List<ComponentUploadSetup> LoadComponentType(int payrollTypeID)
{
List<ComponentUploadSetup> oComponentUploadSetups = new List<ComponentUploadSetup>();
ComponentUploadSetup oallance = null;
ComponentUploadSetup odeduction = null;
ComponentUploadSetup oterm = null;
ComponentUploadSetup obonus = null;
ComponentUploadSetup oloan = null;
ComponentUploadSetup opiItem = null;
ComponentUploadSetup opf = null;
List<AllowanceDeduction> allowances = new AllowanceDeductionService().GetAllowance(EnumStatus.Regardless, payrollTypeID);
foreach (AllowanceDeduction item in allowances)
{
oallance = new ComponentUploadSetup();
oallance.ComponentType = EnumComponentType.Allowance;
oallance.Description = item.Name;
oallance.ItemID = item.ID;
oComponentUploadSetups.Add(oallance);
}
List<AllowanceDeduction> deductions = new AllowanceDeductionService().GetDeduction(EnumStatus.Regardless, payrollTypeID);
foreach (AllowanceDeduction item in deductions)
{
odeduction = new ComponentUploadSetup();
odeduction.ComponentType = EnumComponentType.Deduction;
odeduction.Description = item.Name;
odeduction.ItemID = item.ID;
oComponentUploadSetups.Add(odeduction);
}
List<Term> terms = new TermService().Get(EnumStatus.Regardless, payrollTypeID);
foreach (Term item in terms)
{
oterm = new ComponentUploadSetup();
oterm.ComponentType = EnumComponentType.OverTime;
oterm.Description = item.Name;
oterm.ItemID = item.ID;
oComponentUploadSetups.Add(oterm);
}
List<Bonus> bonuss = new BonusService().Get(EnumStatus.Regardless, payrollTypeID);
foreach (Bonus item in bonuss)
{
obonus = new ComponentUploadSetup();
obonus.ComponentType = EnumComponentType.Bonus;
obonus.Description = item.Name;
obonus.ItemID = item.ID;
oComponentUploadSetups.Add(obonus);
}
List<Loan> loans = new LoanService().Get(EnumStatus.Regardless);
foreach (Loan item in loans)
{
oloan = new ComponentUploadSetup();
oloan.ComponentType = EnumComponentType.Loan;
oloan.Description = item.Name;
oloan.ItemID = item.ID;
oComponentUploadSetups.Add(oloan);
}
List<OpiItem> opiItems = new OpiItemService().Get(EnumStatus.Regardless, payrollTypeID);
foreach (OpiItem item in opiItems)
{
opiItem = new ComponentUploadSetup();
opiItem.ComponentType = EnumComponentType.OPI;
opiItem.Description = item.Name;
opiItem.ItemID = item.ID;
oComponentUploadSetups.Add(opiItem);
}
opf = new ComponentUploadSetup();
opf.ComponentType = EnumComponentType.PF;
opf.Description = "PF";
opf.ItemID = (int)EnumComponentType.PF;
oComponentUploadSetups.Add(opf);
return oComponentUploadSetups;
}
#endregion #endregion
} }

View File

@ -1,568 +0,0 @@
using Ease.Core.DataAccess;
using Ease.Core.Model;
using Ease.Core.Utility;
using HRM.BO;
using Microsoft.AspNetCore.Http.HttpResults;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HRM.DA
{
public class UploadedComponentService : ServiceTemplate, IUploadedComponentService
{
#region Sevice Head
private void MapUploadedComponentObject(UploadedComponent component, DataReader oReader)
{
base.SetObjectID(component, oReader.GetInt32("UploadedComponentID", true, 0));
component.SalaryMonth = oReader.GetDateTime("SalaryMonth", true, DateTime.MinValue);
component.ComponentID = oReader.GetInt32("ComponentID", true, 0);
component.ComponentType = (EnumComponentType)oReader.GetInt32("ComponentType", true, 0);
component.UploadedBy = oReader.GetInt32("UploadedBy", true, 0);
component.UploadedDate = oReader.GetDateTime("UploadedDate", true, DateTime.MinValue);
component.ApprovedBy = oReader.GetInt32("ApprovedBy", true, 0);
component.ApprovedDate = oReader.GetDateTime("ApprovedDate", true, DateTime.MinValue);
component.IsDamageManagement = oReader.GetBoolean("IsDamageManagement", true, false);
this.SetObjectState(component, Ease.Core.ObjectState.Saved);
}
private void MapUploadedComponentEmpObject(UploadedComponentEmp componentEmp, DataReader oReader)
{
base.SetObjectID(componentEmp, oReader.GetInt32("UploadedComponentEmpID", true, 0));
componentEmp.UploadedComponentID = oReader.GetInt32("UploadedComponentID", true, 0);
componentEmp.EmployeeID = oReader.GetInt32("EmployeeID", true, 0);
componentEmp.Amount = oReader.GetDouble("Amount", true, 0);
componentEmp.Reason = oReader.GetString("Reason", true, string.Empty);
componentEmp.TotalAmount = oReader.GetDouble("TotalAmount", true, 0);
componentEmp.DeductionMonth = oReader.GetDateTime("DeductionMonth", true, DateTime.MinValue);
componentEmp.DeductionAmount = oReader.GetDouble("DeductionAmount", true, 0);
componentEmp.Remarks = oReader.GetString("Remarks", true, string.Empty);
componentEmp.CreatedDate = oReader.GetDateTime("CreatedDate", true, DateTime.MinValue);
componentEmp.ModifiedDate = oReader.GetDateTime("ModifiedDate", true, DateTime.MinValue);
this.SetObjectState(componentEmp, Ease.Core.ObjectState.Saved);
}
protected override T CreateObject<T>(DataReader oReader)
{
UploadedComponent component = new UploadedComponent();
MapUploadedComponentObject(component, oReader);
return component as T;
}
private UploadedComponent CreateObject(DataReader oReader)
{
UploadedComponent component = new UploadedComponent();
MapUploadedComponentObject(component, oReader);
return component;
}
private List<UploadedComponentEmp> CreateChilds(DataReader oReader)
{
List<UploadedComponentEmp> components = new List<UploadedComponentEmp>();
UploadedComponentEmp component;
while (oReader.Read())
{
component = new UploadedComponentEmp();
component = CreateChild(oReader);
components.Add(component);
}
return components;
}
private UploadedComponentEmp CreateChild(DataReader oReader)
{
UploadedComponentEmp component = new UploadedComponentEmp();
MapUploadedComponentEmpObject(component, oReader);
return component;
}
#endregion
#region Service implementation
public void Save(UploadedComponent component)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
if (component.IsNew)
{
int uploadedComponentID;
int uploadedComponentEmpID;
uploadedComponentID = tc.GenerateID("UploadedComponent", "UploadedComponentID");
base.SetObjectID(component, uploadedComponentID);
UploadedComponentDA.Insert(tc, component);
foreach (UploadedComponentEmp item in component.UploadedComponentEmps)
{
uploadedComponentEmpID = tc.GenerateID("UploadedComponentEmp", "UploadedComponentEmpID");
base.SetObjectID(item, uploadedComponentEmpID);
item.CreatedDate = DateTime.Today;
item.UploadedComponentID = component.ID;
UploadedComponentDA.InsertUploadedComponentEmp(tc, item);
}
}
else
{
UploadedComponentDA.Update(tc, component);
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
public void SaveTC(UploadedComponent component, TransactionContext tc)
{
try
{
if (component.IsNew)
{
int uploadedComponentID;
int uploadedComponentEmpID;
uploadedComponentID = tc.GenerateID("UploadedComponent", "UploadedComponentID");
base.SetObjectID(component, uploadedComponentID);
UploadedComponentDA.Insert(tc, component);
foreach (UploadedComponentEmp item in component.UploadedComponentEmps)
{
uploadedComponentEmpID = tc.GenerateID("UploadedComponentEmp", "UploadedComponentEmpID");
base.SetObjectID(item, uploadedComponentEmpID);
item.CreatedDate = DateTime.Today;
item.UploadedComponentID = component.ID;
UploadedComponentDA.InsertUploadedComponentEmp(tc, item);
}
}
else
{
UploadedComponentDA.Update(tc, component);
}
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
/// <summary>The ADParameter of the allowance/deduction that covers the grade; 0 when there is none.</summary>
private static int GetADParameterID(int gradeID, int allowDeductID)
{
int id = 0;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UploadedComponentDA.GetADParamByGradeAndAD(tc, gradeID, allowDeductID));
if (dr.Read())
id = dr.GetInt32("ADPARAMETERID", true, 0);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return id;
}
public void SaveWithADParameter(UploadedComponent component, DateTime salaryMonth)
{
TransactionContext tc = null;
try
{
List<Employee> employees = new EmployeeService().GetAllLive();
List<ADParameterEmployee> _aDParameterEmployees = new List<ADParameterEmployee>();
ADParameterEmployee aDParameterEmployee = null;
foreach (UploadedComponentEmp item in component.UploadedComponentEmps)
{
aDParameterEmployee = new ADParameterEmployee();
int empGradeID = (int)employees.Where(e => e.ID == item.EmployeeID).Select(g => g.GradeID).First();
aDParameterEmployee.ADParameterID = GetADParameterID(empGradeID, component.ComponentID);
aDParameterEmployee.Periodicity = EnumPeriodicity.Monthly;
aDParameterEmployee.FormDate = GlobalFunctions.FirstDateOfMonth(salaryMonth);
aDParameterEmployee.TillDate = GlobalFunctions.LastDateOfMonth(salaryMonth);
aDParameterEmployee.MonthlyAmount = item.Amount;
aDParameterEmployee.Arreartype = EnumArrearType.NotPresent;
aDParameterEmployee.EmployeeID = item.EmployeeID;
aDParameterEmployee.AllowDeductID = component.ComponentID;
aDParameterEmployee.CreatedBy = (int)component.ApprovedBy;
aDParameterEmployee.CreatedDate = DateTime.Today;
// approving the upload is the approval of these individual amounts
aDParameterEmployee.ApprovalStatus = EnumAuthStatus.Approved;
_aDParameterEmployees.Add(aDParameterEmployee);
}
if (component.UploadedComponentEmps.Count == _aDParameterEmployees.Count)
{
tc = TransactionContext.Begin(true);
this.SaveTC(component, tc);
foreach (ADParameterEmployee item in _aDParameterEmployees)
{
base.SetObjectID(item, tc.GenerateID("ADParameterEmployee", "ADPARAMETEREMPID"));
ADParameterEmployeeDA.Insert(tc, item);
}
tc.End();
}
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
public List<UploadedComponent> Get(DateTime fromDate, DateTime toDate)
{
List<UploadedComponent> uploadedComponents = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UploadedComponentDA.Get(tc, fromDate, toDate));
uploadedComponents = this.CreateObjects<UploadedComponent>(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return uploadedComponents;
}
public DataTable GetByID(int uploadedComponentID)
{
DataTable dtUploadedComponent = new DataTable();
List <UploadedComponent> uploadedComponents = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = UploadedComponentDA.GetByID_DT(tc, uploadedComponentID);
dtUploadedComponent = (ds != null) && (ds.Tables != null && ds.Tables.Count > 0) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtUploadedComponent;
}
public DataTable GetByIDandUploaderID(int uploadedComponentID, int uploaderId)
{
DataTable dtUploadedComponent = new DataTable();
List<UploadedComponent> uploadedComponents = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = UploadedComponentDA.GetByIDandUploaderID_DT(tc, uploadedComponentID, uploaderId);
dtUploadedComponent = (ds != null) && (ds.Tables != null && ds.Tables.Count > 0) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtUploadedComponent;
}
public List<UploadedComponent> Get(int componentID, int uploaderID, DateTime salaryMonth)
{
List<UploadedComponent> components = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader oreader = new DataReader(UploadedComponentDA.Get(tc, componentID, uploaderID, salaryMonth));
components = this.CreateObjects<UploadedComponent>(oreader);
oreader.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return components;
}
public List<UploadedComponent> Get(int uploaderID, DateTime salaryMonth)
{
List<UploadedComponent> components = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader oreader = new DataReader(UploadedComponentDA.Get(tc, uploaderID, salaryMonth));
components = this.CreateObjects<UploadedComponent>(oreader);
oreader.Close();
tc.End();
if (components.Any())
{
foreach (UploadedComponent uc in components)
{
if (uc.UploadedComponentEmps == null)
uc.UploadedComponentEmps = GetUploadedComponentEmp(uc.ID);
}
}
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return components;
}
public List<UploadedComponent> GetByApprover(int approverID, DateTime salaryMonth)
{
List<UploadedComponent> components = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader oreader = new DataReader(UploadedComponentDA.GetByApprover(tc, approverID, salaryMonth));
components = this.CreateObjects<UploadedComponent>(oreader);
oreader.Close();
tc.End();
if (components.Any())
{
foreach (UploadedComponent uc in components)
{
if (uc.UploadedComponentEmps == null)
uc.UploadedComponentEmps = GetUploadedComponentEmp(uc.ID);
}
}
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return components;
}
public List<UploadedComponent> GetByApprover(int approverID)
{
List<UploadedComponent> components = new List<UploadedComponent>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader oreader = new DataReader(UploadedComponentDA.GetByApprover(tc, approverID));
components = this.CreateObjects<UploadedComponent>(oreader);
oreader.Close();
tc.End();
if (components.Any())
{
foreach (UploadedComponent uc in components)
{
if (uc.UploadedComponentEmps == null)
uc.UploadedComponentEmps = GetUploadedComponentEmp(uc.ID);
}
}
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return components;
}
public DataTable GetByUploaderDT(int empID)
{
DataTable dtUploadedComponent = new DataTable();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataSet ds = UploadedComponentDA.GetByUploaderDT(tc, empID);
dtUploadedComponent = (ds != null) && (ds.Tables != null && ds.Tables.Count > 0) ? ds.Tables[0] : new DataTable();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dtUploadedComponent;
}
public List<UploadedComponentEmp> GetUploadedComponentEmp(int componentID)
{
List<UploadedComponentEmp> componentEmps = new List<UploadedComponentEmp>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UploadedComponentDA.GetUploadedComponentEmp(tc, componentID));
componentEmps = this.CreateChilds(dr);
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return componentEmps;
}
public UploadedComponent GetExistingComponent(int uploaderID, int componentID, EnumComponentType componentType, DateTime salaryMonth)
{
UploadedComponent componentSetup = new UploadedComponent();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(UploadedComponentDA.GetExistingComponent(tc, uploaderID, componentID, componentType, salaryMonth));
if (dr.Read())
{
componentSetup = this.CreateObject(dr);
dr.Close();
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return componentSetup;
}
public void Delete(int uploadedComponentID)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
UploadedComponentDA.DeleteUploadedComponentEmp(tc, uploadedComponentID);
UploadedComponentDA.Delete(tc, uploadedComponentID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
public void DeleteUploadedComponentEmp(int uploadedComponentID)
{
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin(true);
UploadedComponentDA.DeleteUploadedComponentEmp(tc, uploadedComponentID);
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
}
#endregion
}
}

View File

@ -947,24 +947,11 @@ namespace HRM.DA
throw new ServiceException("Nothing to process."); throw new ServiceException("Nothing to process.");
if (request.BonusID <= 0) if (request.BonusID <= 0)
throw new ServiceException("Please select a bonus."); throw new ServiceException("Please select a bonus.");
if (request.EmployeeIDs == null || request.EmployeeIDs.Count == 0)
throw new ServiceException("Please select employee for the proces");
if (request.CurrProcess <= 0) if (request.CurrProcess <= 0)
throw new ServiceException("Currently Process For Basic must be greater than zero."); throw new ServiceException("Currently Process For Basic must be greater than zero.");
// No employee selected: a bonus with Religion(s) set (Bonus master) is processed for every Live
// employee of the current payroll type with one of those religions; without a Religion the
// employees must be selected, as before.
bool byReligion = false;
if (request.EmployeeIDs == null || request.EmployeeIDs.Count == 0)
{
BonusService bonusService = new BonusService();
if (bonusService.GetReligions(request.BonusID).Count == 0)
throw new ServiceException("Please select employee for the process");
request.EmployeeIDs = bonusService.GetReligionEmployeeIDs(request.BonusID, payrolltypeid);
if (request.EmployeeIDs.Count == 0)
throw new ServiceException("Employee not found of this bonus's religion(s).");
byReligion = true;
}
PayrollType payrollType = new PayrollTypeService().Get(payrolltypeid); PayrollType payrollType = new PayrollTypeService().Get(payrolltypeid);
if (payrollType == null) if (payrollType == null)
throw new ServiceException("Payroll type not found."); throw new ServiceException("Payroll type not found.");
@ -986,9 +973,7 @@ namespace HRM.DA
else empIDs.Add(id); else empIDs.Add(id);
} }
if (empIDs.Count == 0) if (empIDs.Count == 0)
throw new ServiceException(byReligion throw new ServiceException("The selected bonus is already processed for all the selected employees.");
? "The selected bonus is already processed for all the employees of its religion(s)."
: "The selected bonus is already processed for all the selected employees.");
List<Employee> employees = new EmployeeService().GetByEmpIDList(empIDs, payrolltypeid); List<Employee> employees = new EmployeeService().GetByEmpIDList(empIDs, payrolltypeid);
if (employees.Count == 0) if (employees.Count == 0)

View File

@ -51,76 +51,6 @@ namespace HRM.DA
return oBonus; return oBonus;
} }
#region BonusReligion
// Replaces the bonus's BonusReligion rows with oBonus.ReligionIDs ("1,3"; "" = none).
private void SaveReligions(TransactionContext tc, Bonus oBonus)
{
BonusDA.DeleteReligions(tc, oBonus.ID);
List<int> religionIDs = new List<int>();
foreach (string part in oBonus.ReligionIDs.Split(','))
{
int religionID;
if (int.TryParse(part.Trim(), out religionID) && religionID > 0 && !religionIDs.Contains(religionID))
religionIDs.Add(religionID);
}
foreach (int religionID in religionIDs)
{
int id = tc.GenerateID("BonusReligion", "BonusReligionID");
BonusDA.InsertReligion(tc, id, oBonus.ID, religionID);
}
FillReligions(tc, oBonus);
}
private void FillReligions(TransactionContext tc, Bonus oBonus)
{
List<string> ids = new List<string>();
List<string> names = new List<string>();
DataReader dr = new DataReader(BonusDA.GetReligions(tc, oBonus.ID));
while (dr.Read())
{
ids.Add(dr.GetInt32("ReligionID").Value.ToString());
names.Add(dr.GetString("Name"));
}
dr.Close();
oBonus.ReligionIDs = string.Join(",", ids);
oBonus.ReligionNames = string.Join(", ", names);
}
private void FillReligions(TransactionContext tc, List<Bonus> bonuses, int payrollTypeID)
{
if (bonuses == null || bonuses.Count == 0)
return;
Dictionary<int, List<string>> ids = new Dictionary<int, List<string>>();
Dictionary<int, List<string>> names = new Dictionary<int, List<string>>();
DataReader dr = new DataReader(BonusDA.GetReligionsByPayrollType(tc, payrollTypeID));
while (dr.Read())
{
int bonusID = dr.GetInt32("BonusID").Value;
if (!ids.ContainsKey(bonusID))
{
ids.Add(bonusID, new List<string>());
names.Add(bonusID, new List<string>());
}
ids[bonusID].Add(dr.GetInt32("ReligionID").Value.ToString());
names[bonusID].Add(dr.GetString("Name"));
}
dr.Close();
foreach (Bonus oBonus in bonuses)
{
oBonus.ReligionIDs = ids.ContainsKey(oBonus.ID) ? string.Join(",", ids[oBonus.ID]) : string.Empty;
oBonus.ReligionNames = names.ContainsKey(oBonus.ID) ? string.Join(", ", names[oBonus.ID]) : string.Empty;
}
}
#endregion
#region Service implementation #region Service implementation
public Bonus Get(int id) public Bonus Get(int id)
@ -138,8 +68,6 @@ namespace HRM.DA
} }
oreader.Close(); oreader.Close();
if (!oBonus.IsNew)
FillReligions(tc, oBonus);
tc.End(); tc.End();
} }
catch (Exception e) catch (Exception e)
@ -169,8 +97,6 @@ namespace HRM.DA
} }
oreader.Close(); oreader.Close();
if (!oBonus.IsNew)
FillReligions(tc, oBonus);
} }
catch (Exception e) catch (Exception e)
{ {
@ -199,7 +125,6 @@ namespace HRM.DA
DataReader dr = new DataReader(BonusDA.Get(tc, status, payrollTypeID)); DataReader dr = new DataReader(BonusDA.Get(tc, status, payrollTypeID));
bonuss = this.CreateObjects<Bonus>(dr); bonuss = this.CreateObjects<Bonus>(dr);
dr.Close(); dr.Close();
FillReligions(tc, bonuss, payrollTypeID);
tc.End(); tc.End();
} }
@ -299,9 +224,6 @@ namespace HRM.DA
BonusDA.Update(tc, oBonus); BonusDA.Update(tc, oBonus);
} }
if (oBonus.ReligionIDs != null)
SaveReligions(tc, oBonus);
tc.End(); tc.End();
return oBonus.ID; return oBonus.ID;
} }
@ -324,7 +246,6 @@ namespace HRM.DA
try try
{ {
tc = TransactionContext.Begin(true); tc = TransactionContext.Begin(true);
BonusDA.DeleteReligions(tc, id);
BonusDA.Delete(tc, id); BonusDA.Delete(tc, id);
tc.End(); tc.End();
} }
@ -371,65 +292,6 @@ namespace HRM.DA
return bonus; return bonus;
} }
// The religions set on this bonus (BonusReligion), as ID + Name.
public List<Religion> GetReligions(int bonusID)
{
List<Religion> religions = new List<Religion>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusDA.GetReligions(tc, bonusID));
while (dr.Read())
{
Religion oReligion = new Religion();
base.SetObjectID(oReligion, dr.GetInt32("ReligionID").Value);
oReligion.Name = dr.GetString("Name");
religions.Add(oReligion);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return religions;
}
// Live employees of the payroll type whose religion is set on the bonus (BonusReligion)
public List<int> GetReligionEmployeeIDs(int bonusID, int payrollTypeID)
{
List<int> employeeIDs = new List<int>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(BonusDA.GetReligionEmployeeIDs(tc, bonusID, payrollTypeID));
while (dr.Read())
{
employeeIDs.Add(dr.GetInt32("EmployeeID").Value);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return employeeIDs;
}
public DataSet GetCCWiseBonusSummary(DateTime bMonthDate, string bonus) public DataSet GetCCWiseBonusSummary(DateTime bMonthDate, string bonus)
{ {
DataSet obonus = new DataSet(); DataSet obonus = new DataSet();

View File

@ -189,25 +189,6 @@ namespace HRM.DA
} }
} }
// PF Percentage column exists only when autopfmembership is on; it is needed when this row makes the employee a Live PF member
if (autopf && odataTable.Columns.Contains("PF Percentage"))
{
string sPFPercentage = dr["PF Percentage"].ToString().Trim();
double pfPercentage = 0;
if (sPFPercentage != string.Empty
&& (!double.TryParse(sPFPercentage, out pfPercentage) || pfPercentage <= 0 || pfPercentage > 100))
{
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("PF Percentage", nRow, "PF Percentage must be greater than 0 and up to 100", oemployee.EmployeeNo, oemployee.Name));
}
else if (oemployee.PFMemberType == EnumPFMembershipType.Live)
{
if (sPFPercentage == string.Empty)
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("PF Percentage", nRow, "PF Percentage can't be empty when Confirmation Date is given", oemployee.EmployeeNo, oemployee.Name));
else
oemployee.PFPercentage = pfPercentage;
}
}
//Refresh Employee Grade Salary //Refresh Employee Grade Salary
if (oemployee.GradeID != null) if (oemployee.GradeID != null)
{ {
@ -860,7 +841,6 @@ namespace HRM.DA
bool isbankCodeAutoGen = Convert.ToBoolean(ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "bank", "codeautogenerate")); bool isbankCodeAutoGen = Convert.ToBoolean(ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "bank", "codeautogenerate"));
bool isbranchCodeAutoGen = Convert.ToBoolean(ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "branch", "codeautogenerate")); bool isbranchCodeAutoGen = Convert.ToBoolean(ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "branch", "codeautogenerate"));
bool isGrossApplicable = ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "grade", "grossapplicable"); bool isGrossApplicable = ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "grade", "grossapplicable");
bool autopf = ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "confirmation", "autopfmembership");
item.SheetName = "EmpBasicInformation"; item.SheetName = "EmpBasicInformation";
@ -903,9 +883,6 @@ namespace HRM.DA
// item.Add("PayScaleID", "String", "Yes"); //15 // item.Add("PayScaleID", "String", "Yes"); //15
item.Add("Confirmation Date", "Date", "Yes"); //17 item.Add("Confirmation Date", "Date", "Yes"); //17
// auto PF membership on confirmation: the employee's own PF % (Employee.PFPercentage)
if (autopf == true)
item.Add("PF Percentage", "Double", "Yes");
item.Add("Basic Salary", "Double", "No"); //16 item.Add("Basic Salary", "Double", "No"); //16
if (isGrossApplicable == true) if (isGrossApplicable == true)
item.Add("Gross Salary", "Double", "No"); //15 item.Add("Gross Salary", "Double", "No"); //15
@ -1100,13 +1077,6 @@ namespace HRM.DA
} }
} }
// PF membership needs the employee's own PF % (Employee.PFPercentage): the event makes the employee a
// Live PF member either through its PF_Member component, or through Confirm when autopfmembership is on
bool autopf = ocManager.GetconfigBooleanValue(EnumConfigurationType.Logic, "confirmation", "autopfmembership");
bool hasPFMember = ostatus.EmployeeStatusComponents.Exists(x => x.ComponentType == EnumLifeCycleComponent.PF_Member);
bool hasConfirm = ostatus.EmployeeStatusComponents.Exists(x => x.ComponentType == EnumLifeCycleComponent.Confirm);
if (hasPFMember || (hasConfirm && autopf))
item.Add("PF Percentage", "Double", "No");
return item; return item;
} }
@ -3209,17 +3179,6 @@ namespace HRM.DA
return item; return item;
} }
#region EssComponentUpload
public DataUploadColumnDefinition EssComponentUpload()
{
DataUploadColumnDefinition item = new DataUploadColumnDefinition();
item.SheetName = "ComponentUpload";
item.Add("Employee No", "String", "YES");
item.Add("Amount", "Double", "YES");
return item;
}
#endregion
#region Coordinator Upload #region Coordinator Upload
public DataUploadColumnDefinition CoOrdinatorInfo() public DataUploadColumnDefinition CoOrdinatorInfo()
{ {
@ -4213,10 +4172,6 @@ namespace HRM.DA
item = this.LineManagerInfo(); item = this.LineManagerInfo();
item.FormText = "Upload Employee Line Manager Information"; item.FormText = "Upload Employee Line Manager Information";
break; break;
case (int)EnumRegularDataUpload.EssComponentUpload:
item = this.EssComponentUpload();
item.FormText = "Upload Component";
break;
case (int)EnumRegularDataUpload.LeaveBalance: case (int)EnumRegularDataUpload.LeaveBalance:
item = this.LeaveBalanceColumnNames(); item = this.LeaveBalanceColumnNames();

View File

@ -526,9 +526,6 @@ namespace HRM.DA
case (int)EnumRegularDataUpload.MemberVoluntaryOpeningBalanceUpload: case (int)EnumRegularDataUpload.MemberVoluntaryOpeningBalanceUpload:
this.ImportMemberVoluntaryOpeningBalance(oColumnDefination); this.ImportMemberVoluntaryOpeningBalance(oColumnDefination);
break; break;
case (int)EnumRegularDataUpload.EssComponentUpload:
this.ImportEssComponentUpload(oColumnDefination, GlobalFunctions.LastDateOfMonth(selecteDate));
break;
default: default:
this.ImportException(uploadId, oColumnDefination); this.ImportException(uploadId, oColumnDefination);
break; break;
@ -5224,9 +5221,6 @@ namespace HRM.DA
int locationid = new MiscellaneousService().GetNextID("location", "locationid", ""); int locationid = new MiscellaneousService().GetNextID("location", "locationid", "");
int designationid = new MiscellaneousService().GetNextID("Designation", "DesignationID", ""); int designationid = new MiscellaneousService().GetNextID("Designation", "DesignationID", "");
int costcenterid = new MiscellaneousService().GetNextID("crg", "crgid", ""); int costcenterid = new MiscellaneousService().GetNextID("crg", "crgid", "");
bool needPFPercentage = ostatus.EmployeeStatusComponents.Exists(x => x.ComponentType == EnumLifeCycleComponent.PF_Member)
|| (ostatus.EmployeeStatusComponents.Exists(x => x.ComponentType == EnumLifeCycleComponent.Confirm)
&& new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "confirmation", "autopfmembership"));
string description = ""; string description = "";
try try
{ {
@ -5663,23 +5657,6 @@ namespace HRM.DA
} }
} }
// PF membership needs the employee's own PF % (Employee.PFPercentage): the event makes the employee a
// Live PF member either through its PF_Member component, or through Confirm when autopfmembership is on
if (needPFPercentage)
{
double pfPercentage = 0;
string sPFPercentage = dr.Table.Columns.Contains("PF Percentage") ? dr["PF Percentage"].ToString().Trim() : "";
if (sPFPercentage == "")
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("PF Percentage", nRow, "(" + dr["Employee No"].ToString() + ")" + "PF Percentage can't be Empty"));
else if (!double.TryParse(sPFPercentage, out pfPercentage) || pfPercentage <= 0 || pfPercentage > 100)
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("PF Percentage", nRow, "(" + dr["Employee No"].ToString() + ")" + "PF Percentage must be greater than 0 and up to 100"));
else
{
lifeCycle.PFPercentage = pfPercentage;
description = description + " PF Percentage " + pfPercentage.ToString() + "%";
}
}
if (lifeCycle.EffectDate.Date < DateTime.Today) if (lifeCycle.EffectDate.Date < DateTime.Today)
{ {
lifeCycle.IsProcessed = null; lifeCycle.IsProcessed = null;
@ -7292,95 +7269,6 @@ namespace HRM.DA
} }
#endregion #endregion
#region Import EssComponentUpload
/// <summary>
/// ESS Upload Component: saves one UploadedComponent (with its employees) for the salary month and mails
/// the approver of the uploader's ComponentUploadSetup. The uploader is the logged-in employee: the
/// controller passes the UserID, so the EmployeeID is read from that user.
/// </summary>
public void ImportEssComponentUpload(DataUploadColumnDefinition _columnDefinition, DateTime salaryMonth)
{
List<Employee> oemployees = new EmployeeService().GetAllEmps();
Employee oemployee = null;
int nRow = 0;
User uploaderUser = new UserService().Get(this._userID);
if (uploaderUser == null || uploaderUser.EmployeeID == null || uploaderUser.EmployeeID <= 0)
throw new ServiceException("Only an employee login can upload a component.");
UploadedComponent uploadedComponent = new UploadedComponent();
uploadedComponent.ComponentID = (int)_columnDefinition.SelectedItemOneID;
uploadedComponent.ComponentType = (EnumComponentType)_columnDefinition.SelectedItemTwoID;
uploadedComponent.SalaryMonth = salaryMonth;
uploadedComponent.UploadedBy = (int)uploaderUser.EmployeeID;
uploadedComponent.UploadedDate = DateTime.Today;
List<UploadedComponentEmp> uploadedEmps = new List<UploadedComponentEmp>();
try
{
foreach (DataRow dr in _uplodedData.Rows)
{
nRow = nRow + 1;
oemployee = oemployees.Find(delegate (Employee emp) { return emp.EmployeeNo == dr["Employee No"].ToString(); });
if (oemployee == null)
{
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("Employee No", nRow, $"[{dr["Employee No"]}] Employee not found"));
continue;
}
if (Convert.ToDouble(dr["Amount"]) <= 0)
{
_errorOrSuccessList.Add(UploadErrorOrSuccess.Create("Amount", nRow, $"[{dr["Amount"]}] Amount cannot be less than 0"));
continue;
}
uploadedEmps.Add(new UploadedComponentEmp
{
EmployeeID = oemployee.ID,
Amount = Convert.ToDouble(dr["Amount"]),
});
}
if (_errorOrSuccessList.Count == 0)
{
uploadedComponent.UploadedComponentEmps = uploadedEmps;
new UploadedComponentService().Save(uploadedComponent);
List<ComponentUploadSetup> comps = new ComponentUploadSetupService().GetByEmpIDandItemID(uploadedComponent.UploadedBy, uploadedComponent.ComponentID);
if (comps != null && comps.Count > 0)
{
Employee approver = new EmployeeService().Get(comps[0].ApproverID);
Employee uploader = new EmployeeService().Get(uploadedComponent.UploadedBy);
// the upload is saved; a missing approver address only skips the mail
if (approver != null && !string.IsNullOrEmpty(approver.EmailAddress))
{
var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder();
Microsoft.Extensions.Configuration.FileConfigurationExtensions.SetBasePath(builder, Directory.GetCurrentDirectory());
Microsoft.Extensions.Configuration.JsonConfigurationExtensions.AddJsonFile(builder, "appsettings.json");
HRM.BO.Configuration.EmailSettings emailSettings = new HRM.BO.Configuration.EmailSettings();
Microsoft.Extensions.Configuration.IConfiguration Configuration = builder.Build();
Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(Configuration.GetSection("EmailSettings"), emailSettings);
MailSender mailSender = new MailSender();
mailSender.AddTo(approver.EmailAddress);
mailSender.Subject = "Approval Needed For Uploaded Component: " + comps[0].Description;
mailSender.Body = $@"<p>Dear {approver.Name},</p>
<p>Component: {comps[0].Description}, has been uploaded by {uploader?.Name} on {DateTime.Now.ToString("dd MMM yyyy hh:mm tt")}.</p>
<p>Your Approval is required.</p>
<p>Thanks</p>";
mailSender.ThreadSendMail(emailSettings);
}
}
}
}
catch (Exception ex)
{
throw new ServiceException("Error occured on row:" + nRow + " Reason:" + ex.Message);
}
}
#endregion
#endregion #endregion
protected override T CreateObject<T>(Ease.Core.DataAccess.DataReader dr) protected override T CreateObject<T>(Ease.Core.DataAccess.DataReader dr)

View File

@ -50,7 +50,6 @@ namespace HRM.DA
oEmployee.PFMemberShiptDate = oReader.GetDateTime("pfMemberShipDt").HasValue oEmployee.PFMemberShiptDate = oReader.GetDateTime("pfMemberShipDt").HasValue
? oReader.GetDateTime("pfMemberShipDt").Value ? oReader.GetDateTime("pfMemberShipDt").Value
: DateTime.Now; : DateTime.Now;
oEmployee.PFPercentage = oReader.GetDouble("PFPercentage", true, 0);
oEmployee.BranchID = oReader.GetInt32("branchID"); oEmployee.BranchID = oReader.GetInt32("branchID");
oEmployee.AccountNo = oReader.GetString("accountNo"); oEmployee.AccountNo = oReader.GetString("accountNo");
oEmployee.OutPayBranchID = oReader.GetInt32("OUTPAYBRANCHID"); oEmployee.OutPayBranchID = oReader.GetInt32("OUTPAYBRANCHID");
@ -1016,38 +1015,6 @@ namespace HRM.DA
return oEmployee; return oEmployee;
} }
public Employee GetByEmpNo(string EmpNo)
{
Employee oEmployee = null;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader oreader = new DataReader(EmployeeDA.Get(tc, EmpNo));
if (oreader.Read())
{
oEmployee = this.CreateObject<Employee>(oreader);
}
oreader.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return oEmployee;
}
public Employee Get(string employeeNo, int payrollTypeID) public Employee Get(string employeeNo, int payrollTypeID)
{ {
Employee oEmployee = null; Employee oEmployee = null;
@ -3460,10 +3427,6 @@ namespace HRM.DA
oEmployee.Name = oEmployee.Name == "" ? "Employee-" + oEmployee.EmployeeNo : oEmployee.Name; oEmployee.Name = oEmployee.Name == "" ? "Employee-" + oEmployee.EmployeeNo : oEmployee.Name;
EmployeeDA.Insert(tc, oEmployee); EmployeeDA.Insert(tc, oEmployee);
// employee's own PF % (from the upload's PF Percentage column), used by SalaryCalculator.PFNEW
if (oEmployee.PFMemberType == EnumPFMembershipType.Live && oEmployee.PFPercentage > 0)
HREmployeeDA.UpdatePFPercentage(tc, oEmployee.ID, oEmployee.PFPercentage);
int id = 0; int id = 0;
if (uploadtype == EnumRegularDataUpload.EmployeeWithBasic || !IsFinantialAprovalRequired) if (uploadtype == EnumRegularDataUpload.EmployeeWithBasic || !IsFinantialAprovalRequired)
@ -3539,8 +3502,6 @@ namespace HRM.DA
oEmployee.EmpLifeCycle.LocationID = oEmployee.LocationID; oEmployee.EmpLifeCycle.LocationID = oEmployee.LocationID;
oEmployee.EmpLifeCycle.CategoryID = oEmployee.CategoryID; oEmployee.EmpLifeCycle.CategoryID = oEmployee.CategoryID;
oEmployee.EmpLifeCycle.IsConfirm = (oEmployee.IsConfirmed == true) ? true : false; oEmployee.EmpLifeCycle.IsConfirm = (oEmployee.IsConfirmed == true) ? true : false;
if (oEmployee.PFMemberType == EnumPFMembershipType.Live && oEmployee.PFPercentage > 0)
oEmployee.EmpLifeCycle.PFPercentage = oEmployee.PFPercentage;
oEmployee.EmpLifeCycle.CreatedBy = oEmployee.CreatedBy; oEmployee.EmpLifeCycle.CreatedBy = oEmployee.CreatedBy;
oEmployee.EmpLifeCycle.CreatedDate = oEmployee.CreatedDate; oEmployee.EmpLifeCycle.CreatedDate = oEmployee.CreatedDate;
oEmployee.EmpLifeCycle.GradeSalaryAssesmentID = oEmployee.EmployeeGradeSalary.ID; oEmployee.EmpLifeCycle.GradeSalaryAssesmentID = oEmployee.EmployeeGradeSalary.ID;

View File

@ -51,8 +51,6 @@ namespace HRM.DA
if (oReader.GetInt32("pFMemberType").HasValue) if (oReader.GetInt32("pFMemberType").HasValue)
oEmpLifeCycle.PFMemberType = (EnumPFMembershipType)oReader.GetInt32("pFMemberType").Value; oEmpLifeCycle.PFMemberType = (EnumPFMembershipType)oReader.GetInt32("pFMemberType").Value;
else oEmpLifeCycle.PFMemberType = null; else oEmpLifeCycle.PFMemberType = null;
double pfPercentage = oReader.GetDouble("PFPercentage", true, 0);
oEmpLifeCycle.PFPercentage = pfPercentage > 0 ? pfPercentage : (double?)null;
oEmpLifeCycle.IsDiscontinue = oReader.GetBoolean("IsDiscontinue"); oEmpLifeCycle.IsDiscontinue = oReader.GetBoolean("IsDiscontinue");
oEmpLifeCycle.IsContinue = oReader.GetBoolean("IsContinue"); oEmpLifeCycle.IsContinue = oReader.GetBoolean("IsContinue");
oEmpLifeCycle.EmployeeID = oReader.GetInt32("EmployeeID").Value; oEmpLifeCycle.EmployeeID = oReader.GetInt32("EmployeeID").Value;
@ -751,12 +749,6 @@ namespace HRM.DA
} }
} }
// Logic XML confirmation/autopfmembership: confirming an employee also makes them a Live PF member
public bool IsAutoPFMembership()
{
return new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "confirmation", "autopfmembership");
}
public void UpdateApprovalStatus(List<EmpLifeCycle> oEmpLifeCycles, int currentPayrollTypeID) public void UpdateApprovalStatus(List<EmpLifeCycle> oEmpLifeCycles, int currentPayrollTypeID)
{ {
TransactionContext tc = null; TransactionContext tc = null;
@ -951,9 +943,6 @@ namespace HRM.DA
HREmployeeDA.UpdatePFInfo(tc, oEmpLifeCycle.EmployeeID, HREmployeeDA.UpdatePFInfo(tc, oEmpLifeCycle.EmployeeID,
EnumPFMembershipType.Live, oEmpLifeCycle.EffectDate); EnumPFMembershipType.Live, oEmpLifeCycle.EffectDate);
// PF membership: the employee's own PF % (used by SalaryCalculator.PFNEW)
if (oEmpLifeCycle.PFPercentage != null)
HREmployeeDA.UpdatePFPercentage(tc, oEmpLifeCycle.EmployeeID, (double)oEmpLifeCycle.PFPercentage);
} }
} }
//else //else
@ -982,14 +971,8 @@ namespace HRM.DA
// if conponent contain pf member, update employee pfMembership property property and pfMembership date. // if conponent contain pf member, update employee pfMembership property property and pfMembership date.
if (oEmpLifeCycle.PFMemberType != null) if (oEmpLifeCycle.PFMemberType != null)
{
HREmployeeDA.UpdatePFInfo(tc, oEmpLifeCycle.EmployeeID, HREmployeeDA.UpdatePFInfo(tc, oEmpLifeCycle.EmployeeID,
(EnumPFMembershipType)oEmpLifeCycle.PFMemberType, oEmpLifeCycle.EffectDate); (EnumPFMembershipType)oEmpLifeCycle.PFMemberType, oEmpLifeCycle.EffectDate);
// PF membership: the employee's own PF % (used by SalaryCalculator.PFNEW)
if (oEmpLifeCycle.PFMemberType == EnumPFMembershipType.Live && oEmpLifeCycle.PFPercentage != null)
HREmployeeDA.UpdatePFPercentage(tc, oEmpLifeCycle.EmployeeID, (double)oEmpLifeCycle.PFPercentage);
}
break; break;
case EnumEmployeeStatus.Discontinued: case EnumEmployeeStatus.Discontinued:
EmployeeDA.UpdateStatus(tc, oEmpLifeCycle.EmployeeID, oEmpLifeCycle.ID, EmployeeDA.UpdateStatus(tc, oEmpLifeCycle.EmployeeID, oEmpLifeCycle.ID,

View File

@ -1,147 +0,0 @@
using System;
using System.Collections.Generic;
using HRM.BO;
namespace HRM.DA
{
/// <summary>
/// The LFA policy: who is eligible and for how much. No database access.
/// - An employee must be live, confirmed and have completed 6 months of service on the payment date,
/// and gets LFA once in a calendar year.
/// - The full amount is one month's basic as of 31 December of the preceding year (365 days).
/// - Joined in the LFA year: joining basic, pro-rata from the joining date to 31 December.
/// - Joined in the preceding year and had not completed 6 months by its 31 December: that year's
/// pro-rata on the joining basic, plus the current year's full amount.
/// lfaYear is the last date of the payment date's month; the year it falls in is the LFA year, and every
/// pro-rata runs to 31 December of that year.
/// </summary>
internal static class LFACalculator
{
private const int ServiceMonths = 6;
private const double DaysOfYear = 365;
/// <summary>Every reason the employee cannot be paid; empty = eligible.</summary>
internal static List<string> Validate(LFAEmployee employee, DateTime lfaYear, DateTime paymentDate, int payrollTypeID)
{
List<string> problems = new List<string>();
if (employee.PayrollTypeID != payrollTypeID)
{
// another payroll type's employee is not shown: it reads as not found
problems.Add("Employee is not found.");
return problems;
}
if (employee.Status != EnumEmployeeStatus.Live)
problems.Add("Employee is not active.");
if (!employee.IsConfirmed)
problems.Add("Employee is not confirmed.");
DateTime eligibleFrom = employee.JoiningDate.Date.AddMonths(ServiceMonths);
if (employee.JoiningDate.Date > YearEnd(lfaYear))
problems.Add("Employee joined after " + DateText(YearEnd(lfaYear)) + ".");
else if (eligibleFrom > paymentDate.Date)
problems.Add("6 months of service will be completed on " + DateText(eligibleFrom) + ", after the payment date.");
if (!string.IsNullOrEmpty(employee.PaidBatchNumber))
problems.Add("LFA of " + lfaYear.Year + " is already processed in batch " + employee.PaidBatchNumber + ".");
if (!IsJoinedInYear(employee, lfaYear) && employee.LastDecBasic <= 0)
problems.Add("Basic salary as of " + DateText(LastDec(lfaYear)) + " is not found.");
if ((IsJoinedInYear(employee, lfaYear) || HasPreviousYear(employee, lfaYear)) && employee.JoiningBasic <= 0)
problems.Add("Joining basic salary is not found.");
return problems;
}
/// <summary>The detail row of an eligible employee (see Validate).</summary>
internal static LFAPaymentDetail Calculate(LFAEmployee employee, DateTime lfaYear)
{
bool joinedInYear = IsJoinedInYear(employee, lfaYear);
double currentYear = joinedInYear
? ProRata(employee.JoiningBasic, employee.JoiningDate, YearEnd(lfaYear))
: employee.LastDecBasic;
double prevYear = HasPreviousYear(employee, lfaYear)
? ProRata(employee.JoiningBasic, employee.JoiningDate, LastDec(lfaYear))
: 0;
LFAPaymentDetail detail = new LFAPaymentDetail();
detail.EmployeeID = employee.EmployeeID;
detail.LFAYear = lfaYear;
detail.JoiningDate = employee.JoiningDate;
detail.ConfirmationDate = employee.ConfirmationDate;
detail.GradeID = employee.GradeID;
detail.DesignationID = employee.DesignationID;
detail.DepartmentID = employee.DepartmentID;
detail.CostCenterID = employee.CostCenterID;
detail.BranchID = employee.BranchID;
detail.AccountNo = employee.AccountNo;
detail.JoiningBasic = employee.JoiningBasic;
detail.LastDecBasic = joinedInYear ? (double?)null : employee.LastDecBasic;
detail.BasicSalary = joinedInYear ? employee.JoiningBasic : employee.LastDecBasic;
detail.CalculatedAmount = Math.Round(prevYear + currentYear, 2, MidpointRounding.AwayFromZero);
detail.Amount = Math.Round(detail.CalculatedAmount, 0, MidpointRounding.AwayFromZero); // paid in whole taka
return detail;
}
/// <summary>
/// Completed service from the joining date to the date (the payment date), e.g. "2 Years 9 Months 27 Days".
/// </summary>
internal static string ServiceLength(DateTime joiningDate, DateTime asOf)
{
DateTime from = joiningDate.Date;
DateTime to = asOf.Date;
if (to <= from)
return "0 Days";
int totalMonths = (to.Year - from.Year) * 12 + to.Month - from.Month;
if (from.AddMonths(totalMonths) > to)
totalMonths--;
int days = (to - from.AddMonths(totalMonths)).Days;
int years = totalMonths / 12;
int months = totalMonths % 12;
List<string> parts = new List<string>();
if (years > 0)
parts.Add(years + (years == 1 ? " Year" : " Years"));
if (months > 0)
parts.Add(months + (months == 1 ? " Month" : " Months"));
if (days > 0 || parts.Count == 0)
parts.Add(days + (days == 1 ? " Day" : " Days"));
return string.Join(" ", parts);
}
/// <summary>Days from the joining date to the year end, the joining date itself not counted, over 365.</summary>
private static double ProRata(double amount, DateTime joiningDate, DateTime yearEnd)
{
return amount / DaysOfYear * (yearEnd.Date - joiningDate.Date).Days;
}
private static bool IsJoinedInYear(LFAEmployee employee, DateTime lfaYear)
{
return employee.JoiningDate.Year == lfaYear.Year;
}
/// <summary>Joined in the preceding year, not eligible within that year, and not paid for it.</summary>
private static bool HasPreviousYear(LFAEmployee employee, DateTime lfaYear)
{
return employee.JoiningDate.Year == lfaYear.Year - 1
&& employee.JoiningDate.Date.AddMonths(ServiceMonths) > LastDec(lfaYear)
&& !employee.IsPaidLastYear;
}
/// <summary>31 December of the LFA year.</summary>
private static DateTime YearEnd(DateTime lfaYear)
{
return new DateTime(lfaYear.Year, 12, 31);
}
private static DateTime LastDec(DateTime lfaYear)
{
return new DateTime(lfaYear.Year - 1, 12, 31);
}
private static string DateText(DateTime date)
{
return date.ToString("dd-MMM-yyyy");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,174 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ClosedXML.Excel;
using HRM.BO;
namespace HRM.DA
{
/// <summary>
/// The LFA payment workbook: builds the template from <see cref="LFAPaymentUploadTemplate"/> and reads
/// an uploaded one. Only what the file itself can tell is checked here.
/// </summary>
internal static class LFAPaymentWorkbook
{
#region Template
internal static byte[] BuildTemplate()
{
using (XLWorkbook workbook = new XLWorkbook())
{
IXLWorksheet sheet = workbook.Worksheets.Add(LFAPaymentUploadTemplate.SheetName);
for (int i = 0; i < LFAPaymentUploadTemplate.Headings.Length; i++)
{
IXLCell cell = sheet.Cell(LFAPaymentUploadTemplate.HeadingRow, i + 1);
cell.Value = LFAPaymentUploadTemplate.Headings[i];
cell.Style.Font.Bold = true;
cell.Style.Fill.BackgroundColor = XLColor.FromHtml("#D9E1F2");
cell.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
cell.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
sheet.Column(i + 1).Width = LFAPaymentUploadTemplate.Widths[i];
}
int first = LFAPaymentUploadTemplate.FirstDataRow;
int last = first + LFAPaymentUploadTemplate.FormattedDataRows - 1;
// Text, so an Employee ID such as 00123 keeps its zeros.
sheet.Range(first, LFAPaymentUploadTemplate.EmployeeNoColumn, last, LFAPaymentUploadTemplate.NameColumn)
.Style.NumberFormat.Format = "@";
sheet.SheetView.FreezeRows(LFAPaymentUploadTemplate.HeadingRow);
using (MemoryStream stream = new MemoryStream())
{
workbook.SaveAs(stream);
return stream.ToArray();
}
}
}
#endregion
#region Read
/// <summary>The file's rows. Problems go into <paramref name="result"/>; a row with one is not returned.</summary>
internal static List<LFAPaymentInput> Read(Stream stream, string fileName, long fileLength, LFAPaymentReadResult result)
{
List<LFAPaymentInput> rows = new List<LFAPaymentInput>();
if (stream == null || string.IsNullOrWhiteSpace(fileName) || fileLength <= 0)
{
result.AddIssue(0, null, null, "No file was received, or the file is empty.");
return rows;
}
if (!fileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase))
{
result.AddIssue(0, null, null, "Only Excel workbooks (.xlsx) are allowed. Please use the downloaded template.");
return rows;
}
if (fileLength > LFAPaymentUploadTemplate.MaxUploadMegabytes * 1024L * 1024L)
{
result.AddIssue(0, null, null, "The file is larger than " + LFAPaymentUploadTemplate.MaxUploadMegabytes + " MB.");
return rows;
}
// ClosedXML needs a seekable stream; an upload stream may not be one.
using (MemoryStream buffer = new MemoryStream())
{
stream.CopyTo(buffer);
buffer.Position = 0;
XLWorkbook workbook;
try
{
workbook = new XLWorkbook(buffer);
}
catch (Exception)
{
result.AddIssue(0, null, null, "The file could not be opened as an Excel workbook. It may be damaged or password-protected.");
return rows;
}
using (workbook)
{
IXLWorksheet sheet;
if (!workbook.TryGetWorksheet(LFAPaymentUploadTemplate.SheetName, out sheet))
sheet = workbook.Worksheets.First();
if (!CheckHeadings(sheet, result))
return rows;
ReadRows(sheet, rows, result);
}
}
if (rows.Count == 0 && result.Issues.Count == 0)
result.AddIssue(0, null, null, "No employee found in the file.");
return rows;
}
private static bool CheckHeadings(IXLWorksheet sheet, LFAPaymentReadResult result)
{
List<string> wrong = new List<string>();
for (int i = 0; i < LFAPaymentUploadTemplate.Headings.Length; i++)
{
string found = Text(sheet.Cell(LFAPaymentUploadTemplate.HeadingRow, i + 1));
if (Normalize(found) != Normalize(LFAPaymentUploadTemplate.Headings[i]))
wrong.Add("column " + (char)('A' + i) + " must be \"" + LFAPaymentUploadTemplate.Headings[i] + "\""
+ (found == "" ? " (it is empty)" : " (found \"" + found + "\")"));
}
if (wrong.Count == 0)
return true;
result.AddIssue(0, null, null, "The headings in row " + LFAPaymentUploadTemplate.HeadingRow
+ " do not match the template: " + string.Join(", ", wrong) + ".");
return false;
}
private static void ReadRows(IXLWorksheet sheet, List<LFAPaymentInput> rows, LFAPaymentReadResult result)
{
// cells with a value only: the template's formatted but empty rows are not "used"
int lastRow = sheet.LastRowUsed(XLCellsUsedOptions.Contents)?.RowNumber() ?? 0;
int count = 0;
for (int rowNo = LFAPaymentUploadTemplate.FirstDataRow; rowNo <= lastRow; rowNo++)
{
string employeeNo = Text(sheet.Cell(rowNo, LFAPaymentUploadTemplate.EmployeeNoColumn));
string name = Text(sheet.Cell(rowNo, LFAPaymentUploadTemplate.NameColumn));
if (employeeNo == "" && name == "")
continue;
if (++count > LFAPaymentUploadTemplate.MaxRows)
{
rows.Clear();
result.AddIssue(0, null, null, "The file has more than " + LFAPaymentUploadTemplate.MaxRows + " employees. Please split it.");
return;
}
if (employeeNo == "")
{
result.AddIssue(rowNo, null, name, "Employee ID is required.");
continue;
}
rows.Add(new LFAPaymentInput { RowNo = rowNo, EmployeeNo = employeeNo });
}
}
/// <summary>What the cell holds, as text; an Employee ID stored as a number comes without separators.</summary>
private static string Text(IXLCell cell)
{
if (cell.DataType == XLDataType.Number)
{
string shown = cell.GetFormattedString().Trim();
return shown.Length > 0 && shown.All(char.IsDigit)
? shown
: cell.GetDouble().ToString("0.##########", CultureInfo.InvariantCulture);
}
return cell.GetFormattedString().Trim();
}
private static string Normalize(string heading)
{
return new string((heading ?? "").Where(x => !char.IsWhiteSpace(x)).ToArray()).ToUpperInvariant();
}
#endregion
}
}

View File

@ -126,11 +126,9 @@ namespace HRM.DA
this.UnAuthorizeLeave(); this.UnAuthorizeLeave();
UpdateprocessStatus("Calculating PF & CPF...."); UpdateprocessStatus("Calculating PF & CPF....");
//this.PF(); this.PF();
this.PFNEW();
// this.OverTimeArrearProcess(); needed later // this.OverTimeArrearProcess(); needed later
//UpdateprocessStatus("Calculating Employees Income tax...."); //UpdateprocessStatus("Calculating Employees Income tax....");
this.CalculateOnBalance();
UpdateprocessStatus("Calculating Income Tax"); UpdateprocessStatus("Calculating Income Tax");
this.Tax(); this.Tax();
UpdateprocessStatus("Calculating Cost-Center"); UpdateprocessStatus("Calculating Cost-Center");
@ -481,7 +479,6 @@ namespace HRM.DA
//{ //{
// basicDetail = this.AddDetail(salary, EnumSalaryGroup.Gross, EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, "Ordinary Amount", PayrollPayrollGlobalFunctions.Round(basicSalary)); // basicDetail = this.AddDetail(salary, EnumSalaryGroup.Gross, EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, "Ordinary Amount", PayrollPayrollGlobalFunctions.Round(basicSalary));
//} //}
salary.ActualPassegeFreeAmount += salary.ThisMonthBasic;
} }
#endregion Calculate Normal Salary #endregion Calculate Normal Salary
#region calculate arrear amount #region calculate arrear amount
@ -489,7 +486,6 @@ namespace HRM.DA
List<EmployeeGradeSalary> arrearItems = new EmployeeGradeSalaryService().GetArrearItems(this.PayrollTypeID); List<EmployeeGradeSalary> arrearItems = new EmployeeGradeSalaryService().GetArrearItems(this.PayrollTypeID);
foreach (SalaryMonthly salary in _salaryMonthlys) foreach (SalaryMonthly salary in _salaryMonthlys)
{ {
UpdateProgressStatus(EnumProcessStatus.PerformStep); // progress signal only (2nd loop of this phase); changes nothing
arrearAmount = 0; arrearAmount = 0;
salary.ArrearGradeSalaries = arrearItems.FindAll(x => x.EmployeeID == salary.EmployeeID); salary.ArrearGradeSalaries = arrearItems.FindAll(x => x.EmployeeID == salary.EmployeeID);
foreach (EmployeeGradeSalary arrearItem in salary.ArrearGradeSalaries) foreach (EmployeeGradeSalary arrearItem in salary.ArrearGradeSalaries)
@ -696,229 +692,6 @@ namespace HRM.DA
} }
private void CalculateOnBalance()
{
AllowanceDeduction allowDeduc = new AllowanceDeduction();
UpdateProgressStatus(EnumProcessStatus.Start);
double grossamount = 0, rcvgross = 0, nProjectAmount = 0;
double arrgrossamount = 0, arrrcvgross = 0;
foreach (SalaryMonthly sMonthly in _salaryMonthlys)
{
if (sMonthly.Details.Any(x => x.IsOnBalancing == true) == false) continue;
grossamount = 0; rcvgross = 0; nProjectAmount = 0;
arrgrossamount = 0; arrrcvgross = 0;
foreach (EmployeeGradeSalary item in sMonthly.GradeSalaries)
{
grossamount = grossamount + item.GrossSalary;
}
foreach (EmployeeGradeSalary item in sMonthly.ArrearGradeSalaries)
{
arrgrossamount = arrgrossamount + item.GrossSalary;
}
foreach (SalaryMonthlyDetail item in sMonthly.Details)
{
if ((item.ItemCode == EnumSalaryItemCode.Basic_Salary && item.ItemID == -101 && item.itemGroupCode == EnumSalaryGroup.Gross) ||
item.AllowanceType == EnumAllowanceType.HouseRent && item.itemGroupCode == EnumSalaryGroup.Gross ||
item.AllowanceType == EnumAllowanceType.Medical && item.itemGroupCode == EnumSalaryGroup.Gross ||
item.AllowanceType == EnumAllowanceType.Conveynce && item.itemGroupCode == EnumSalaryGroup.Gross
)
{
rcvgross += item.CalculatedAmount;
}
}
foreach (SalaryMonthlyDetail item in sMonthly.Details)
{
if ((item.ItemCode == EnumSalaryItemCode.Basic_Salary && item.ItemID == -101 && item.itemGroupCode == EnumSalaryGroup.Arrear) ||
item.AllowanceType == EnumAllowanceType.HouseRent && item.itemGroupCode == EnumSalaryGroup.Arrear ||
item.AllowanceType == EnumAllowanceType.Medical && item.itemGroupCode == EnumSalaryGroup.Arrear ||
item.AllowanceType == EnumAllowanceType.Conveynce && item.itemGroupCode == EnumSalaryGroup.Arrear
)
{
arrrcvgross += item.CalculatedAmount;
}
}
SalaryMonthlyDetail smd = sMonthly.Details.Find(x => x.ItemCode == EnumSalaryItemCode.Allowance && x.IsOnBalancing && x.itemGroupCode == EnumSalaryGroup.Gross);
if (smd != null)
{
smd.CalculatedAmount = Math.Round(grossamount - rcvgross, 0);
smd.ChangedAmount = smd.CalculatedAmount;
smd.ActualPassegeFreeAmount = sMonthly.ActualPassegeFreeAmount;
SalaryMonthlyDetail arr = sMonthly.Details.Find(x => x.ItemCode == EnumSalaryItemCode.Allowance && x.IsOnBalancing && x.itemGroupCode == EnumSalaryGroup.Arrear);
if (arr != null)
{
arr.CalculatedAmount = 0;
arr.ChangedAmount = 0;
}
if (arr == null && arrrcvgross != 0)
arr = this.AddDetail(sMonthly, EnumSalaryGroup.Arrear, EnumSalaryItemCode.Allowance, smd.ItemID, smd.SupportID, smd.Description + " Arrear", 0);
if (arr != null && arrrcvgross != 0)
{
arr.CalculatedAmount = Math.Round(arrgrossamount - arrrcvgross, 0);
arr.ChangedAmount = arr.CalculatedAmount;
}
}
}
}
private void PFNEW()
{
UpdateProgressStatus(EnumProcessStatus.Start);
bool bEchoTexException = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "salary", "echotexexception");
bool earnedBasic = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "pf", "earnedbasic");
// PF % comes from each employee (Employee.PFPercentage), not from SystemInformation.
//List<PFException> oPfExceptions = PFException.Get();
foreach (SalaryMonthly salary in _salaryMonthlys)
{
UpdateProgressStatus(EnumProcessStatus.PerformStep);
SalaryMonthlyDetail pfDetail = null;
if (salary.Employee.PFMemberType != EnumPFMembershipType.Live) continue;
double pfPercent = (salary.Employee.PFPercentage / 100);
// SalaryMonthly prvSalary = _PrvMonthsalary.FirstOrDefault(x => x.EmployeeID == salary.EmployeeID);
var basicitem = _PrvMonthsalaryItems.FirstOrDefault(x => x.itemCode == EnumSalaryItemCode.Basic_Salary
&& x.empid == salary.EmployeeID);
bool RcvLastMonthSalary = false;
if (basicitem != null) RcvLastMonthSalary = true;
double arrearPF = 0;
if (earnedBasic == true)
{
if (RcvLastMonthSalary == true)
{
//SalaryMonthlyDetail prvPF = prvSalary.Details.Find(delegate (SalaryMonthlyDetail detail)
//{
// return (detail.ItemCode == EnumSalaryItemCode.PF_Contribution
// && detail.itemGroupCode == EnumSalaryGroup.Deductions);
//});
var prvPF = _PrvMonthsalaryItems.FirstOrDefault(x => x.itemCode == EnumSalaryItemCode.PF_Contribution
&& x.empid == salary.EmployeeID);
if (salary.Employee.ConfirDate != null && salary.Employee.ConfirDate <
GlobalFunctions.FirstDateOfMonth(_processMonth) && RcvLastMonthSalary == true && prvPF == null) // if pf continue with previous month salary
{
DateTime? tepConfirm = salary.Employee.ConfirDate;
while (GlobalFunctions.LastDateOfMonth((DateTime)tepConfirm) <= this.payrollType.LastPayProcessDate)
{
EmployeeGradeSalary gradeSal = new EmployeeGradeSalaryService().GetBasicOnDateBAT(salary.EmployeeID, (DateTime)tepConfirm);
if (gradeSal == null)
{
AddProcessStatus(salary.Employee, " Employee previous salary not found during PF arrear calculation");
break;
}
double fractionate = 0;
if (tepConfirm == GlobalFunctions.FirstDateOfMonth((DateTime)tepConfirm))
fractionate = 1;
if (tepConfirm == GlobalFunctions.LastDateOfMonth((DateTime)tepConfirm))
fractionate = 30 / 29;
else fractionate = GlobalFunctions.GetFractinalOfMonth((DateTime)tepConfirm);
arrearPF = arrearPF + ((gradeSal.BasicSalary * fractionate) * pfPercent);
tepConfirm = GlobalFunctions.FirstDateOfMonth(((DateTime)tepConfirm).AddMonths(1));
}
}
}
SalaryMonthlyDetail basic = salary.Details.Find(delegate (SalaryMonthlyDetail detail) { return (detail.ItemCode == EnumSalaryItemCode.Basic_Salary
&& detail.itemGroupCode == EnumSalaryGroup.Gross); });
if (basic != null)
{
pfDetail = this.AddDetail(salary, EnumSalaryGroup.Deductions,
EnumSalaryItemCode.PF_Contribution, (int)EnumSalaryItemCode.PF_Contribution, 0,
"PF", GlobalFunctions.Round(basic.CalculatedAmount * pfPercent));
}
basic = salary.Details.Find(delegate (SalaryMonthlyDetail detail) { return (detail.ItemCode == EnumSalaryItemCode.Basic_Salary
&& detail.itemGroupCode == EnumSalaryGroup.Arrear); });
if (basic != null)
{
pfDetail.CalculatedAmount = pfDetail.CalculatedAmount + GlobalFunctions.Round(basic.CalculatedAmount * pfPercent);
}
basic = salary.Details.Find(delegate (SalaryMonthlyDetail detail) { return (detail.ItemCode == EnumSalaryItemCode.Basic_Salary
&& detail.itemGroupCode == EnumSalaryGroup.UnauthLeave); });
if (basic != null)
{
pfDetail.CalculatedAmount = pfDetail.CalculatedAmount - GlobalFunctions.Round(basic.CalculatedAmount * pfPercent);
}
if (pfDetail != null)
{
if (salary.Employee.ConfirDate != null &&
GlobalFunctions.LastDateOfMonth((DateTime)salary.Employee.ConfirDate) == _processMonth)
{
if ((DateTime)salary.Employee.ConfirDate != salary.Employee.JoiningDate)
{
pfDetail.CalculatedAmount = GlobalFunctions.Round(pfDetail.CalculatedAmount *
((double)(31 - ((DateTime)salary.Employee.ConfirDate).Day) / (double)30));
}
}
pfDetail.CalculatedAmount = pfDetail.CalculatedAmount + GlobalFunctions.Round(arrearPF);
pfDetail.ChangedAmount = pfDetail.CalculatedAmount;
}
}
else
{
double months = 1;
if (bEchoTexException == false)
{
salaryHistory prvPF = null;
if (RcvLastMonthSalary == true)
{
prvPF = _PrvMonthsalaryItems.FirstOrDefault(x => x.itemCode == EnumSalaryItemCode.PF_Contribution
&& x.empid == salary.EmployeeID);
}
if (RcvLastMonthSalary == true)
{
if (prvPF == null)
months = Global.DateFunctions.DateDiff("m", (DateTime)salary.Employee.ConfirDate, _processMonth) + 1;
else
{
if (salary.ArrearGradeSalaries.Count > 0)
{
pfDetail = this.AddDetail(salary, EnumSalaryGroup.Deductions,
EnumSalaryItemCode.PF_Contribution, (int)EnumSalaryItemCode.PF_Contribution,
0, "PF", GlobalFunctions.Round(salary.GetGrossAmount(EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary)
* pfPercent));
continue;
}
}
}
else if ((Global.DateFunctions.DateDiff("m", (DateTime)salary.Employee.JoiningDate, _processMonth) + 1) <= 2) // joining in last month
{
months = Global.DateFunctions.DateDiff("m", (DateTime)salary.Employee.JoiningDate, _processMonth) + 1;
}
}
pfDetail = this.AddDetail(salary, EnumSalaryGroup.Deductions,
EnumSalaryItemCode.PF_Contribution, (int)EnumSalaryItemCode.PF_Contribution,
0, "PF", GlobalFunctions.Round(salary.ThisMonthBasic * pfPercent * months));
}
}
UpdateProgressStatus(EnumProcessStatus.End);
}
private void AllowanceDeduction() private void AllowanceDeduction()
{ {
@ -934,18 +707,6 @@ namespace HRM.DA
List<ADParameterEmployee> indvAllowances = new ADParameterEmployeeService().Get( List<ADParameterEmployee> indvAllowances = new ADParameterEmployeeService().Get(
GlobalFunctions.FirstDateOfMonth(_processMonth), GlobalFunctions.FirstDateOfMonth(_processMonth),
GlobalFunctions.LastDateOfMonth(_processMonth), this.PayrollTypeID); GlobalFunctions.LastDateOfMonth(_processMonth), this.PayrollTypeID);
foreach (ADParameterEmployee emp in indvAllowances)
{
ADParameter adParam = _adParameters.Find(x => x.ID == emp.ADParameterID);
if (adParam != null)
{
emp.AllowanceType = _allowdeducitons.FirstOrDefault(x => x.ID == adParam.AllowDeductID)?.AllowanceType
?? EnumAllowanceType.Utilities_Other;
emp.IsOnBalancing=adParam.IsOnBalancing;
}
}
double totalPresentDays = 0; double totalPresentDays = 0;
foreach (SalaryMonthly salary in _salaryMonthlys) foreach (SalaryMonthly salary in _salaryMonthlys)
{ {
@ -955,8 +716,6 @@ namespace HRM.DA
this.GradeDefinedAllowDeduct(salary, salary.ArrearGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Add); this.GradeDefinedAllowDeduct(salary, salary.ArrearGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Add);
// this.GradeDefinedAllowDeduct(salary, salary.ArrearPaidGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Deduct); leter we can introduce // this.GradeDefinedAllowDeduct(salary, salary.ArrearPaidGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Deduct); leter we can introduce
this.IndividualAllowDeduct(salary, indvAllowances, totalPresentDays); this.IndividualAllowDeduct(salary, indvAllowances, totalPresentDays);
salary.ActualPassegeFreeAmount = salary.ThisMonthGross - salary.ActualPassegeFreeAmount;
} }
} }
private void IndividualAllowDeduct(SalaryMonthly salary, List<ADParameterEmployee> indvAllowances, double toTalPresentDays) private void IndividualAllowDeduct(SalaryMonthly salary, List<ADParameterEmployee> indvAllowances, double toTalPresentDays)
@ -973,8 +732,8 @@ namespace HRM.DA
item.AllowDeduct = _allowdeducitons.FirstOrDefault(x => x.ID == item.AllowDeductID); item.AllowDeduct = _allowdeducitons.FirstOrDefault(x => x.ID == item.AllowDeductID);
amount = 0; amount = 0;
ADParameter parameter = _adParameters.FirstOrDefault(x => x.ID == item.ADParameterID); ADParameter parameter = _adParameters.FirstOrDefault(x => x.ID == item.ADParameterID);
if (parameter == null) continue;
parameter.AllowanceDeduction = _allowdeducitons.FirstOrDefault(x => x.ID == item.AllowDeductID); parameter.AllowanceDeduction = _allowdeducitons.FirstOrDefault(x => x.ID == item.AllowDeductID);
if (parameter == null) continue;
amount = new ADParameterService().GetIndividualAmount(salary.Employee, _processMonth, item, amount = new ADParameterService().GetIndividualAmount(salary.Employee, _processMonth, item,
salary.Employee.GrossSalary, salary.Employee.GrossSalary,
@ -1018,23 +777,6 @@ namespace HRM.DA
detail.Position = item.AllowDeduct.Sequence + 1; detail.Position = item.AllowDeduct.Sequence + 1;
detail.ADParamEmployee = item; detail.ADParamEmployee = item;
} }
if (detail != null)
{
EnumAllowanceType allowanceType = parameter.AllowanceDeduction?.AllowanceType ?? EnumAllowanceType.Non_Gross;
if (allowanceType == EnumAllowanceType.HouseRent ||
allowanceType == EnumAllowanceType.Medical ||
allowanceType == EnumAllowanceType.Conveynce)
{
if (groupCode != EnumSalaryGroup.Arrear)
{
salary.ActualPassegeFreeAmount += item.MonthlyAmount;
}
}
}
} }
#endregion Individual Allowance #endregion Individual Allowance
@ -1063,18 +805,12 @@ namespace HRM.DA
{ {
if (salary.Category.WagesType == EnumWagesType.Monthly) if (salary.Category.WagesType == EnumWagesType.Monthly)
{ {
amount = new ADParameterService().GetGradeDefinedAmount(salary.Employee, empGradeSalary.BasicSalary, empGradeSalary.GrossSalary, empGradeSalary, parameter); amount = new ADParameterService().GetGradeDefinedAmount(salary.Employee, empGradeSalary.BasicSalary, empGradeSalary.GrossSalary, empGradeSalary, parameter);
// for echotex
EnumAllowanceType allowanceType = parameter.AllowanceDeduction.AllowanceType; if (parameter.AllowanceDeduction.Code == "023" && parameter.AllowanceDeduction.Name == "Night shift allowance" && amount >0)
if ((allowanceType == EnumAllowanceType.HouseRent && gCode == EnumSalaryGroup.Gross) ||
(allowanceType == EnumAllowanceType.Medical && gCode == EnumSalaryGroup.Gross) ||
(allowanceType == EnumAllowanceType.Conveynce && gCode == EnumSalaryGroup.Gross))
{ {
double nAmt = new ADParameterService().GetGradeDefinedAmountForMonth(salary.Employee, salary.ThisMonthBasic, salary.ThisMonthGross, empGradeSalary, parameter, 1); amount = parameter.FlatAmount;
salary.ActualPassegeFreeAmount += nAmt;
} }
} }
} else continue; } else continue;
@ -1109,10 +845,6 @@ namespace HRM.DA
if (detail != null) if (detail != null)
detail.Position = parameter.AllowanceDeduction.Sequence + 1; detail.Position = parameter.AllowanceDeduction.Sequence + 1;
detail.AllowanceType = parameter.AllowanceDeduction.AllowanceType;
detail.IsOnBalancing= parameter.IsOnBalancing;
} }
} }
} }

View File

@ -2683,15 +2683,6 @@ namespace HRM.DA
// } // }
//} //}
public void Save(SalaryProcess process, List<SalaryMonthly> items) public void Save(SalaryProcess process, List<SalaryMonthly> items)
{
this.Save(process, items, null);
}
/// <summary>
/// Same save as Save(process, items); only reports how far it got to <paramref name="progress"/> (null = nobody listens,
/// which is exactly the original behaviour). Reporting never changes or stops the save (TryReport swallows faults).
/// </summary>
public void Save(SalaryProcess process, List<SalaryMonthly> items, IJobProgress progress)
{ {
TransactionContext tc = null; TransactionContext tc = null;
try try
@ -2717,9 +2708,8 @@ namespace HRM.DA
{ {
x.SalaryProcessID = processId; x.SalaryProcessID = processId;
}); });
this.SaveBulk(tc, items, progress != null ? new JobProgressScope(progress, 0, 95) : null); this.SaveBulk(tc, items);
} }
progress.TryReport(95, "Committing salary data");
tc.End(); tc.End();
} }
catch (Exception e) catch (Exception e)
@ -2737,51 +2727,11 @@ namespace HRM.DA
public void SaveBulk(TransactionContext tc, List<SalaryMonthly> items) public void SaveBulk(TransactionContext tc, List<SalaryMonthly> items)
{
this.SaveBulk(tc, items, null);
}
/// <summary>
/// Progress (0 - 100) at the start of each of SaveBulk's four blocks, weighted by the rows each block writes
/// (salary rows, detail rows, tax rows, cost-center rows). Only reads counts; never throws (falls back to even steps).
/// </summary>
private static double[] SaveBulkProgressSteps(List<SalaryMonthly> items, IJobProgress progress)
{
double[] even = { 0, 25, 50, 75 };
if (progress == null)
return even;
try
{
double master = items.Count;
double details = items.Sum(x => x.Details != null ? x.Details.Count : 0);
double taxes = items.Sum(x => x.Incometaxes != null ? x.Incometaxes.Count : 0);
double costs = items.Sum(x => x.CostCentersInvolments != null ? x.CostCentersInvolments.Count : 0);
double all = master + details + taxes + costs;
if (all <= 0)
return even;
return new[]
{
0,
100 * master / all,
100 * (master + details) / all,
100 * (master + details + taxes) / all
};
}
catch
{
return even;
}
}
/// <summary>Same bulk save; reports 0 - 100 of its four blocks (weighted by row count) to <paramref name="progress"/>.</summary>
public void SaveBulk(TransactionContext tc, List<SalaryMonthly> items, IJobProgress progress)
{ {
try try
{ {
if (items.Count > 0) if (items.Count > 0)
{ {
double[] saveSteps = SaveBulkProgressSteps(items, progress);
progress.TryReport(saveSteps[0], "Saving salary records", null, 0, items.Count);
int salaryPKID = tc.GenerateID("SalaryMonthly", "SalaryMonthlyID"); int salaryPKID = tc.GenerateID("SalaryMonthly", "SalaryMonthlyID");
DataTable attnProcessEntryTable = new DataTable("SalaryMonthly"); DataTable attnProcessEntryTable = new DataTable("SalaryMonthly");
attnProcessEntryTable.Columns.Add(new DataColumn("SALARYMONTHLYID", typeof(int))); attnProcessEntryTable.Columns.Add(new DataColumn("SALARYMONTHLYID", typeof(int)));
@ -2920,7 +2870,6 @@ namespace HRM.DA
bulkCopy.DestinationTableName = "SALARYMONTHLY"; bulkCopy.DestinationTableName = "SALARYMONTHLY";
bulkCopy.WriteToServer(attnProcessEntryTable); bulkCopy.WriteToServer(attnProcessEntryTable);
progress.TryReport(saveSteps[1], "Saving salary details");
} }
@ -2978,7 +2927,6 @@ namespace HRM.DA
bulkCopy.DestinationTableName = "SALARYMONTHLYDETAIL"; bulkCopy.DestinationTableName = "SALARYMONTHLYDETAIL";
bulkCopy.WriteToServer(detailtable); bulkCopy.WriteToServer(detailtable);
progress.TryReport(saveSteps[2], "Saving income tax data");
} }
@ -3047,7 +2995,6 @@ namespace HRM.DA
bulkCopy.DestinationTableName = "SALARYTEMPIT"; bulkCopy.DestinationTableName = "SALARYTEMPIT";
bulkCopy.WriteToServer(tax); bulkCopy.WriteToServer(tax);
progress.TryReport(saveSteps[3], "Saving cost-center data");
} }
@ -3083,7 +3030,6 @@ namespace HRM.DA
bulkCopy.DestinationTableName = "SALARYEMPCOSTCENTER"; bulkCopy.DestinationTableName = "SALARYEMPCOSTCENTER";
bulkCopy.WriteToServer(cost); bulkCopy.WriteToServer(cost);
progress.TryReport(100, "Saving cost-center data");
} }
} }

View File

@ -1,287 +0,0 @@
using HRM.BO;
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
namespace HRM.DA
{
/// <summary>
/// Real progress of the salary process for an IJobProgress listener. It only WATCHES the process: it reads the
/// events SalaryCalculator raises and never touches a salary, an employee or a query. Every entry point is wrapped
/// in try/catch, so a fault here can never stop or change the calculation.
///
/// The run is split into stages, in the exact order they happen:
/// Validating -> Preparing calculation (SalaryCalculator ctor, approval check, Process() set-up + Initialize)
/// -> the calculation phases up to leave days -> Salary exception -> Net income -> Saving.
/// A calculation phase starts with the ProgressStatus Start event (its first statement in SalaryCalculator) and
/// moves one step per PerformStep (one per employee / salary row; Basic salary has two such loops).
/// "Salary exception" has no events of its own: it is recognised by the status message Process() already sends.
///
/// How much of the bar each stage gets is LEARNED: every successful run measures how long each stage really took
/// (per payroll type, in memory), and the next run splits the bar in those proportions - so the bar moves at an even
/// pace and the ETA is real. The first run (and the first after an app restart) uses default proportions.
/// 0 - 1 % is "Loading employees", reported by the caller before this class exists.
/// </summary>
internal sealed class SalaryProcessProgress
{
private const double StartPercent = 1; // 0 - 1 %: loading employees (caller)
private const double MinStageShare = 0.004; // a learned stage never gets less than 0.4 % of the bar
// Calculation phases, in the order of the Start events in SalaryCalculator.Process.
private static readonly string[] PhaseNames =
{
"Collecting employee information",
"Calculating basic salary",
"Calculating benefits and deductions",
"Calculating overtime",
"Calculating bonus",
"Calculating unauthorized leave deduction",
"Calculating PF & CPF",
"Calculating on-balance salary",
"Calculating income tax",
"Preparing cost-center data",
"Calculating loan installments",
"Calculating attendance days",
"Calculating leave days",
"Calculating net income"
};
// Loops (of one step per salary row) a phase runs; Basic salary also loops for arrears. On-balance raises
// no steps (it only gets its Start), so its slice fills when the next phase starts.
private static readonly int[] PhaseLoops = { 1, 2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 };
// Stages = Validating, Preparing, every phase but the last, Salary exception, the last phase (net income), Saving.
// Salary exception runs between leave days and net income and has no Start event of its own.
private static readonly int LastPhase = PhaseNames.Length - 1; // net income
private const int StageValidating = 0;
private const int StagePreparing = 1;
private const int StageFirstPhase = 2; // phase p (< LastPhase) -> stage 2 + p
private static readonly int StageSalaryException = StageFirstPhase + LastPhase;
private static readonly int StageNetIncome = StageSalaryException + 1;
private static readonly int StageSaving = StageNetIncome + 1;
private static readonly int StageCount = StageSaving + 1;
private static readonly double[] DefaultWeights = BuildDefaultWeights();
// Measured seconds per stage of the last successful run, per payroll type, with that run's employee count.
// Fixed set-up costs weigh differently in a 5-employee run than in a 5,000-employee one, so a measurement is
// only reused for a run of a similar size, and only runs of a meaningful size are learned from.
private static readonly ConcurrentDictionary<int, LearnedRun> LearnedRuns = new ConcurrentDictionary<int, LearnedRun>();
private const int MinEmployeesToLearn = 20;
private const double MaxSizeRatio = 4;
private sealed class LearnedRun
{
public int EmployeeCount;
public double[] Seconds;
}
private const string EmployeeMessagePrefix = "Collecting information for the employee";
private const string SalaryExceptionMessage = "Salary Exception";
private readonly IJobProgress _progress;
private readonly int _payrollTypeId;
private readonly int _employeeCount;
private readonly double[] _stageStart; // percent where each stage begins
private readonly double[] _stageShare; // percent each stage spans
private readonly double[] _secondsSpent;
private readonly Stopwatch _clock = Stopwatch.StartNew();
private int _stage = -1;
private double _stageEnteredAt;
private int _phase = -1;
private int _step;
private string _detail;
public SalaryProcessProgress(IJobProgress progress, int payrollTypeId, int employeeCount)
{
_progress = progress;
_payrollTypeId = payrollTypeId;
_employeeCount = Math.Max(1, employeeCount);
_secondsSpent = new double[StageCount];
double[] weights = WeightsFor(payrollTypeId, _employeeCount);
double total = 0;
foreach (double w in weights) total += w;
_stageStart = new double[StageCount];
_stageShare = new double[StageCount];
double at = StartPercent;
for (int i = 0; i < StageCount; i++)
{
_stageShare[i] = (100 - StartPercent) * weights[i] / total;
_stageStart[i] = at;
at += _stageShare[i];
}
}
public void Validating()
{
Safe(() => Enter(StageValidating, "Validating salary data"));
}
/// <summary>From here until the first calculation phase starts: calculator set-up, approval check, Initialize.</summary>
public void Preparing()
{
Safe(() => Enter(StagePreparing, "Preparing calculation"));
}
public void Attach(SalaryCalculator calculator)
{
calculator.ProgressStatus += OnProgressStatus;
calculator.ProcessStatus += OnProcessStatus;
}
/// <summary>The save reports its own 0 - 100 through this; it lands in the Saving slice of the bar.</summary>
public IJobProgress Saving()
{
Safe(() => Enter(StageSaving, "Saving salary data"));
return new JobProgressScope(_progress, _stageStart[StageSaving], _stageStart[StageSaving] + _stageShare[StageSaving]);
}
/// <summary>The run finished successfully: remember how long each stage took, for the next run's proportions.</summary>
public void Completed()
{
Safe(() =>
{
CloseStage();
double[] measured = (double[])_secondsSpent.Clone();
double sum = 0;
foreach (double s in measured) sum += s;
if (sum > 0 && _employeeCount >= MinEmployeesToLearn)
LearnedRuns[_payrollTypeId] = new LearnedRun { EmployeeCount = _employeeCount, Seconds = measured };
});
}
private void OnProcessStatus(string message)
{
Safe(() =>
{
if (string.IsNullOrEmpty(message))
{
_detail = null;
return;
}
string text = message.Trim();
if (text.StartsWith(EmployeeMessagePrefix, StringComparison.OrdinalIgnoreCase))
{
_detail = text.Substring(EmployeeMessagePrefix.Length).Trim();
}
else if (text.IndexOf(SalaryExceptionMessage, StringComparison.OrdinalIgnoreCase) >= 0)
{
// Sent by Process() just before SalaryExceptionCalculation, i.e. after leave days, before net income.
Enter(StageSalaryException, "Calculating salary exception");
}
else
{
_detail = null;
}
});
}
private void OnProgressStatus(EnumProcessStatus status)
{
Safe(() =>
{
if (status == EnumProcessStatus.Start)
{
_phase++;
_step = 0;
_detail = null;
int phase = Math.Min(_phase, PhaseNames.Length - 1);
Enter(StageOf(phase), PhaseNames[phase]);
}
else if (status == EnumProcessStatus.PerformStep)
{
_step++;
PublishPhase();
}
// End needs nothing: the next Start / stage moves the bar on.
});
}
private void PublishPhase()
{
if (_phase < 0)
return;
int phase = Math.Min(_phase, PhaseNames.Length - 1);
if (PhaseLoops[phase] == 0)
return; // a phase without steps stays at its start until the next stage
int stage = StageOf(phase);
int expected = _employeeCount * PhaseLoops[phase];
double inside = Math.Min((double)_step / expected, 0.999);
int shown = Math.Min(_step, expected);
// A two-loop phase counts each employee twice; show employees, not loop steps.
int employeesDone = PhaseLoops[phase] > 1 ? Math.Min(_employeeCount, (int)Math.Ceiling((double)shown / PhaseLoops[phase])) : shown;
_progress.Report(_stageStart[stage] + _stageShare[stage] * inside, PhaseNames[phase], _detail, employeesDone, _employeeCount);
}
private static int StageOf(int phase)
{
return phase < LastPhase ? StageFirstPhase + phase : StageNetIncome;
}
private void Enter(int stage, string name)
{
if (stage == _stage)
return;
CloseStage();
_stage = stage;
_stageEnteredAt = _clock.Elapsed.TotalSeconds;
_progress.Report(_stageStart[stage], name, null, null, null);
}
private void CloseStage()
{
if (_stage < 0)
return;
double now = _clock.Elapsed.TotalSeconds;
_secondsSpent[_stage] += Math.Max(0, now - _stageEnteredAt);
_stageEnteredAt = now;
}
private static double[] WeightsFor(int payrollTypeId, int employeeCount)
{
if (!LearnedRuns.TryGetValue(payrollTypeId, out LearnedRun run) || run?.Seconds == null || run.Seconds.Length != StageCount)
return DefaultWeights;
double ratio = (double)Math.Max(employeeCount, 1) / Math.Max(run.EmployeeCount, 1);
if (ratio > MaxSizeRatio || ratio < 1 / MaxSizeRatio)
return DefaultWeights;
double[] seconds = run.Seconds;
double total = 0;
foreach (double s in seconds) total += s;
if (total <= 0)
return DefaultWeights;
double[] weights = new double[StageCount];
for (int i = 0; i < StageCount; i++)
weights[i] = Math.Max(seconds[i] / total, MinStageShare);
return weights;
}
private static double[] BuildDefaultWeights()
{
// Used until a run has been measured: small set-up stages, equal calculation phases, a tenth for saving.
double[] w = new double[StageCount];
w[StageValidating] = 2;
w[StagePreparing] = 3;
for (int p = 0; p < LastPhase; p++) w[StageFirstPhase + p] = 6.5;
w[StageSalaryException] = 0.5;
w[StageNetIncome] = 6.5;
w[StageSaving] = 10;
return w;
}
private static void Safe(Action action)
{
try
{
action();
}
catch
{
// progress only watches the salary process; it must never be able to break it
}
}
}
}

View File

@ -339,62 +339,16 @@ namespace HRM.DA
} }
return errorList; return errorList;
} }
// Salary Process screen, no employee selected but a Category: the Live employees of the payroll type in
// that category whose salary of the month is not processed yet (the employee picker leaves those out too)
public List<int> GetCategoryEmployeeIDs(int categoryID, int payrollTypeID, DateTime salaryMonth)
{
List<int> employeeIDs = new List<int>();
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
DataReader dr = new DataReader(SalaryProcessDA.GetCategoryEmployeeIDs(tc, categoryID, payrollTypeID, salaryMonth));
while (dr.Read())
{
employeeIDs.Add(dr.GetInt32("EmployeeID").Value);
}
dr.Close();
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return employeeIDs;
}
public List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees) public List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees)
{
return this.SalaryProcess(item, employees, null);
}
/// <summary>
/// The salary process, reporting real progress to <paramref name="progress"/> (null = nobody listens, which is
/// exactly the original behaviour). Only listeners are added; the calculation and the save are untouched.
/// </summary>
public List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees, IJobProgress progress)
{ {
try try
{ {
// Progress only watches (see SalaryProcessProgress); with progress == null none of these lines do anything.
SalaryProcessProgress tracker = progress != null
? new SalaryProcessProgress(progress, item.PayrollTypeID, employees != null ? employees.Count : 0)
: null;
if (tracker != null) tracker.Validating();
bool IsFinantialAprovalRequired = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "finantialaproval", "finantialaprovalrequired"); bool IsFinantialAprovalRequired = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "finantialaproval", "finantialaprovalrequired");
string msg = String.Empty; string msg = String.Empty;
var items = this.SalaryValidation(item, employees); var items = this.SalaryValidation(item, employees);
if (items.Count != 0) return items; if (items.Count != 0) return items;
if (tracker != null) tracker.Preparing();
SalaryCalculator calculator = new SalaryCalculator(); SalaryCalculator calculator = new SalaryCalculator();
if (tracker != null) tracker.Attach(calculator);
if (IsFinantialAprovalRequired) if (IsFinantialAprovalRequired)
{ {
List<SalaryProcessStatus> salaryProcessStatusList = new List<SalaryProcessStatus>(); List<SalaryProcessStatus> salaryProcessStatusList = new List<SalaryProcessStatus>();
@ -407,11 +361,7 @@ namespace HRM.DA
calculator.Process(employees, item.SalaryMonth, item.PayrollTypeID, item.EuroRate); calculator.Process(employees, item.SalaryMonth, item.PayrollTypeID, item.EuroRate);
if (calculator.ErrorList.Count == 0) if (calculator.ErrorList.Count == 0)
{ new SalaryMonthlyService().Save(item, calculator.SalaryMonthlies);
IJobProgress saveProgress = tracker != null ? tracker.Saving() : null;
new SalaryMonthlyService().Save(item, calculator.SalaryMonthlies, saveProgress);
if (tracker != null) tracker.Completed();
}
//salaryProcessStatusList.ForEach(item => calculator.ErrorList.Add(item)); //salaryProcessStatusList.ForEach(item => calculator.ErrorList.Add(item));
return calculator.ErrorList; return calculator.ErrorList;
} }

View File

@ -5,7 +5,6 @@ using HRM.BO;
using Ease.Core.Utility; using Ease.Core.Utility;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq;
using Ease.Core; using Ease.Core;
using Payroll.Service; using Payroll.Service;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
@ -1346,8 +1345,6 @@ namespace HRM.DA
taxCalculator.Salary = salaries; taxCalculator.Salary = salaries;
taxCalculator.Employee = new EmployeeService().Get(salaries.EmployeeID); taxCalculator.Employee = new EmployeeService().Get(salaries.EmployeeID);
taxCalculator.AllowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless); taxCalculator.AllowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless);
List<ADParameter> ads = new ADParameterService().GetWithDetail(EnumStatus.Regardless, salaries.PayrollTypeID);
taxCalculator.AdParameters = ads;
try try
{ {
foreach (IncomeTax item in taxCalculator.CurrentYearTax) foreach (IncomeTax item in taxCalculator.CurrentYearTax)
@ -1356,51 +1353,6 @@ namespace HRM.DA
item.ProjectedAmount = 0; item.ProjectedAmount = 0;
} }
double rcvGross = 0;
// find gross amount
Employee oEmp = new EmployeeService().Get(salaries.EmployeeID);
SalaryMonthlyDetail pscFreeIime = null;
foreach (var item in salaries.Details)
{
if (item.itemGroupCode == EnumSalaryGroup.Gross)
{
if (item.ItemCode == EnumSalaryItemCode.Allowance)
{
ADParameter param = ads.Find(x=>x.AllowDeductID==item.ItemID);
if (param != null)
{
if(param.IsOnBalancing)
{
pscFreeIime = item;
}
EnumAllowanceType allowanceType = taxCalculator.AllowanceDeductions
.FirstOrDefault(x => x.ID == param.AllowDeductID)?.AllowanceType ?? EnumAllowanceType.Non_Gross;
if (allowanceType == EnumAllowanceType.HouseRent ||
allowanceType == EnumAllowanceType.Medical ||
allowanceType == EnumAllowanceType.Conveynce)
{
ADParameter adParam = new ADParameterService().GetApplicableParameter(oEmp, salaries.GradeID,
ads, item.ItemID);
double nAmt = new ADParameterService().GetAmount(oEmp, adParam);
rcvGross = rcvGross + nAmt;
}
}
}
}
}
rcvGross += salaries.ThisMonthBasic;
if (pscFreeIime!=null)
{
pscFreeIime.ActualPassegeFreeAmount = salaries.ThisMonthGross - rcvGross;
}
salaries.Incometaxes = taxCalculator.SalaryTax(); salaries.Incometaxes = taxCalculator.SalaryTax();
} }
catch (ServiceException sx) catch (ServiceException sx)

View File

@ -452,15 +452,7 @@ namespace HRM.DA
#region Management Payrol #region Management Payrol
if (adparameter.EntitleType == EnumEntitleType.Grade) if (adparameter.EntitleType == EnumEntitleType.Grade)
{ {
if ((salaryDetail.IsOnBalancing == true) item.ProjectedAmount = GlobalFunctions.Round( new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth;
&& salaryDetail.ItemCode == EnumSalaryItemCode.Allowance &&
salaryDetail.itemGroupCode == EnumSalaryGroup.Gross)
{
item.ProjectedAmount = salaryDetail.ActualPassegeFreeAmount * _projectedMonth;
}
else item.ProjectedAmount = GlobalFunctions.Round(new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth;
//item.ProjectedAmount = GlobalFunctions.Round( new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth;
} }
else else
{ {

View File

@ -383,8 +383,7 @@ namespace HRM.DA
} }
// Whoever made this change: the editor, or the creator for a new role. On approval // Whoever made this change: the editor, or the creator for a new role. On approval
// the controller keeps the maker in ModifiedBy, so this is still the maker. // the controller keeps the maker in ModifiedBy, so this is still the maker.
// Super User IDs are negative, so "edited" means ModifiedBy is set (not 0), not "> 0". int makerID = (oRole.ModifiedBy ?? 0) > 0 ? oRole.ModifiedBy.Value : oRole.CreatedBy;
int makerID = (oRole.ModifiedBy ?? 0) != 0 ? oRole.ModifiedBy.Value : oRole.CreatedBy;
foreach (Role.RolePermission rolePermission in oRole.RolePermissions) foreach (Role.RolePermission rolePermission in oRole.RolePermissions)
{ {
rolePermission.RoleID = oRole.ID; rolePermission.RoleID = oRole.ID;
@ -675,73 +674,11 @@ namespace HRM.DA
#endregion #endregion
} }
if (ouser.UserType == EnumUserType.Employee)
ApplyComponentUploadMenuRestrictions(menus, ouser.EmployeeID ?? 0);
SortMenuTree(menus); SortMenuTree(menus);
ApplyMenuStyles(menus); ApplyMenuStyles(menus);
return menus; return menus;
} }
#region Component Upload menus (self-service)
/// <summary>ESS Upload Component page (shown only to an uploader of a ComponentUploadSetup).</summary>
public const string ComponentUploaderLink = "ess/component-uploader";
/// <summary>ESS Component Approval page (shown only to an approver of a ComponentUploadSetup).</summary>
public const string ComponentApprovalLink = "ess/component-approval";
/// <summary>
/// As GP: the Upload Component and Component Approval menus need more than the role permission; the
/// employee must also be an uploader / approver in ComponentUploadSetup. The menus are found by their
/// link, not by their key, so each client's Menu XML may number them as it likes. A head left with no
/// child (and no link of its own) is removed as well. Never breaks the menu loading.
/// </summary>
private void ApplyComponentUploadMenuRestrictions(List<WebMenuHead> menus, int employeeId)
{
try
{
bool hasUploadMenu = menus.Any(h => IsLink(h.routerLink, ComponentUploaderLink)
|| (h.items != null && h.items.Any(g => IsLink(g.routerLink, ComponentUploaderLink))));
bool hasApprovalMenu = menus.Any(h => IsLink(h.routerLink, ComponentApprovalLink)
|| (h.items != null && h.items.Any(g => IsLink(g.routerLink, ComponentApprovalLink))));
if (!hasUploadMenu && !hasApprovalMenu)
return;
List<string> hidden = new List<string>();
if (hasUploadMenu && !(employeeId > 0 && new ComponentUploadSetupService().HasUploaderSetup(employeeId)))
hidden.Add(ComponentUploaderLink);
if (hasApprovalMenu && !(employeeId > 0 && new ComponentUploadSetupService().HasApproverSetup(employeeId)))
hidden.Add(ComponentApprovalLink);
if (hidden.Count == 0)
return;
foreach (WebMenuHead head in menus.ToList())
{
if (hidden.Any(l => IsLink(head.routerLink, l)))
{
menus.Remove(head);
continue;
}
if (head.items == null) continue;
int removed = head.items.RemoveAll(g => hidden.Any(l => IsLink(g.routerLink, l)));
if (removed > 0 && head.items.Count == 0 && string.IsNullOrWhiteSpace(head.routerLink))
menus.Remove(head);
}
}
catch (Exception e)
{
ExceptionLog.Write(e);
}
}
private static bool IsLink(string routerLink, string link)
{
return !string.IsNullOrWhiteSpace(routerLink)
&& string.Equals(routerLink.Trim().Trim('/'), link, StringComparison.OrdinalIgnoreCase);
}
#endregion
// Icons come entirely from RolePermission.Icon (sourced from the uploaded Menu.xml's // Icons come entirely from RolePermission.Icon (sourced from the uploaded Menu.xml's
// menuIcon attribute, see SystemConfigarationDA.UpdateRolePermission) and were already // menuIcon attribute, see SystemConfigarationDA.UpdateRolePermission) and were already
// applied when each node was created above; a node with no DB icon simply keeps the // applied when each node was created above; a node with no DB icon simply keeps the

View File

@ -638,70 +638,6 @@ namespace HRM.DA
return oUser; return oUser;
} }
/// <summary>
/// Finds the active login account for Forgot Password, in the same priority as login:
/// 1. Employee (Self-Service, UserType 2) - LoginID is the EmployeeNo of a live employee; User.Employee is filled
/// 2. User / Admin (UserType 1)
/// 3. Super User (UserType 0)
/// Returns null when no active (Active / Approved) account is found.
/// </summary>
public User GetUserForPasswordReset(string loginID)
{
User oUser = null;
TransactionContext tc = null;
try
{
Employee oEmployee = new EmployeeService().GetByEmpNo(loginID);
tc = TransactionContext.Begin();
DataReader oreader;
if (oEmployee != null)
{
oreader = new DataReader(UserDA.GetActiveByLoginID(tc, loginID, EnumUserType.Employee));
if (oreader.Read())
{
oUser = this.CreateObject<User>(oreader);
oUser.Employee = oEmployee;
}
oreader.Close();
}
if (oUser == null)
{
oreader = new DataReader(UserDA.GetActiveByLoginID(tc, loginID, EnumUserType.User));
if (oreader.Read())
{
oUser = this.CreateObject<User>(oreader);
}
oreader.Close();
}
if (oUser == null)
{
oreader = new DataReader(UserDA.GetActiveByLoginID(tc, loginID, EnumUserType.SuperUser));
if (oreader.Read())
{
oUser = this.CreateObject<User>(oreader);
}
oreader.Close();
}
tc.End();
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return oUser;
}
public void SaveLoginfo(UserLogInInfo oTran) public void SaveLoginfo(UserLogInInfo oTran)
{ {

View File

@ -1,54 +0,0 @@
using System;
using System.Data;
using System.Linq;
using Ease.Core.Utility;
using HRM.BO;
using HRM.DA;
namespace HRM.Report
{
/// <summary>
/// Component Upload Report (EnumReportType.ComponentUploadReport, /reports/component-upload-report), as GP's
/// rptEmployee.ShowUploadedComponentReport / ShowUploadedComponentReportEmployee. The RDLCs are read from the
/// RDLC folder (HRM.UI/RDLC), as GP renders them, through ReportProcessor.CommonReportViewer.
/// </summary>
public class rptComponentUpload
{
/// <summary>Uploaded Components tab: every upload of the upload date range.</summary>
public byte[] ShowUploadedComponentReport(DateTime fromdate, DateTime todate, int payrollTypeId, string reportType)
{
DataTable dtUploadedComponents = new ComponentUploadSetupService().GetUploadedComponentReportData(fromdate, todate).Copy();
dtUploadedComponents.TableName = "dsCompany_dtUploadedComponent";
DataSet resultDataSet = new DataSet();
resultDataSet.Tables.Add(dtUploadedComponents);
return new ReportProcessor().CommonReportViewer(null, "UploadedComponent.rdlc", resultDataSet, null, payrollTypeId, reportType);
}
/// <summary>
/// Monthly Uploaded Components tab: the uploaded rows of the selected employees for the salary month,
/// of one component (itemId) or of every component (itemId 0).
/// </summary>
public byte[] ShowUploadedComponentReportEmployee(string empIds, int itemId, DateTime fromdate, int payrollTypeId, string reportType)
{
// the IDs go into the SQL as %q, so only digits pass
string ids = string.Join(",", (empIds ?? string.Empty)
.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => int.TryParse(x.Trim(), out int id) ? id : 0)
.Where(id => id > 0)
.Distinct());
if (ids == string.Empty)
throw new Exception("Please select employee.");
DateTime uploadMonth = GlobalFunctions.LastDateOfMonth(fromdate);
DataTable dtUploadedComponents = itemId != 0
? new ComponentUploadSetupService().GetUploadedComponentEmpReportData(uploadMonth, itemId, ids).Copy()
: new ComponentUploadSetupService().GetUploadedComponentEmpReportData(uploadMonth, ids).Copy();
dtUploadedComponents.TableName = "dsCompany_dtUploadedComponentEmp";
DataSet resultDataSet = new DataSet();
resultDataSet.Tables.Add(dtUploadedComponents);
return new ReportProcessor().CommonReportViewer(null, "UploadedComponentEmp.rdlc", resultDataSet, null, payrollTypeId, reportType);
}
}
}

View File

@ -1,85 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using HRM.BO;
using HRM.DA;
using Microsoft.Reporting.NETCore;
namespace HRM.Report
{
/// <summary>
/// LFA Bank Advice (EnumReportType.LFABankAdvice, /payroll-lfa/lfa-bank-advice): the employees of one
/// approved LFA payment batch with their bank account and LFA amount, rendered with LFABankAdvice.rdlc.
/// </summary>
public class rptLFABankAdvice
{
private const string RdlcName = "HRM.Report.RDLC.LFABankAdvice.rdlc";
private const string DataSetName = "dsLFABankAdvice";
public byte[] ShowLFABankAdvice(int lfaPaymentID, string sEmpIDs, int bankID, int payrollTypeId, string reportType)
{
if (lfaPaymentID <= 0)
throw new Exception("Select an LFA payment batch.");
DataSet oSource = new LFAPaymentService().GetBankAdvice(lfaPaymentID, sEmpIDs, bankID, payrollTypeId);
if (oSource == null || oSource.Tables.Count == 0 || oSource.Tables[0].Rows.Count == 0)
throw new Exception("No employee of the selected batch has an LFA amount to pay for this selection.");
DataTable bankAdvice = new DataTable(DataSetName);
bankAdvice.Columns.Add("SLNo", typeof(int));
bankAdvice.Columns.Add("EmpNo", typeof(string));
bankAdvice.Columns.Add("EmpName", typeof(string));
bankAdvice.Columns.Add("Designation", typeof(string));
bankAdvice.Columns.Add("Department", typeof(string));
bankAdvice.Columns.Add("CostCenter", typeof(string));
bankAdvice.Columns.Add("AccountNo", typeof(string));
bankAdvice.Columns.Add("Bank", typeof(string));
bankAdvice.Columns.Add("Branch", typeof(string));
bankAdvice.Columns.Add("RoutingNo", typeof(string));
bankAdvice.Columns.Add("Email", typeof(string));
bankAdvice.Columns.Add("Amount", typeof(double));
string batchNumber = string.Empty;
DateTime paymentDate = DateTime.Today;
DateTime lfaYear = DateTime.Today;
int count = 1;
foreach (DataRow oDRow in oSource.Tables[0].Rows)
{
DataRow oDR = bankAdvice.NewRow();
oDR["SLNo"] = count;
oDR["EmpNo"] = Convert.ToString(oDRow["EMPLOYEENO"]);
oDR["EmpName"] = Convert.ToString(oDRow["NAME"]);
oDR["Designation"] = Convert.ToString(oDRow["DesignationName"]);
oDR["Department"] = Convert.ToString(oDRow["DepartmentName"]);
oDR["CostCenter"] = Convert.ToString(oDRow["CostCenter"]);
oDR["AccountNo"] = Convert.ToString(oDRow["AccountNo"]);
oDR["Bank"] = Convert.ToString(oDRow["BankName"]);
oDR["Branch"] = Convert.ToString(oDRow["BranchName"]);
oDR["RoutingNo"] = Convert.ToString(oDRow["RoutingNo"]);
oDR["Email"] = Convert.ToString(oDRow["EMAILADDRESS"]);
oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["Amount"]));
bankAdvice.Rows.Add(oDR);
if (count == 1)
{
batchNumber = Convert.ToString(oDRow["BatchNumber"]);
paymentDate = Convert.ToDateTime(oDRow["PaymentDate"]);
lfaYear = Convert.ToDateTime(oDRow["LFAYear"]);
}
count++;
}
DataSet dSet = new DataSet();
dSet.Tables.Add(bankAdvice);
List<ReportParameter> parameters = new List<ReportParameter>
{
new ReportParameter("BatchNumber", batchNumber),
new ReportParameter("PaymentDate", paymentDate.ToString("dd MMM yyyy")),
new ReportParameter("LFAYear", lfaYear.Year.ToString())
};
return new ReportProcessor().CommonReportView(null, RdlcName, dSet, null, parameters, true, payrollTypeId, reportType);
}
}
}

View File

@ -61,7 +61,6 @@
<None Remove="RDLC\BanglaPSlipBonus.rdlc" /> <None Remove="RDLC\BanglaPSlipBonus.rdlc" />
<None Remove="RDLC\BanglaPSlipSub.rdlc" /> <None Remove="RDLC\BanglaPSlipSub.rdlc" />
<None Remove="RDLC\BankAdvice.rdlc" /> <None Remove="RDLC\BankAdvice.rdlc" />
<None Remove="RDLC\LFABankAdvice.rdlc" />
<None Remove="RDLC\BankAdviceNmgt.rdlc" /> <None Remove="RDLC\BankAdviceNmgt.rdlc" />
<None Remove="RDLC\BankAdviceSalary.rdlc" /> <None Remove="RDLC\BankAdviceSalary.rdlc" />
<None Remove="RDLC\BankAdviceSalaryHnm.rdlc" /> <None Remove="RDLC\BankAdviceSalaryHnm.rdlc" />
@ -378,7 +377,6 @@
<EmbeddedResource Include="RDLC\BanglaPSlipSub.rdlc" /> <EmbeddedResource Include="RDLC\BanglaPSlipSub.rdlc" />
<EmbeddedResource Include="RDLC\BankAdviceWithRoutingNo.rdlc" /> <EmbeddedResource Include="RDLC\BankAdviceWithRoutingNo.rdlc" />
<EmbeddedResource Include="RDLC\BankAdvice.rdlc" /> <EmbeddedResource Include="RDLC\BankAdvice.rdlc" />
<EmbeddedResource Include="RDLC\LFABankAdvice.rdlc" />
<EmbeddedResource Include="RDLC\BankAdviceNmgt.rdlc" /> <EmbeddedResource Include="RDLC\BankAdviceNmgt.rdlc" />
<EmbeddedResource Include="RDLC\BankAdviceSalary.rdlc" /> <EmbeddedResource Include="RDLC\BankAdviceSalary.rdlc" />
<EmbeddedResource Include="RDLC\BankAdviceSalaryHnm.rdlc" /> <EmbeddedResource Include="RDLC\BankAdviceSalaryHnm.rdlc" />

File diff suppressed because one or more lines are too long

View File

@ -42,8 +42,7 @@
"src/favicon.ico" "src/favicon.ico"
], ],
"styles": [ "styles": [
"src/styles.scss", "src/styles.scss"
"src/styles/theme/gohr-theme.scss"
], ],
"scripts": [ "scripts": [
"node_modules/prismjs/prism.js", "node_modules/prismjs/prism.js",
@ -119,8 +118,7 @@
"tsConfig": "tsconfig.spec.json", "tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js", "karmaConfig": "karma.conf.js",
"styles": [ "styles": [
"src/styles.scss", "src/styles.scss"
"src/styles/theme/gohr-theme.scss"
], ],
"scripts": [], "scripts": [],
"assets": [ "assets": [

View File

@ -20,7 +20,6 @@
"@auth0/angular-jwt": "^5.2.0", "@auth0/angular-jwt": "^5.2.0",
"@azure/msal-angular": "^6.2.5", "@azure/msal-angular": "^6.2.5",
"@azure/msal-browser": "^5.27.0", "@azure/msal-browser": "^5.27.0",
"@microsoft/signalr": "10.0.11",
"@progress/kendo-angular-buttons": "25.3.0", "@progress/kendo-angular-buttons": "25.3.0",
"@progress/kendo-angular-charts": "25.3.0", "@progress/kendo-angular-charts": "25.3.0",
"@progress/kendo-angular-common": "25.3.0", "@progress/kendo-angular-common": "25.3.0",
@ -3371,40 +3370,6 @@
"win32" "win32"
] ]
}, },
"node_modules/@microsoft/signalr": {
"version": "10.0.11",
"resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-10.0.11.tgz",
"integrity": "sha512-FulOJ2EEtKvLQcswe/U7v8pzyXyk7Jua5xgWJPPwyQU/2Z9ORvKcVjyO75VvLsem+CJ1ORRexJ+7Bz1FCei2aw==",
"license": "MIT",
"dependencies": {
"abort-controller": "^3.0.0",
"eventsource": "^2.0.2",
"fetch-cookie": "^2.0.3",
"node-fetch": "^2.6.7",
"ws": "^7.5.10"
}
},
"node_modules/@microsoft/signalr/node_modules/ws": {
"version": "7.5.14",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.14.tgz",
"integrity": "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug==",
"license": "MIT",
"engines": {
"node": ">=8.3.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"node_modules/@modelcontextprotocol/core": { "node_modules/@modelcontextprotocol/core": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.3.1.tgz", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.3.1.tgz",
@ -6227,18 +6192,6 @@
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0" "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"license": "MIT",
"dependencies": {
"event-target-shim": "^5.0.0"
},
"engines": {
"node": ">=6.5"
}
},
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.19.0", "version": "8.19.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz",
@ -8668,15 +8621,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/eventemitter3": { "node_modules/eventemitter3": {
"version": "4.0.7", "version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
@ -8684,15 +8628,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/eventsource": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz",
"integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==",
"license": "MIT",
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/exceljs": { "node_modules/exceljs": {
"version": "4.4.0", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/exceljs/-/exceljs-4.4.0.tgz", "resolved": "https://registry.npmjs.org/exceljs/-/exceljs-4.4.0.tgz",
@ -8870,16 +8805,6 @@
} }
} }
}, },
"node_modules/fetch-cookie": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-2.2.0.tgz",
"integrity": "sha512-h9AgfjURuCgA2+2ISl8GbavpUdR+WGAM2McW/ovn4tVccegp8ZqCKWSBR8uRdM8dDNlx5WdKRWxBYUwteLDCNQ==",
"license": "Unlicense",
"dependencies": {
"set-cookie-parser": "^2.4.8",
"tough-cookie": "^4.0.0"
}
},
"node_modules/file-entry-cache": { "node_modules/file-entry-cache": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@ -11947,26 +11872,6 @@
"semver": "bin/semver.js" "semver": "bin/semver.js"
} }
}, },
"node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
"license": "MIT",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/node-gyp-build-optional-packages": { "node_modules/node-gyp-build-optional-packages": {
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz", "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",
@ -12730,27 +12635,6 @@
} }
} }
}, },
"node_modules/psl": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz",
"integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==",
"license": "MIT",
"dependencies": {
"punycode": "^2.3.1"
},
"funding": {
"url": "https://github.com/sponsors/lupomontero"
}
},
"node_modules/psl/node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/pump": { "node_modules/pump": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz",
@ -12779,12 +12663,6 @@
"node": ">=0.9" "node": ">=0.9"
} }
}, },
"node_modules/querystringify": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"license": "MIT"
},
"node_modules/queue-microtask": { "node_modules/queue-microtask": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@ -13023,6 +12901,7 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/resolve": { "node_modules/resolve": {
@ -13728,12 +13607,6 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/set-cookie-parser": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.3.tgz",
"integrity": "sha512-irZHtTqurLna57KQG/s+fzOwv/J6XSH4cs8M/vsrY3uCaQ3S6+QJguAH0WdN47SXlk82voMZ4naWMQf8fdEoIg==",
"license": "MIT"
},
"node_modules/set-function-length": { "node_modules/set-function-length": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
@ -14431,45 +14304,6 @@
"node": ">=0.6" "node": ">=0.6"
} }
}, },
"node_modules/tough-cookie": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz",
"integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==",
"license": "BSD-3-Clause",
"dependencies": {
"psl": "^1.1.33",
"punycode": "^2.1.1",
"universalify": "^0.2.0",
"url-parse": "^1.5.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/tough-cookie/node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/tough-cookie/node_modules/universalify": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
"integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
"license": "MIT",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
"license": "MIT"
},
"node_modules/traverse": { "node_modules/traverse": {
"version": "0.3.10", "version": "0.3.10",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.10.tgz", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.10.tgz",
@ -14845,16 +14679,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
"license": "MIT",
"dependencies": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
}
},
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -15020,22 +14844,6 @@
"license": "MIT", "license": "MIT",
"optional": true "optional": true
}, },
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
"license": "BSD-2-Clause"
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"license": "MIT",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@ -22,7 +22,6 @@
"@auth0/angular-jwt": "^5.2.0", "@auth0/angular-jwt": "^5.2.0",
"@azure/msal-angular": "^6.2.5", "@azure/msal-angular": "^6.2.5",
"@azure/msal-browser": "^5.27.0", "@azure/msal-browser": "^5.27.0",
"@microsoft/signalr": "10.0.11",
"@progress/kendo-angular-buttons": "25.3.0", "@progress/kendo-angular-buttons": "25.3.0",
"@progress/kendo-angular-charts": "25.3.0", "@progress/kendo-angular-charts": "25.3.0",
"@progress/kendo-angular-common": "25.3.0", "@progress/kendo-angular-common": "25.3.0",

View File

@ -3,7 +3,6 @@
"target": "https://localhost:44374", "target": "https://localhost:44374",
"secure": false, "secure": false,
"changeOrigin": true, "changeOrigin": true,
"ws": true,
"logLevel": "debug" "logLevel": "debug"
} }
} }

View File

@ -1,6 +1,5 @@
import { AfterViewInit, Component, ElementRef, HostListener, ViewChild, ChangeDetectionStrategy } from '@angular/core'; import { AfterViewInit, Component, ElementRef, HostListener, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { ApiService } from '../app.api.service'; import { ApiService } from '../app.api.service';
import { ghColor } from '../gohr-theme/theme-loader';
@Component({ @Component({
standalone: false, standalone: false,
@ -74,7 +73,7 @@ export class BackgroundCanvasComponent {
if (!this.ctx) return; if (!this.ctx) return;
this.ctx.beginPath(); this.ctx.beginPath();
this.ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2); this.ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2);
this.ctx.fillStyle = ghColor('--gh-tb'); this.ctx.fillStyle = '#ffffff';
this.ctx.fill(); this.ctx.fill();
this.ctx.closePath(); this.ctx.closePath();
} }
@ -97,7 +96,7 @@ export class BackgroundCanvasComponent {
this.ctx.beginPath(); this.ctx.beginPath();
this.ctx.moveTo(x1, y1); this.ctx.moveTo(x1, y1);
this.ctx.lineTo(x2, y2); this.ctx.lineTo(x2, y2);
this.ctx.strokeStyle = ghColor('--gh-tb'); this.ctx.strokeStyle = '#ffffff';
this.ctx.stroke(); this.ctx.stroke();
} }
} }

View File

@ -8,7 +8,7 @@
<div class="col-12 md:col-12 lg:col-8"> <div class="col-12 md:col-12 lg:col-8">
<div class="grid"> <div class="grid">
<div class="col-12"> <div class="col-12">
<h2 style="margin-bottom: 0px;color: var(--gh-lk);">{{oCourse.courseTitle}}</h2> <h2 style="margin-bottom: 0px;color: #414278;">{{oCourse.courseTitle}}</h2>
</div> </div>
<div class="col-12"> <div class="col-12">
<p class="bannerDescription">{{oCourse.description}}</p> <p class="bannerDescription">{{oCourse.description}}</p>
@ -19,7 +19,7 @@
<kendo-rating [(ngModel)]="oCourse.rating" [readonly]="true"></kendo-rating> <kendo-rating [(ngModel)]="oCourse.rating" [readonly]="true"></kendo-rating>
</div> </div>
<div class="col-12 md:col-6 lg:col-2"> <div class="col-12 md:col-6 lg:col-2">
<label style="font-weight: bold; color: var(--gh-lk);font-size: 15px;">Users : 0</label> <label style="font-weight: bold; color: #414278;font-size: 15px;">Users : 0</label>
</div> </div>
<div class="col-12 md:col-12 lg:col-7" align="right"><label class="trainer">{{oCourse.trainer.name}}</label></div> <div class="col-12 md:col-12 lg:col-7" align="right"><label class="trainer">{{oCourse.trainer.name}}</label></div>
</div> </div>
@ -35,7 +35,7 @@
</div> </div>
</div> </div>
<div style="margin-top: auto;"> <div style="margin-top: auto;">
<button (click)="onStartCourse()" kendoButton themeColor="primary" style="width: 100%; box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--gh-ht) 70%, transparent); border-radius: 5px;"> <button (click)="onStartCourse()" kendoButton themeColor="primary" style="width: 100%; box-shadow: 0 10px 20px -8px #000000b3; border-radius: 5px;">
Enroll Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i> Enroll Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i>
</button> </button>
</div> </div>
@ -91,7 +91,7 @@
</div> </div>
<div class="grid card" style="margin: auto;"> <div class="grid card" style="margin: auto;">
<div class="col-12" style="margin: auto;" align="right"> <div class="col-12" style="margin: auto;" align="right">
<button (click)="onStartCourse()" kendoButton themeColor="primary" style="box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--gh-ht) 70%, transparent); border-radius: 5px;"> <button (click)="onStartCourse()" kendoButton themeColor="primary" style="box-shadow: 0 10px 20px -8px #000000b3; border-radius: 5px;">
Enroll Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i> Enroll Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i>
</button> </button>
</div> </div>
@ -117,22 +117,22 @@
@if (oLesson.lessonContents.length > 0) { @if (oLesson.lessonContents.length > 0) {
<div class="grid card"> <div class="grid card">
@for (oContent of oLesson.lessonContents; track oContent) { @for (oContent of oLesson.lessonContents; track oContent) {
<div class="col-12" style="padding-top: 0;padding-bottom: 0;cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--gh-ht) 8%, transparent);"> <div class="col-12" style="padding-top: 0;padding-bottom: 0;cursor: pointer; border-bottom: 1px solid rgba(0, 0, 0, 0.08);">
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-8" style="color: var(--gh-lk);"> <div class="col-8" style="color: #414278;">
@if (oContent.contentType === 1) { @if (oContent.contentType === 1) {
<span (click)="onStartCourse()"> <span (click)="onStartCourse()">
<i class="pi pi-video" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-video" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
@if (oContent.contentType === 3) { @if (oContent.contentType === 3) {
<span (click)="onStartCourse()"> <span (click)="onStartCourse()">
<i class="pi pi-file-pdf" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-file-pdf" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
@if (oContent.contentType === 4) { @if (oContent.contentType === 4) {
<span (click)="onStartCourse()"> <span (click)="onStartCourse()">
<i class="pi pi-file-o" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-file-o" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
</div> </div>
@ -157,7 +157,7 @@
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-12" align="right"> <div class="col-12" align="right">
<button class="gh-back" kendoButton [svgIcon]="apiService.KendoSVGIcon['undo']" (click)="onBack()" style="margin-right: 5px;">Back</button> <button kendoButton [svgIcon]="apiService.KendoSVGIcon['undo']" (click)="onBack()" style="margin-right: 5px;">Back</button>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@
} }
.banner{ .banner{
background:$lms-bg-banner; background:$lms-bg-banner;
// box-shadow: 0px 8px 14px 0 color-mix(in srgb, var(--gh-sb) 55%, transparent); // box-shadow: 0px 8px 14px 0 rgba(10, 42, 90, 0.55);
border-right: 2px solid $brand-primary-dark; border-right: 2px solid $brand-primary-dark;
border-left: 2px solid $brand-primary-dark; border-left: 2px solid $brand-primary-dark;
border-radius: 10px; border-radius: 10px;
@ -111,7 +111,7 @@ p{
left: 25%; left: 25%;
outline: 0; outline: 0;
border: none; border: none;
box-shadow: 2px 2px 10px color-mix(in srgb, $lms-shadow-gray 50%, transparent); box-shadow: 2px 2px 10px rgba($lms-shadow-gray, .5);
transition: all .5s ease-in-out; transition: all .5s ease-in-out;
&:hover { &:hover {
background: $lms-bg-card-light; background: $lms-bg-card-light;

View File

@ -58,7 +58,7 @@ export class CourseDetailsComponent implements OnInit {
this.loadingpanelService.ShowLoadingPanel = true; this.loadingpanelService.ShowLoadingPanel = true;
this.lmsService.GetCourseForUser(this.oCourse.id).subscribe( this.lmsService.GetCourseForUser(this.oCourse.id).subscribe(
(resp: any) => { (resp: any) => {
; debugger;
this.oCourse = undefined; this.oCourse = undefined;
this.oCourse = resp; this.oCourse = resp;
}, },

View File

@ -3,7 +3,7 @@
<div class="banner"> <div class="banner">
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-12 md:col-12 lg:col-1" style="margin: auto;" align="middle"><img id="imgProfilePicture" [src]="getImageSrc(oCourse.courseTemplate)" class="courseTemplate"/></div> <div class="col-12 md:col-12 lg:col-1" style="margin: auto;" align="middle"><img id="imgProfilePicture" [src]="getImageSrc(oCourse.courseTemplate)" class="courseTemplate"/></div>
<div class="col-12 md:col-12 lg:col-6" style="margin: auto;" align="left"><h3 style="margin-bottom: 0px;color: var(--gh-lk);">{{oCourse.courseTitle}} ({{oCourse.courseCode}})</h3></div> <div class="col-12 md:col-12 lg:col-6" style="margin: auto;" align="left"><h3 style="margin-bottom: 0px;color: #414278;">{{oCourse.courseTitle}} ({{oCourse.courseCode}})</h3></div>
<div class="col-12 md:col-12 lg:col-5" style="margin: auto;" align="right"><label class="trainer">Trainer - {{oCourse.trainer.name}}</label></div> <div class="col-12 md:col-12 lg:col-5" style="margin: auto;" align="right"><label class="trainer">Trainer - {{oCourse.trainer.name}}</label></div>
<div class="col-12 md:col-6 lg:col-2" style="margin: auto;font-weight: bold;"><label>{{oCourse.courseType.name}}</label></div> <div class="col-12 md:col-6 lg:col-2" style="margin: auto;font-weight: bold;"><label>{{oCourse.courseType.name}}</label></div>
@ -19,22 +19,22 @@
[value]="oCourse.courseProgres.completionPercentage" [value]="oCourse.courseProgres.completionPercentage"
[label]="label" [label]="label"
style=" width: 100%; style=" width: 100%;
color: var(--gh-lk); color: #414278;
border-radius: 10px; border-radius: 10px;
font-weight: bold; font-weight: bold;
height: 20px; height: 20px;
border: 1px solid var(--gh-bo2);"> border: 1px solid #c4cbc4;">
</kendo-progressbar> </kendo-progressbar>
</div> </div>
} }
@if (oCourse.enrollments === null) { @if (oCourse.enrollments === null) {
<div class="col-12 md:col-12 lg:col-8" style="font-weight: bold;margin: auto;font-size: 18px;"> <div class="col-12 md:col-12 lg:col-8" style="font-weight: bold;margin: auto;font-size: 18px;">
Excited to begin? Click the '<strong style="color: var(--gh-dn);">Start Course</strong>' button to embark on an exciting learning journey through this course Excited to begin? Click the '<strong style="color: red;">Start Course</strong>' button to embark on an exciting learning journey through this course
</div> </div>
} }
@if (oCourse.enrollments === null) { @if (oCourse.enrollments === null) {
<div class="col-12 md:col-12 lg:col-4" align="right"> <div class="col-12 md:col-12 lg:col-4" align="right">
<button (click)="onStartCourse()" kendoButton themeColor="primary" style="box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--gh-ht) 70%, transparent); border-radius: 5px;"> <button (click)="onStartCourse()" kendoButton themeColor="primary" style="box-shadow: 0 10px 20px -8px #000000b3; border-radius: 5px;">
Start Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i> Start Course <i class="pi pi-spin pi-angle-double-right" style="margin-left: 5px;font-weight: bold;"></i>
</button> </button>
</div> </div>
@ -68,26 +68,26 @@
@if (oLesson.lessonContents.length > 0) { @if (oLesson.lessonContents.length > 0) {
<div class="grid card"> <div class="grid card">
@for (oContent of oLesson.lessonContents; track oContent) { @for (oContent of oLesson.lessonContents; track oContent) {
<div class="col-12" style="padding: 0;cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--gh-ht) 8%, transparent);color: var(--gh-lk);"> <div class="col-12" style="padding: 0;cursor: pointer; border-bottom: 1px solid rgba(0, 0, 0, 0.08);color: #414278;">
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-10" (click)="onItemClick(oContent, oLesson)" [ngStyle]="{'background': oContent.isLessonComplete === true ? 'color-mix(in srgb, var(--gh-ok) 35%, var(--gh-tb))' : 'color-mix(in srgb, var(--gh-dn) 12%, var(--gh-tb))'}"> <div class="col-10" (click)="onItemClick(oContent, oLesson)" [ngStyle]="{'background': oContent.isLessonComplete === true ? '#d0efd0' : '#f5d9d9'}">
@if (oContent.contentType === 1) { @if (oContent.contentType === 1) {
<span> <span>
<i class="pi pi-video" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-video" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
@if (oContent.contentType === 3) { @if (oContent.contentType === 3) {
<span> <span>
<i class="pi pi-file-pdf" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-file-pdf" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
@if (oContent.contentType === 4) { @if (oContent.contentType === 4) {
<span> <span>
<i class="pi pi-file-o" style="color: var(--gh-warn);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }} <i class="pi pi-file-o" style="color: rgb(194, 97, 7);"></i>&nbsp;&nbsp;&nbsp;{{ oContent.contentTitle }}
</span> </span>
} }
</div> </div>
<div class="col-2" (click)="onItemClickCheck(oContent, oLesson)" align="right" style="margin: auto;" [ngStyle]="{'background': oContent.isLessonComplete === true ? 'color-mix(in srgb, var(--gh-ok) 35%, var(--gh-tb))' : 'color-mix(in srgb, var(--gh-dn) 12%, var(--gh-tb))'}"> <div class="col-2" (click)="onItemClickCheck(oContent, oLesson)" align="right" style="margin: auto;" [ngStyle]="{'background': oContent.isLessonComplete === true ? '#d0efd0' : '#f5d9d9'}">
@if (oContent.isLessonComplete === true) { @if (oContent.isLessonComplete === true) {
<input type="checkbox" id="enableConfirmCheck" [(ngModel)]="oContent.isComplete" kendoCheckBox/> <input type="checkbox" id="enableConfirmCheck" [(ngModel)]="oContent.isComplete" kendoCheckBox/>
} }
@ -105,8 +105,8 @@
} }
</div> </div>
<div class="col-12 md:col-12 lg:col-8"> <div class="col-12 md:col-12 lg:col-8">
<fieldset style="border: 1px solid var(--gh-bo);"> <fieldset style="border: 1px solid #ced4da;">
<legend style="font-weight: bold;color: var(--gh-lk);;">{{lessonName}}</legend> <legend style="font-weight: bold;color: #414278;;">{{lessonName}}</legend>
<div class="grid"> <div class="grid">
@if (contentDescription !== '') { @if (contentDescription !== '') {
<div class="col-12" ><label style="font-weight: bold;">{{contentDescription}}</label></div> <div class="col-12" ><label style="font-weight: bold;">{{contentDescription}}</label></div>

View File

@ -82,14 +82,14 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 20px; /* Height of the blur effect */ height: 20px; /* Height of the blur effect */
background: linear-gradient(to bottom, color-mix(in srgb, $lms-bg-course-banner 0%, transparent) 0%, $lms-bg-course-banner 100%); background: linear-gradient(to bottom, rgba($lms-bg-course-banner, 0) 0%, $lms-bg-course-banner 100%);
pointer-events: none; /* Prevent interaction with the pseudo-element */ pointer-events: none; /* Prevent interaction with the pseudo-element */
} }
.banner{ .banner{
background:$lms-bg-banner; background:$lms-bg-banner;
// box-shadow: 0px 2px 5px 0 color-mix(in srgb, var(--gh-sb) 55%, transparent); // box-shadow: 0px 2px 5px 0 rgba(10, 42, 90, 0.55);
border-right: 2px solid $brand-primary-dark; border-right: 2px solid $brand-primary-dark;
border-left: 2px solid $brand-primary-dark; border-left: 2px solid $brand-primary-dark;
border-radius: 10px; border-radius: 10px;
@ -188,7 +188,7 @@ top: 73%;
left: 25%; left: 25%;
outline: 0; outline: 0;
border: none; border: none;
box-shadow: 2px 2px 10px color-mix(in srgb, $lms-shadow-gray 50%, transparent); box-shadow: 2px 2px 10px rgba($lms-shadow-gray, .5);
transition: all .5s ease-in-out; transition: all .5s ease-in-out;
&:hover { &:hover {
background: $lms-bg-card-light; background: $lms-bg-card-light;

View File

@ -84,7 +84,7 @@ export class CourseEnrollComponent implements OnInit {
this.loadingpanelService.ShowLoadingPanel = true; this.loadingpanelService.ShowLoadingPanel = true;
this.lmsService.GetCourseForEnrollment(this.oCourse.id).subscribe( this.lmsService.GetCourseForEnrollment(this.oCourse.id).subscribe(
(resp: any) => { (resp: any) => {
; debugger;
this.oCourse = undefined; this.oCourse = undefined;
this.oCourse = resp; this.oCourse = resp;
}, },
@ -182,7 +182,7 @@ export class CourseEnrollComponent implements OnInit {
this.cancelApiCall$.next(); this.cancelApiCall$.next();
this.cancelApiCall$.complete(); this.cancelApiCall$.complete();
; debugger;
this.loadContent(oContent, oLesson); this.loadContent(oContent, oLesson);
this.oLessonProgress = new LessonProgress(); this.oLessonProgress = new LessonProgress();
if(this.oCourse.lessonProgres.length > 0){ if(this.oCourse.lessonProgres.length > 0){
@ -227,7 +227,7 @@ export class CourseEnrollComponent implements OnInit {
userCourseProgress(){ userCourseProgress(){
this.lmsService.UserCourseProgress(this.oCourse).subscribe( this.lmsService.UserCourseProgress(this.oCourse).subscribe(
(resp: any) => { (resp: any) => {
; debugger;
this.oCourse = undefined; this.oCourse = undefined;
this.oCourse = resp; this.oCourse = resp;
}, },
@ -273,7 +273,7 @@ export class CourseEnrollComponent implements OnInit {
this.isShowPowerpoint = false; this.isShowPowerpoint = false;
} }
if(oContent.contentType === EnumContentType.Powerpoint){ if(oContent.contentType === EnumContentType.Powerpoint){
; debugger;
const fileID = this.extractFileIDForPPTS(oContent.contentUrl); const fileID = this.extractFileIDForPPTS(oContent.contentUrl);
this.powerpointSource = this.sanitizer.bypassSecurityTrustResourceUrl(`https://docs.google.com/presentation/d/${fileID}/embed?start=true&loop=true&delayms=5000`); this.powerpointSource = this.sanitizer.bypassSecurityTrustResourceUrl(`https://docs.google.com/presentation/d/${fileID}/embed?start=true&loop=true&delayms=5000`);
this.isShowVideo = false; this.isShowVideo = false;
@ -330,7 +330,7 @@ export class CourseEnrollComponent implements OnInit {
return difficultyLevel; return difficultyLevel;
} }
onLessonExpand(event:any,oLesson : Lessons){ onLessonExpand(event:any,oLesson : Lessons){
; debugger;
if(event === true){ if(event === true){
this.lessonName = oLesson.lessonNo + ' - ' + oLesson.lessonTitle; this.lessonName = oLesson.lessonNo + ' - ' + oLesson.lessonTitle;
} }

View File

@ -1,6 +1,6 @@
<app-loading-panel></app-loading-panel> <app-loading-panel></app-loading-panel>
<fieldset style="border-color: var(--gh-btn);"> <fieldset style="border-color: #414278;">
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-3" style="margin:auto;font-weight: bold"><label for="ddlType">Type Name</label></div> <div class="col-3" style="margin:auto;font-weight: bold"><label for="ddlType">Type Name</label></div>
<div class="col-1" style="margin:auto;font-weight: bold">:</div> <div class="col-1" style="margin:auto;font-weight: bold">:</div>
@ -38,7 +38,7 @@
<div class="grid" style="margin-top: 5px;"> <div class="grid" style="margin-top: 5px;">
<div class="col-12" style="margin: auto;" align="right"> <div class="col-12" style="margin: auto;" align="right">
<button class="gh-close" kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="onPopUpClose()" style="margin-right: 5px;">Close</button> <button kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="onPopUpClose()" style="margin-right: 5px;">Close</button>
<button class="gh-save" kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['save']" (click)="onSave()">Save</button> <button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['save']" (click)="onSave()">Save</button>
</div> </div>
</div> </div>

View File

@ -21,7 +21,7 @@ export class CourseTypeEntryComponent implements OnInit {
@Output() saveHandler = new EventEmitter<any>(); @Output() saveHandler = new EventEmitter<any>();
@Input() public set SetCourseType(oCourseType: CourseType) { @Input() public set SetCourseType(oCourseType: CourseType) {
; debugger;
this.oCourseType = undefined; this.oCourseType = undefined;
this.oCourseType = oCourseType; this.oCourseType = oCourseType;
} }

View File

@ -8,7 +8,6 @@
style="max-height: 450px;"> style="max-height: 450px;">
<ng-template kendoGridToolbarTemplate> <ng-template kendoGridToolbarTemplate>
<button themeColor="primary" kendoGridAddCommand [svgIcon]="apiService.KendoSVGIcon['plus']" (click)="addHandler()">Add New Course Type</button> <button themeColor="primary" kendoGridAddCommand [svgIcon]="apiService.KendoSVGIcon['plus']" (click)="addHandler()">Add New Course Type</button>
<!-- kendoGridToolbarFocusable: registers the dropdown with the toolbar's keyboard navigation, so a click no longer moves focus to the first toolbar button and closes the list -->
<kendo-dropdownlist [data]="statusOptions" <kendo-dropdownlist [data]="statusOptions"
[defaultItem]="{ name: 'select a Course Type..', value: null }" [defaultItem]="{ name: 'select a Course Type..', value: null }"
[textField]="'name'" [textField]="'name'"
@ -16,12 +15,12 @@
[valuePrimitive]="true" [valuePrimitive]="true"
[(ngModel)]="selectedStatus" [(ngModel)]="selectedStatus"
(valueChange)="selectedStatusChange($event)" (valueChange)="selectedStatusChange($event)"
class="form-control form-control-sm ct-toolbar-dd" kendoGridToolbarFocusable> class="form-control form-control-sm">
</kendo-dropdownlist> </kendo-dropdownlist>
<input placeholder="Search in all columns..." kendoTextBox (input)="onFilter($event.target.value)" class="ct-toolbar-search" kendoGridToolbarFocusable/> <input placeholder="Search in all columns..." kendoTextBox (input)="onFilter($event.target.value)" style="width: 30%;"/>
<label style="font-weight: bold;">Total Course Type : {{allCourseType.length}}</label> <label style="font-weight: bold;">Total Course Type : {{allCourseType.length}}</label>
<kendo-grid-spacer></kendo-grid-spacer> <kendo-grid-spacer></kendo-grid-spacer>
<button class="gh-excel" type="button" kendoGridExcelCommand [svgIcon]="apiService.KendoSVGIcon['fileExcel']">Export to Excel</button> <button type="button" kendoGridExcelCommand [svgIcon]="apiService.KendoSVGIcon['fileExcel']">Export to Excel</button>
</ng-template> </ng-template>
<kendo-grid-column field="name" title="Course Type" [width]="90" [headerStyle]="{'white-space': 'pre-wrap'}"> <kendo-grid-column field="name" title="Course Type" [width]="90" [headerStyle]="{'white-space': 'pre-wrap'}">
</kendo-grid-column> </kendo-grid-column>
@ -37,7 +36,7 @@
[style]="{'text-align': 'center' }"> [style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editHandler(dataItem)"></button> <button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editHandler(dataItem)"></button>
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteHandler(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteHandler(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>

View File

@ -1,9 +0,0 @@
/* Grid toolbar: dropdown and search at a fixed width on one line (layout only) */
.ct-toolbar-dd {
width: 220px !important;
flex: 0 0 auto;
}
.ct-toolbar-search {
width: 260px !important;
flex: 0 0 auto;
}

View File

@ -3,7 +3,7 @@
<kendo-tabstrip> <kendo-tabstrip>
<kendo-tabstrip-tab title="Course Basic Information" [selected]="true"> <kendo-tabstrip-tab title="Course Basic Information" [selected]="true">
<ng-template kendoTabContent> <ng-template kendoTabContent>
<fieldset style="border-color: var(--gh-btn);"> <fieldset style="border-color: #414278;">
<legend style="font-weight: bold;">Course Basic information</legend> <legend style="font-weight: bold;">Course Basic information</legend>
<div class="grid"> <div class="grid">
<div class="col-12 md:col-12 lg:col-3 form-control-sm" style="margin:auto;"> <div class="col-12 md:col-12 lg:col-3 form-control-sm" style="margin:auto;">
@ -48,7 +48,7 @@
</div> </div>
<div class="col-12 md:col-12 lg:col-6 form-control-sm" style="margin: auto;"> <div class="col-12 md:col-12 lg:col-6 form-control-sm" style="margin: auto;">
<label style="margin:auto;font-weight: bold">Course Template</label> <label style="margin:auto;font-weight: bold">Course Template</label>
<div style="display: flex; align-items: center; width: 100%; border: 1px solid var(--gh-bo); border-radius: 4px;"> <div style="display: flex; align-items: center; width: 100%; border: 1px solid #ced4da; border-radius: 4px;">
<input kendoTextBox style="width:100%; border: none; padding: 0 0 0 5px;" [(ngModel)]="templateFile" <input kendoTextBox style="width:100%; border: none; padding: 0 0 0 5px;" [(ngModel)]="templateFile"
(change)="selectTemplatenHandler($event)" accept=".jpg,.png" type="file"> (change)="selectTemplatenHandler($event)" accept=".jpg,.png" type="file">
@if (oCourse !== undefined && oCourse.courseTemplate.fileName !== '') { @if (oCourse !== undefined && oCourse.courseTemplate.fileName !== '') {
@ -85,7 +85,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletewhomForThisCourse(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletewhomForThisCourse(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -107,7 +107,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletewhatWillLearn(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletewhatWillLearn(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -129,7 +129,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletehowDoStart(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletehowDoStart(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -151,7 +151,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletecourseInclude(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deletecourseInclude(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -185,7 +185,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="duration" title="Duration" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','text-align':'center'}"> <kendo-grid-column field="duration" title="Duration" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','text-align':'center'}">
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="" title="Content" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align':'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','text-align':'center','color':'var(--gh-dn)'}"> <kendo-grid-column field="" title="Content" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align':'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','text-align':'center','color':'red'}">
<ng-template kendoGridCellTemplate let-dataItem> <ng-template kendoGridCellTemplate let-dataItem>
{{dataItem.lessonContents.length}} {{dataItem.lessonContents.length}}
</ng-template> </ng-template>
@ -193,7 +193,7 @@
<kendo-grid-command-column title="Action" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="40" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}"[style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editLesson(dataItem)"></button> <button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editLesson(dataItem)"></button>
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteLesson(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteLesson(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -206,7 +206,7 @@
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-12" align="right"> <div class="col-12" align="right">
<button class="gh-back" kendoButton [svgIcon]="apiService.KendoSVGIcon['undo']" (click)="onBack()" style="margin-right: 5px;">Back</button> <button kendoButton [svgIcon]="apiService.KendoSVGIcon['undo']" (click)="onBack()" style="margin-right: 5px;">Back</button>
<button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['save']" (click)="onSave()">Save Course</button> <button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['save']" (click)="onSave()">Save Course</button>
</div> </div>
</div> </div>
@ -215,7 +215,7 @@
<div class="blur-background"> <div class="blur-background">
@if (isShowNewLesson) { @if (isShowNewLesson) {
<kendo-window [minWidth]="1100" [width]="1000" [maxHeight]="590" title="Add New Lesson" (close)="onAddNewLessonClose()" > <kendo-window [minWidth]="1100" [width]="1000" [maxHeight]="590" title="Add New Lesson" (close)="onAddNewLessonClose()" >
<fieldset style="border-color: var(--gh-btn);"> <fieldset style="border-color: #414278;">
<legend style="font-weight: bold;">Lesson Basic information</legend> <legend style="font-weight: bold;">Lesson Basic information</legend>
<div class="grid"> <div class="grid">
<div class="col-12 md:col-12 lg:col-3 form-control-sm" style="margin:auto;"> <div class="col-12 md:col-12 lg:col-3 form-control-sm" style="margin:auto;">
@ -248,7 +248,7 @@
</div> </div>
</div> </div>
</fieldset> </fieldset>
<fieldset style="border-color: var(--gh-btn);"> <fieldset style="border-color: #414278;">
<legend style="font-weight: bold;">Lesson's Content</legend> <legend style="font-weight: bold;">Lesson's Content</legend>
<div class="grid"> <div class="grid">
<div class="col-12 md:col-12 lg:col-12 form-control-sm"> <div class="col-12 md:col-12 lg:col-12 form-control-sm">
@ -263,7 +263,7 @@
</ng-template> </ng-template>
<kendo-grid-column field="contentTitle" title="Content Title" [width]="100" [headerStyle]="{'white-space': 'pre-wrap'}" [style]="{ 'font-size': '12px'}"> <kendo-grid-column field="contentTitle" title="Content Title" [width]="100" [headerStyle]="{'white-space': 'pre-wrap'}" [style]="{ 'font-size': '12px'}">
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="contentType" title="Type" [width]="50" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','color': 'var(--gh-dn)'}"> <kendo-grid-column field="contentType" title="Type" [width]="50" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{ 'font-size': '12px','font-weight':'bold','color': 'red'}">
<ng-template kendoGridCellTemplate let-dataItem> <ng-template kendoGridCellTemplate let-dataItem>
{{getContentTypeString(dataItem.contentType)}} {{getContentTypeString(dataItem.contentType)}}
</ng-template> </ng-template>
@ -275,7 +275,7 @@
<kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{'text-align': 'center' }"> <kendo-grid-command-column title="Action" [width]="55" [headerStyle]="{'white-space': 'pre-wrap','text-align': 'center'}" [style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary" (click)="editLessonContent(dataItem)"></button> <button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary" (click)="editLessonContent(dataItem)"></button>
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteLessonContent(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteLessonContent(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>
@ -284,7 +284,7 @@
</fieldset> </fieldset>
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-12 md:col-12 lg:col-12" align="right"> <div class="col-12 md:col-12 lg:col-12" align="right">
<button class="gh-close" kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="onAddNewLessonClose()" style="margin-right: 5px;">Close</button> <button kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="onAddNewLessonClose()" style="margin-right: 5px;">Close</button>
<button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['plus']" (click)="addLesson()">Add Lesson</button> <button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['plus']" (click)="addLesson()">Add Lesson</button>
</div> </div>
</div> </div>
@ -297,7 +297,7 @@
<div class="blur-background"> <div class="blur-background">
@if (isShowNewContent) { @if (isShowNewContent) {
<kendo-window [minWidth]="600" [width]="600" [maxHeight]="590" title="Add New Content" (close)="addNewContentClose()" > <kendo-window [minWidth]="600" [width]="600" [maxHeight]="590" title="Add New Content" (close)="addNewContentClose()" >
<fieldset style="border-color: var(--gh-btn);"> <fieldset style="border-color: #414278;">
<div class="grid"> <div class="grid">
<div class="col-12 md:col-12 lg:col-12 form-control-sm" style="margin:auto;"> <div class="col-12 md:col-12 lg:col-12 form-control-sm" style="margin:auto;">
<label style="margin:auto;font-weight: bold">Content Title</label> <label style="margin:auto;font-weight: bold">Content Title</label>
@ -343,7 +343,7 @@
</fieldset> </fieldset>
<div class="grid" style="margin: auto;"> <div class="grid" style="margin: auto;">
<div class="col-12 md:col-12 lg:col-12" align="right"> <div class="col-12 md:col-12 lg:col-12" align="right">
<button class="gh-close" kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="addNewContentClose()" style="margin-right: 5px;">Close</button> <button kendoButton [svgIcon]="apiService.KendoSVGIcon['cross']" (click)="addNewContentClose()" style="margin-right: 5px;">Close</button>
@if (isLessonContentEdit) { @if (isLessonContentEdit) {
<button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['edit']" (click)="addContent()">Edit Content</button> <button kendoButton themeColor="primary" [svgIcon]="apiService.KendoSVGIcon['edit']" (click)="addContent()">Edit Content</button>
} }

View File

@ -9,7 +9,7 @@
:host ::ng-deep .k-tabstrip-items .k-item.k-state-active, .k-tabstrip-items .k-item.k-state-selected { :host ::ng-deep .k-tabstrip-items .k-item.k-state-active, .k-tabstrip-items .k-item.k-state-selected {
color: $brand-primary-dark; color: $brand-primary-dark;
background-color: var(--gh-pb); background-color: #f6fff5;
border-bottom: 2px solid $brand-primary-dark; border-bottom: 2px solid $brand-primary-dark;
} }

View File

@ -156,7 +156,7 @@ export class CoursesEntryComponent implements OnInit {
}); });
} }
//#endregion //#endregion
; debugger;
//#region FOR Template //#region FOR Template
if(this.oCourse.courseTemplate !== undefined){ if(this.oCourse.courseTemplate !== undefined){
this.oCourse.courseTemplate.fileData = this.oCourse.courseTemplate.fileTobase64; this.oCourse.courseTemplate.fileData = this.oCourse.courseTemplate.fileTobase64;
@ -170,7 +170,7 @@ export class CoursesEntryComponent implements OnInit {
this.router.navigateByUrl('/lms/courses'); this.router.navigateByUrl('/lms/courses');
} }
onSave(){ onSave(){
; debugger;
if(this.oCourse.courseTitle === ""){ if(this.oCourse.courseTitle === ""){
this.notificationService.showWarning("Please enter Course Title.","Warning!"); this.notificationService.showWarning("Please enter Course Title.","Warning!");
return; return;
@ -359,7 +359,7 @@ export class CoursesEntryComponent implements OnInit {
} }
} }
setData(type: string){ setData(type: string){
; debugger;
if(type === "targetedAudience"){ if(type === "targetedAudience"){
if(this.oCourse !== undefined){ if(this.oCourse !== undefined){
this.oCourse.targetedAudience = ""; this.oCourse.targetedAudience = "";
@ -441,7 +441,7 @@ export class CoursesEntryComponent implements OnInit {
} }
} }
showCourseTemplate(item : LMSTemplate){ showCourseTemplate(item : LMSTemplate){
; debugger;
this.displayAttachment = true; this.displayAttachment = true;
if(item.templateID > 0){ if(item.templateID > 0){
this.fileData = item.fileTobase64; this.fileData = item.fileTobase64;
@ -623,7 +623,7 @@ export class CoursesEntryComponent implements OnInit {
this.notificationService.showActiveConfirm('Confirmation', "Are you sure tou want to add this content for this lesson?").then((isConfirmed) => { this.notificationService.showActiveConfirm('Confirmation', "Are you sure tou want to add this content for this lesson?").then((isConfirmed) => {
if (isConfirmed) if (isConfirmed)
{ {
; debugger;
if(this.oLesson !== undefined && this.oLesson.lessonContents !== undefined ){ if(this.oLesson !== undefined && this.oLesson.lessonContents !== undefined ){
this.oLesson.lessonContents.push(this.oLessonContent); this.oLesson.lessonContents.push(this.oLessonContent);
} }

View File

@ -15,12 +15,12 @@
[valuePrimitive]="true" [valuePrimitive]="true"
[(ngModel)]="selectedStatus" [(ngModel)]="selectedStatus"
(valueChange)="selectedStatusChange($event)" (valueChange)="selectedStatusChange($event)"
class="form-control form-control-sm ct-toolbar-dd" kendoGridToolbarFocusable> class="form-control form-control-sm">
</kendo-dropdownlist> </kendo-dropdownlist>
<input placeholder="Search in all columns..." kendoTextBox (input)="onFilter($event.target.value)" class="ct-toolbar-search" kendoGridToolbarFocusable/> <input placeholder="Search in all columns..." kendoTextBox (input)="onFilter($event.target.value)" style="width: 30%;"/>
<label style="font-weight: bold;">Total Course : {{courses.length}}</label> <label style="font-weight: bold;">Total Course : {{courses.length}}</label>
<kendo-grid-spacer></kendo-grid-spacer> <kendo-grid-spacer></kendo-grid-spacer>
<button class="gh-excel" type="button" kendoGridExcelCommand [svgIcon]="apiService.KendoSVGIcon['fileExcel']">Export to Excel</button> <button type="button" kendoGridExcelCommand [svgIcon]="apiService.KendoSVGIcon['fileExcel']">Export to Excel</button>
</ng-template> </ng-template>
<kendo-grid-column field="courseTitle" title="Course Title" [width]="160" [headerStyle]="{'white-space': 'pre-wrap'}" [style]="{ 'font-size': '12px','font-weight':'bold'}"> <kendo-grid-column field="courseTitle" title="Course Title" [width]="160" [headerStyle]="{'white-space': 'pre-wrap'}" [style]="{ 'font-size': '12px','font-weight':'bold'}">
</kendo-grid-column> </kendo-grid-column>
@ -47,7 +47,7 @@
[style]="{'text-align': 'center' }"> [style]="{'text-align': 'center' }">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editHandler(dataItem)"></button> <button kendoGridEditCommand [style.font-size.px]="10" [svgIcon]="apiService.KendoSVGIcon['edit']" themeColor="primary"(click)="editHandler(dataItem)"></button>
<button kendoGridRemoveCommand [style.font-size.px]="10" style="color:var(--gh-tb);background: var(--gh-bd);" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteHandler(dataItem)"></button> <button kendoGridRemoveCommand [style.font-size.px]="10" style="color:white;background: #e72582;" [svgIcon]="apiService.KendoSVGIcon['delete']" (click)="deleteHandler(dataItem)"></button>
</ng-template> </ng-template>
</kendo-grid-command-column> </kendo-grid-command-column>
</kendo-grid> </kendo-grid>

View File

@ -1,9 +0,0 @@
/* Grid toolbar: dropdown and search at a fixed width (same as Course Type) instead of stretching */
.ct-toolbar-dd {
width: 220px !important;
flex: 0 0 auto;
}
.ct-toolbar-search {
width: 260px !important;
flex: 0 0 auto;
}

View File

@ -50,7 +50,7 @@ export class CoursesComponent implements OnInit {
this.loadingpanelService.ShowLoadingPanel = true; this.loadingpanelService.ShowLoadingPanel = true;
this.lmsService.GetCoursesByStatus(status).subscribe( this.lmsService.GetCoursesByStatus(status).subscribe(
(resp: any) => { (resp: any) => {
; debugger;
this.courses = resp; this.courses = resp;
this.coursesAll = resp; this.coursesAll = resp;
}, },

View File

@ -23,7 +23,7 @@
<img [src]="getImageSrc(course.courseTemplate)" id="imgProfilePicture" class="courseTemplate" alt="Template Image"> <img [src]="getImageSrc(course.courseTemplate)" id="imgProfilePicture" class="courseTemplate" alt="Template Image">
</div> </div>
<div class="more-info"> <div class="more-info">
<h4 style="color: var(--gh-lk);font-weight: bold;">{{course.courseTitle}}</h4> <h4 style="color: #414278;font-weight: bold;">{{course.courseTitle}}</h4>
<div class="coords"> <div class="coords">
<span>Creation&nbsp;:&nbsp;{{ course.createdDate | date: 'dd MMM yyyy' }}</span> <span>Creation&nbsp;:&nbsp;{{ course.createdDate | date: 'dd MMM yyyy' }}</span>
</div> </div>
@ -50,7 +50,7 @@
</div> </div>
</div> </div>
<div class="general"> <div class="general">
<h4 style="color: var(--gh-lk);font-weight: bold;">{{course.courseTitle}}</h4> <h4 style="color: #414278;font-weight: bold;">{{course.courseTitle}}</h4>
<p>{{course.tags}}</p> <p>{{course.tags}}</p>
@if (course.enrollments !== null) { @if (course.enrollments !== null) {
<span class="more"> <span class="more">
@ -59,11 +59,11 @@
[value]="course.courseProgres.completionPercentage" [value]="course.courseProgres.completionPercentage"
[label]="label" [label]="label"
style=" width: 100%; style=" width: 100%;
color: var(--gh-lk); color: #414278;
border-radius: 10px; border-radius: 10px;
font-weight: bold; font-weight: bold;
height: 15px; height: 15px;
border: 1px solid var(--gh-bo2);"> border: 1px solid #c5d3c5;">
</kendo-progressbar></span> </kendo-progressbar></span>
} }
</div> </div>

View File

@ -33,7 +33,7 @@
height: 180px; height: 180px;
background-color: $color-white; background-color: $color-white;
background: linear-gradient($lms-bg-card-gradient-top, $color-white); background: linear-gradient($lms-bg-card-gradient-top, $color-white);
box-shadow: 0 8px 16px -8px color-mix(in srgb, $color-black 40%, transparent); box-shadow: 0 8px 16px -8px rgba($color-black,0.4);
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
@ -78,7 +78,7 @@
top: 10%; top: 10%;
right: -2px; right: -2px;
height: 80%; height: 80%;
border-left: 2px solid color-mix(in srgb, $color-black 3%, transparent); border-left: 2px solid rgba($color-black,0.025);
} }
:host ::ng-deep .courseCard .additional .user-card .level, :host ::ng-deep .courseCard .additional .user-card .level,
@ -88,7 +88,7 @@
text-transform: uppercase; text-transform: uppercase;
font-size: 0.75em; font-size: 0.75em;
font-weight: bold; font-weight: bold;
background: color-mix(in srgb, $color-black 15%, transparent); background: rgba($color-black,0.15);
padding: 0.125rem 0.75rem; padding: 0.125rem 0.75rem;
border-radius: 100px; border-radius: 100px;
white-space: nowrap; white-space: nowrap;
@ -210,7 +210,7 @@ $color_grey_dark: $lms-gray-mid;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 1rem auto; margin: 1rem auto;
box-shadow: 0 2px 8px color-mix(in srgb, $color-black 12%, transparent); box-shadow: 0 2px 8px rgba($color-black, .12);
margin-bottom: 1.6%; margin-bottom: 1.6%;
background: $color_white; background: $color_white;
line-height: 1.4; line-height: 1.4;
@ -259,7 +259,7 @@ $color_grey_dark: $lms-gray-mid;
left: -100%; left: -100%;
margin: auto; margin: auto;
transition: left .2s; transition: left .2s;
background: color-mix(in srgb, $color-black 60%, transparent); background: rgba($color-black, .6);
color: $color_white; color: $color_white;
padding: 10px; padding: 10px;
width: 100%; width: 100%;

View File

@ -49,7 +49,7 @@ export class UserCoursesComponent implements OnInit {
this.loadingpanelService.ShowLoadingPanel = true; this.loadingpanelService.ShowLoadingPanel = true;
this.lmsService.GetCoursesByStatus(EnumStatus.Active).subscribe( this.lmsService.GetCoursesByStatus(EnumStatus.Active).subscribe(
(resp: any) => { (resp: any) => {
; debugger;
this.courses = resp; this.courses = resp;
this.coursesAll = resp; this.coursesAll = resp;
}, },

View File

@ -41,7 +41,7 @@ export class OrganizationListComponent implements OnInit {
/* this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String));*/ /* this.msv.listViewColumn.push(new BasicMasterListColumn('Status', 'Status', EnumColumnDataTypes.String));*/
this.msv.entryFrom.formHeight = 500; this.msv.entryFrom.formHeight = 500;
this.msv.entryFrom.formWidth = 750; this.msv.entryFrom.formWidth = 550;
this.msv.entryFrom.caption = 'Organization'; this.msv.entryFrom.caption = 'Organization';
this.msv.entryFrom.iDColumnName = 'id'; this.msv.entryFrom.iDColumnName = 'id';

View File

@ -44,7 +44,7 @@ export class AuthGuard implements CanActivate, CanActivateChild {
return this.canActivate(route, state); return this.canActivate(route, state);
} }
private checkMenuPermission(url: string): Observable<boolean | UrlTree> | boolean | UrlTree { private checkMenuPermission(url: string): Observable<boolean | UrlTree> | boolean | UrlTree {
; debugger;
const target = AuthGuard.normalize(url); const target = AuthGuard.normalize(url);
if (AuthGuard.ALWAYS_ALLOWED.indexOf(target) >= 0) { if (AuthGuard.ALWAYS_ALLOWED.indexOf(target) >= 0) {
return true; return true;
@ -66,7 +66,7 @@ export class AuthGuard implements CanActivate, CanActivateChild {
return this.getAllMenuLinks().pipe( return this.getAllMenuLinks().pipe(
map(allLinks => { map(allLinks => {
; debugger;
if (allLinks !== null && allLinks.some(l => AuthGuard.covers(l, target))) { if (allLinks !== null && allLinks.some(l => AuthGuard.covers(l, target))) {
return this.deny(); return this.deny();
} }

View File

@ -1 +1 @@
{"version":3,"file":"allow-deduct.js","sourceRoot":"","sources":["allow-deduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAC9C;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CAKJ"} {"version":3,"file":"allow-deduct.js","sourceRoot":"","sources":["allow-deduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAC9C;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CAIJ"}

View File

@ -1,5 +1,4 @@
import {BaseObject} from '../Basic/baseObject'; import {BaseObject} from '../Basic/baseObject';
import { EnumAllowanceType } from '../enums';
export class AllowanceDeduction extends BaseObject { export class AllowanceDeduction extends BaseObject {
constructor() { constructor() {
@ -8,5 +7,4 @@ export class AllowanceDeduction extends BaseObject {
code: string; code: string;
name: string; name: string;
payrollTypeID: string; payrollTypeID: string;
allowanceType: EnumAllowanceType
} }

View File

@ -1 +1 @@
{"version":3,"file":"UserAccessType.js","sourceRoot":"","sources":["UserAccessType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,UAAU;IAG1C;QAEI,KAAK,EAAE,CAAC;QAKL,gBAAW,GAAW,EAAE,CAAC;QAJ5B,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC;IACpD,CAAC;CAUJ"} {"version":3,"file":"UserAccessType.js","sourceRoot":"","sources":["UserAccessType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,UAAU;IAG1C;QAEI,KAAK,EAAE,CAAC;QAKL,gBAAW,GAAW,EAAE,CAAC;QAJ5B,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC;IACpD,CAAC;CAOJ"}

View File

@ -21,31 +21,4 @@ export class UserRole extends BaseObject {
}); });
} }
} }
// ---------- Maker-checker (Authentication > User Role Permission) ----------
/** What a role request asks for (EnumUserRoleRequestType on the server). */
export var EnumUserRoleRequestType;
(function (EnumUserRoleRequestType) {
EnumUserRoleRequestType[EnumUserRoleRequestType["Add"] = 1] = "Add";
EnumUserRoleRequestType[EnumUserRoleRequestType["Remove"] = 2] = "Remove";
})(EnumUserRoleRequestType || (EnumUserRoleRequestType = {}));
/** Whose roles: an Admin user (userID) or a Self Service employee (employeeID + payrollTypeID). */
export class UserRoleSubject {
}
/** Maker's request: the roles (of the subject's role type) the person should have. */
export class UserRoleChangeRequest extends UserRoleSubject {
constructor() {
super(...arguments);
this.roleIDs = [];
}
}
/** One UserRole row waiting for approval (Status 2 = give, 3 = take away); id is the UserRoleID. */
export class UserRoleRequest {
}
/** A person's roles of one role type, as the page shows them. */
export class UserRoleState {
constructor() {
this.liveRoleIDs = [];
this.pending = [];
}
}
//# sourceMappingURL=UserRole.js.map //# sourceMappingURL=UserRole.js.map

View File

@ -1 +1 @@
{"version":3,"file":"UserRole.js","sourceRoot":"","sources":["UserRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAK/C,MAAM,OAAO,QAAS,SAAQ,UAAU;IACpC;QACI,KAAK,EAAE,CAAC;QAsBZ,UAAK,GAAa,IAAI,CAAC;QACvB,gBAAW,GAAY,EAAE,CAAC;QAtBtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAuBD,YAAY,CAAC,KAAa,EAAE,QAAoB;QAC5C,IAAI,OAAmB,CAAC;QACxB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACd,GAAG,GAAG,EAAE,CAAC;YACT,IAAI,SAAS,GAAe,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;YACnE,IAAI,SAAU,GAAG,SAAS,EAAE,CAAC;gBACzB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAClB,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC;gBAE/B,CAAC,CAAC,CAAC;YACP,CAAC;YACD,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAID,8EAA8E;AAE9E,4EAA4E;AAC5E,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,mEAAO,CAAA;IACP,yEAAU,CAAA;AACd,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED,mGAAmG;AACnG,MAAM,OAAO,eAAe;CAK3B;AAED,sFAAsF;AACtF,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAA1D;;QACI,YAAO,GAAa,EAAE,CAAC;IAC3B,CAAC;CAAA;AAED,oGAAoG;AACpG,MAAM,OAAO,eAAe;CAgB3B;AAED,iEAAiE;AACjE,MAAM,OAAO,aAAa;IAA1B;QAWI,gBAAW,GAAa,EAAE,CAAC;QAC3B,YAAO,GAAsB,EAAE,CAAC;IACpC,CAAC;CAAA"} {"version":3,"file":"UserRole.js","sourceRoot":"","sources":["UserRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAK/C,MAAM,OAAO,QAAS,SAAQ,UAAU;IACpC;QACI,KAAK,EAAE,CAAC;QAsBZ,UAAK,GAAa,IAAI,CAAC;QACvB,gBAAW,GAAY,EAAE,CAAC;QAtBtB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IAuBD,YAAY,CAAC,KAAa,EAAE,QAAoB;QAC5C,IAAI,OAAmB,CAAC;QACxB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACd,GAAG,GAAG,EAAE,CAAC;YACT,IAAI,SAAS,GAAe,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;YACnE,IAAI,SAAU,GAAG,SAAS,EAAE,CAAC;gBACzB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAClB,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC;gBAE/B,CAAC,CAAC,CAAC;YACP,CAAC;YACD,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}

View File

@ -1,39 +0,0 @@
import { BaseObject } from '../Basic/baseObject';
/** One successful login (dbo.UserLoginInfo), as returned by api/Authentication/getUserAuditTrail. */
export class UserLogInInfo extends BaseObject {
constructor() {
super();
this.userID = 0;
this.loginTime = undefined;
this.logoutTime = undefined;
this.logoutType = undefined;
this.pcNumber = '';
this.ipAddress = '';
this.deviceId = '';
this.loginID = '';
this.userName = '';
}
}
/** One failed login (dbo.BadLoginAttemptInfo), as returned by api/Authentication/getBadLoginAuditTrail. */
export class BadLoginAttemptInfo extends BaseObject {
constructor() {
super();
this.userID = 0;
this.attemptTime = undefined;
this.pcNumber = '';
this.ipAddress = '';
this.deviceId = '';
this.loginID = '';
this.userName = '';
}
}
/** Which change history the System Audit Log page asks for (HRM.BO EnumSystemAuditHistory). */
export var EnumSystemAuditHistory;
(function (EnumSystemAuditHistory) {
EnumSystemAuditHistory[EnumSystemAuditHistory["Role"] = 1] = "Role";
EnumSystemAuditHistory[EnumSystemAuditHistory["RolePermission"] = 2] = "RolePermission";
EnumSystemAuditHistory[EnumSystemAuditHistory["User"] = 3] = "User";
EnumSystemAuditHistory[EnumSystemAuditHistory["UserRole"] = 4] = "UserRole";
EnumSystemAuditHistory[EnumSystemAuditHistory["UserAccessType"] = 5] = "UserAccessType";
})(EnumSystemAuditHistory || (EnumSystemAuditHistory = {}));
//# sourceMappingURL=auditTrail.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"auditTrail.js","sourceRoot":"","sources":["auditTrail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,qGAAqG;AACrG,MAAM,OAAO,aAAc,SAAQ,UAAU;IAWzC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;CACJ;AAED,2GAA2G;AAC3G,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAS/C;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;CACJ;AAED,+FAA+F;AAC/F,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAC9B,mEAAQ,CAAA;IACR,uFAAkB,CAAA;IAClB,mEAAQ,CAAA;IACR,2EAAY,CAAA;IACZ,uFAAkB,CAAA;AACtB,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC"}

View File

@ -1 +1 @@
{"version":3,"file":"user.js","sourceRoot":"","sources":["user.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,OAAO,IAAK,SAAQ,UAAU;IAEhC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAC1C,CAAC;CAqBJ"} {"version":3,"file":"user.js","sourceRoot":"","sources":["user.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,OAAO,IAAK,SAAQ,UAAU;IAEhC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAC1C,CAAC;CAoBJ"}

View File

@ -1,6 +1,5 @@
import { EnumAuthStatus, EnumUserType } from '../enums'; import { EnumAuthStatus, EnumUserType } from '../enums';
import { BaseObject } from '../Basic/baseObject'; import { BaseObject } from '../Basic/baseObject';
import { Employee } from '../Employee/employee';
export class User extends BaseObject { export class User extends BaseObject {
@ -22,7 +21,6 @@ export class User extends BaseObject {
isNew: boolean; isNew: boolean;
roleNames: string; roleNames: string;
public employeeID?: number; public employeeID?: number;
public employee?: Employee; // not a database field (linked employee)
public changePasswordAtNextLogon: boolean; public changePasswordAtNextLogon: boolean;
public userID: number; public userID: number;
public PayrollTypeID?: number; public PayrollTypeID?: number;

View File

@ -1 +1 @@
{"version":3,"file":"empLifeCycle.js","sourceRoot":"","sources":["empLifeCycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AAGlF,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,YAAa,SAAQ,UAAU;IAwCxC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,mBAAmB,CAAC;IAC7D,CAAC;CACJ"} {"version":3,"file":"empLifeCycle.js","sourceRoot":"","sources":["empLifeCycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AAGlF,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG/C,MAAM,OAAO,YAAa,SAAQ,UAAU;IAuCxC;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,mBAAmB,CAAC;IAC7D,CAAC;CACJ"}

View File

@ -20,7 +20,6 @@ export class EmpLifeCycle extends BaseObject {
departmentID: number; departmentID: number;
isConfirm?: boolean; isConfirm?: boolean;
pfMemberType?: EnumPFMembershipType; pfMemberType?: EnumPFMembershipType;
pfPercentage?: number;
employeeID: number; employeeID: number;
statusDetailID: number; statusDetailID: number;
grossSalary: number; grossSalary: number;

View File

@ -28,7 +28,6 @@ export class Employee {
this.statusName = ''; this.statusName = '';
this.isShownInTaxSheet = false; this.isShownInTaxSheet = false;
this.pfMemberType = EnumPFMembershipType.NotYetLive; this.pfMemberType = EnumPFMembershipType.NotYetLive;
this.pfPercentage = 0;
this.branchID = null; this.branchID = null;
this.accountNo = ''; this.accountNo = '';
this.outPayBranchID = null; this.outPayBranchID = null;

View File

@ -1 +1 @@
{"version":3,"file":"employee.js","sourceRoot":"","sources":["employee.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,uDAAuD;AACvD,MAAM,OAAO,QAAQ;IAqGjB,uDAAuD;IAEvD;QA5BA,gBAAW,GAAW,EAAE,CAAC;QA8BrB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,UAAU,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,YAAY,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IAC7B,CAAC;IAEM,iBAAiB;QACpB,IAAI,GAAG,GAAmB,IAAI,cAAc,EAAE,CAAC;QAC/C,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;QACzB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACvC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9B,OAAO,GAAG,CAAC;IACf,CAAC;IAED,eAAe,CAAC,SAA6B;QAEzC,IAAI,GAAG,GAAW,MAAM,CAAC;QACzB,QAAQ,SAAS,EAAE,CAAC;YAChB,KAAK,kBAAkB,CAAC,IAAI;gBACxB,GAAG,GAAG,MAAM,CAAC;gBACb,MAAM;YACV,KAAK,kBAAkB,CAAC,OAAO,CAAC;YAChC,mCAAmC;YACnC,KAAK,kBAAkB,CAAC,EAAE,CAAC;YAC3B,KAAK,kBAAkB,CAAC,YAAY;gBAChC,GAAG,GAAG,cAAc,CAAC;gBACrB,MAAM;YACV,QAAQ;QACZ,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CACJ"} {"version":3,"file":"employee.js","sourceRoot":"","sources":["employee.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,uDAAuD;AACvD,MAAM,OAAO,QAAQ;IAoGjB,uDAAuD;IAEvD;QA5BA,gBAAW,GAAW,EAAE,CAAC;QA8BrB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC,UAAU,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,YAAY,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IAC7B,CAAC;IAEM,iBAAiB;QACpB,IAAI,GAAG,GAAmB,IAAI,cAAc,EAAE,CAAC;QAC/C,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC;QACzB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACvC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9B,OAAO,GAAG,CAAC;IACf,CAAC;IAED,eAAe,CAAC,SAA6B;QAEzC,IAAI,GAAG,GAAW,MAAM,CAAC;QACzB,QAAQ,SAAS,EAAE,CAAC;YAChB,KAAK,kBAAkB,CAAC,IAAI;gBACxB,GAAG,GAAG,MAAM,CAAC;gBACb,MAAM;YACV,KAAK,kBAAkB,CAAC,OAAO,CAAC;YAChC,mCAAmC;YACnC,KAAK,kBAAkB,CAAC,EAAE,CAAC;YAC3B,KAAK,kBAAkB,CAAC,YAAY;gBAChC,GAAG,GAAG,cAAc,CAAC;gBACrB,MAAM;YACV,QAAQ;QACZ,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CACJ"}

View File

@ -47,7 +47,6 @@ export class Employee {
isShownInTaxSheet: boolean; isShownInTaxSheet: boolean;
pfMemberType: EnumPFMembershipType; pfMemberType: EnumPFMembershipType;
pfMemberShiptDate: Date; pfMemberShiptDate: Date;
pfPercentage: number;
branchID: number; branchID: number;
accountNo: string; accountNo: string;
outPayBranchID: number; outPayBranchID: number;
@ -143,7 +142,6 @@ export class Employee {
this.statusName = ''; this.statusName = '';
this.isShownInTaxSheet = false; this.isShownInTaxSheet = false;
this.pfMemberType = EnumPFMembershipType.NotYetLive; this.pfMemberType = EnumPFMembershipType.NotYetLive;
this.pfPercentage = 0;
this.branchID = null; this.branchID = null;
this.accountNo = ''; this.accountNo = '';
this.outPayBranchID = null; this.outPayBranchID = null;

Some files were not shown because too many files have changed in this diff Show More