Compare commits
No commits in common. "62d6ccb45c52adfa5aec88c141f3bcd6d859f0ba" and "8ebc08eb607af507e067d4b19d542ba170819ef2" have entirely different histories.
62d6ccb45c
...
8ebc08eb60
|
@ -383,7 +383,7 @@ namespace HRM.BO
|
||||||
List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees);
|
List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees);
|
||||||
int Save(SalaryProcess item);
|
int Save(SalaryProcess item);
|
||||||
void Delete(int id);
|
void Delete(int id);
|
||||||
bool IsSalaryprocessed(DateTime salarymonth, int payrollTypeID);
|
|
||||||
void UndoSalary(int id);
|
void UndoSalary(int id);
|
||||||
void UndoMonthlySalaryByIDs(string ids);
|
void UndoMonthlySalaryByIDs(string ids);
|
||||||
void UndoMonthlySalaryByEmpIDs(string ids, DateTime salaryMonth);
|
void UndoMonthlySalaryByEmpIDs(string ids, DateTime salaryMonth);
|
||||||
|
|
|
@ -642,16 +642,10 @@ namespace HRM.DA
|
||||||
|
|
||||||
internal static IDataReader Get(TransactionContext tc, string empID, DateTime fromDate, DateTime toDate)
|
internal static IDataReader Get(TransactionContext tc, string empID, DateTime fromDate, DateTime toDate)
|
||||||
{
|
{
|
||||||
//string sql =
|
|
||||||
// SQLParser.MakeSQL(
|
|
||||||
// "SELECT dap.* FROM DailyAttnProcess dap Inner Join Employee e on e.EmployeeID=dap.EmployeeID " +
|
|
||||||
// "WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC",
|
|
||||||
// empID, fromDate, toDate);
|
|
||||||
string sql =
|
string sql =
|
||||||
SQLParser.MakeSQL(
|
SQLParser.MakeSQL(
|
||||||
"SELECT dap.* FROM DailyAttnProcess dap " +
|
"SELECT dap.* FROM DailyAttnProcess dap Inner Join Employee e on e.EmployeeID=dap.EmployeeID WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC",
|
||||||
"WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC",
|
empID, fromDate, toDate);
|
||||||
empID, fromDate, toDate);
|
|
||||||
IDataReader dr = tc.ExecuteReader(sql);
|
IDataReader dr = tc.ExecuteReader(sql);
|
||||||
return dr;
|
return dr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,16 +114,7 @@ namespace HRM.DA
|
||||||
return bShowInDesktop;
|
return bShowInDesktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IsSalaryprocessed(TransactionContext tc, DateTime dSMonth, int payrollTypeID)
|
|
||||||
{
|
|
||||||
bool bShowInDesktop = false;
|
|
||||||
object obj =
|
|
||||||
tc.ExecuteScalar("Select SALARYPROCESSID from SALARYPROCESS where SALARYMONTH=%d AND PAYROLLTYPEID=%n",
|
|
||||||
dSMonth, payrollTypeID);
|
|
||||||
if (obj == DBNull.Value) return false;
|
|
||||||
else bShowInDesktop=true;
|
|
||||||
return bShowInDesktop;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Delete function
|
#region Delete function
|
||||||
|
|
|
@ -978,31 +978,6 @@ namespace HRM.DA
|
||||||
return bShowInDesktop;
|
return bShowInDesktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSalaryprocessed(DateTime dSalaryMonth, int payrollTypeID)
|
|
||||||
{
|
|
||||||
TransactionContext tc = null;
|
|
||||||
bool isSalaryprocessed;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
tc = TransactionContext.Begin();
|
|
||||||
isSalaryprocessed = SalaryProcessDA.IsSalaryprocessed(tc, dSalaryMonth, payrollTypeID);
|
|
||||||
tc.End();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
#region Handle Exception
|
|
||||||
|
|
||||||
if (tc != null)
|
|
||||||
tc.HandleError();
|
|
||||||
ExceptionLog.Write(e);
|
|
||||||
throw new ServiceException(e.Message, e);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
return isSalaryprocessed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SalaryProcess> GetAllProcess(int payrollTypeID, DateTime nextPayProcessDate)
|
public List<SalaryProcess> GetAllProcess(int payrollTypeID, DateTime nextPayProcessDate)
|
||||||
{
|
{
|
||||||
List<SalaryProcess> salaryProcesss = new List<SalaryProcess>();
|
List<SalaryProcess> salaryProcesss = new List<SalaryProcess>();
|
||||||
|
|
|
@ -339,7 +339,6 @@ namespace HRM.Report
|
||||||
DateTime? bonusIntime = DateTime.MinValue;
|
DateTime? bonusIntime = DateTime.MinValue;
|
||||||
DateTime? bonusOuttime = DateTime.MinValue;
|
DateTime? bonusOuttime = DateTime.MinValue;
|
||||||
List<ProdBonusAttn> prodAttn = new ProdBonusAttnService().GetBySetupID(designId);
|
List<ProdBonusAttn> prodAttn = new ProdBonusAttnService().GetBySetupID(designId);
|
||||||
if (prodAttn.Count <= 0) return null;
|
|
||||||
string empIds = string.Empty;
|
string empIds = string.Empty;
|
||||||
empIds = prodAttn.Select(x => x.EmployeeID).Distinct().Aggregate(new StringBuilder(), (sb, empid) => sb.Append(empid + ","), sb => sb.ToString().Trim(','));
|
empIds = prodAttn.Select(x => x.EmployeeID).Distinct().Aggregate(new StringBuilder(), (sb, empid) => sb.Append(empid + ","), sb => sb.ToString().Trim(','));
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,5 @@ export class SalaryService {
|
||||||
DownloadPayslipForMultiple(param: any): Observable<HttpEvent<any>> {
|
DownloadPayslipForMultiple(param: any): Observable<HttpEvent<any>> {
|
||||||
return this.apiService.httpPost<any>('/salary/DownloadPayslipForMultiple', param);
|
return this.apiService.httpPost<any>('/salary/DownloadPayslipForMultiple', param);
|
||||||
}
|
}
|
||||||
IsSalaryProcessed(salaryMonth: Date) {
|
|
||||||
return this.apiService.httpGet<boolean>('/salary' + '/IsSalaryprocessedMonthly' + '/' + salaryMonth.toDateString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-10"></div>
|
<div class="p-col-10"></div>
|
||||||
<div class="p-col-2" align="right">
|
<div class="p-col-2" align="right">
|
||||||
<button icon="save" kendoButton style="width:80%" (click)="onClickSubmit()" [disabled]="isprevious">Submit</button>
|
<button icon="save" kendoButton style="width:80%" (click)="onClickSubmit()">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -20,9 +20,6 @@ import { EnumBonusItemType, EnumProductionBonusType } from 'src/app/_models/enum
|
||||||
import { ProdBonusParameter } from 'src/app/_models/Payroll/ProductionBonus/prodBonusParameter';
|
import { ProdBonusParameter } from 'src/app/_models/Payroll/ProductionBonus/prodBonusParameter';
|
||||||
import { error } from 'console';
|
import { error } from 'console';
|
||||||
import { GridComponent } from '@progress/kendo-angular-grid';
|
import { GridComponent } from '@progress/kendo-angular-grid';
|
||||||
import { AuthService } from '../../_services/auth/auth.service';
|
|
||||||
import { SalaryService } from '../../_services/payroll/salary.service';
|
|
||||||
import { PayrollType } from '../../_models/Authentication/payrollType';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -66,11 +63,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
||||||
employeeSelection: string = 'commonEmployee';
|
employeeSelection: string = 'commonEmployee';
|
||||||
|
|
||||||
employeeList: Employee[] = [];
|
employeeList: Employee[] = [];
|
||||||
allEmps: any[] = [];
|
allEmps: any[] = [];
|
||||||
isprevious: boolean = false;
|
|
||||||
iSalaryProcesed: boolean = false;
|
|
||||||
salaryMonth: Date = new Date();
|
|
||||||
payrollType: PayrollType;
|
|
||||||
|
|
||||||
value: '';
|
value: '';
|
||||||
|
|
||||||
|
@ -79,9 +72,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
||||||
public dataTransferService: DataTransferService,
|
public dataTransferService: DataTransferService,
|
||||||
public WindowPopUp: AppWindowPopUp,
|
public WindowPopUp: AppWindowPopUp,
|
||||||
public loadingPanelService: loadingPanelService,
|
public loadingPanelService: loadingPanelService,
|
||||||
public employeeService: EmployeeServices,
|
public employeeService: EmployeeServices,
|
||||||
public authservice: AuthService,
|
|
||||||
public salaryService: SalaryService,
|
|
||||||
public bonusService: BonusService) {
|
public bonusService: BonusService) {
|
||||||
this.apiService.selectedMenuName = 'Production Bonus Attendance';
|
this.apiService.selectedMenuName = 'Production Bonus Attendance';
|
||||||
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
|
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
|
||||||
|
@ -89,17 +80,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
// this.Loadlayout();
|
// this.Loadlayout();
|
||||||
this.authservice.GetPayrollTypeByLoginID().subscribe(
|
|
||||||
(resp: any) => {
|
|
||||||
this.payrollType = resp;
|
|
||||||
},
|
|
||||||
(err: any) => {
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
this.salaryMonth = new Date(this.payrollType.nextPayProcessDate);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.GetAllEmployees();
|
this.GetAllEmployees();
|
||||||
this.productionBonusSetup = new ProductionBonusSetup();
|
this.productionBonusSetup = new ProductionBonusSetup();
|
||||||
this.showScheduleDate = false;
|
this.showScheduleDate = false;
|
||||||
|
@ -136,31 +117,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
||||||
}
|
}
|
||||||
Loadlayout() {
|
Loadlayout() {
|
||||||
this.clear();
|
this.clear();
|
||||||
debugger;
|
debugger;
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
|
||||||
this.salaryService.IsSalaryProcessed(new Date(this.payrollType.nextPayProcessDate)).subscribe(
|
|
||||||
(resp: any) => {
|
|
||||||
this.iSalaryProcesed = resp;
|
|
||||||
},
|
|
||||||
(err: any) => {
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
this.notificationService.showError(err.error);
|
|
||||||
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
|
|
||||||
if (new Date(this.selectedSalaryDate) <= new Date(this.payrollType.lastPayProcessDate) ||
|
|
||||||
(new Date(this.selectedSalaryDate) > new Date(this.payrollType.lastPayProcessDate) &&
|
|
||||||
new Date(this.payrollType.nextPayProcessDate) >= new Date(this.selectedSalaryDate) && this.iSalaryProcesed)) {
|
|
||||||
this.isprevious = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.isprevious = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
const data = {
|
const data = {
|
||||||
createdDate: this.selectedSalaryDate
|
createdDate: this.selectedSalaryDate
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="p-col-12 p-lg-12" align="right">
|
<div class="p-col-12 p-lg-12" align="right">
|
||||||
<button kendoButton icon="save" [primary]="true" style="width: fit-content" (click)="onClickSubmit()" [disabled]="isprevious">Submit</button>
|
<button kendoButton icon="save" [primary]="true" style="width: fit-content" (click)="onClickSubmit()">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -29,9 +29,6 @@ import { process, State } from '@progress/kendo-data-query';
|
||||||
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
|
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
|
||||||
import { noUndefined } from '@angular/compiler/src/util';
|
import { noUndefined } from '@angular/compiler/src/util';
|
||||||
import { EnumStatus } from '../../_models/enums';
|
import { EnumStatus } from '../../_models/enums';
|
||||||
import { AuthService } from '../../_services/auth/auth.service';
|
|
||||||
import { PayrollType } from '../../_models/Authentication/payrollType';
|
|
||||||
import { SalaryService } from '../../_services/payroll/salary.service';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,9 +46,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
public WindowPopUp: AppWindowPopUp,
|
public WindowPopUp: AppWindowPopUp,
|
||||||
public loadingPanelService: loadingPanelService,
|
public loadingPanelService: loadingPanelService,
|
||||||
public employeeService: EmployeeServices,
|
public employeeService: EmployeeServices,
|
||||||
public bonusService: BonusService,
|
public bonusService: BonusService,
|
||||||
public authservice: AuthService,
|
|
||||||
public salaryService: SalaryService,
|
|
||||||
public datePipe: DatePipe) {
|
public datePipe: DatePipe) {
|
||||||
this.apiService.selectedMenuName = 'Production Bonus Setup';
|
this.apiService.selectedMenuName = 'Production Bonus Setup';
|
||||||
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
|
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
|
||||||
|
@ -74,11 +69,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
prodBonusWork: ProdBonusWorkSchedule;
|
prodBonusWork: ProdBonusWorkSchedule;
|
||||||
//Child-level 2
|
//Child-level 2
|
||||||
prodBonusSupervisor: ProdBonusSupervisor;
|
prodBonusSupervisor: ProdBonusSupervisor;
|
||||||
prodBonusParameter: ProdBonusParameter;
|
prodBonusParameter: ProdBonusParameter;
|
||||||
isprevious: boolean = false;
|
|
||||||
iSalaryProcesed: boolean = false;
|
|
||||||
salaryMonth: Date = new Date();
|
|
||||||
payrollType: PayrollType;
|
|
||||||
|
|
||||||
prodBonusAttn: ProdBonusAttn[];
|
prodBonusAttn: ProdBonusAttn[];
|
||||||
depts: Department[] = [];
|
depts: Department[] = [];
|
||||||
|
@ -128,24 +119,13 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
// { text: "Large", value: 3 },
|
// { text: "Large", value: 3 },
|
||||||
// ];
|
// ];
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
||||||
this.productionBonusSetup = new ProductionBonusSetup();
|
this.productionBonusSetup = new ProductionBonusSetup();
|
||||||
this.prodBonusLine = new ProdBonusLine();
|
this.prodBonusLine = new ProdBonusLine();
|
||||||
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
||||||
this.prodBonusParameter = new ProdBonusParameter();
|
this.prodBonusParameter = new ProdBonusParameter();
|
||||||
this.prodBonusWork = new ProdBonusWorkSchedule();
|
this.prodBonusWork = new ProdBonusWorkSchedule();
|
||||||
this.authservice.GetPayrollTypeByLoginID().subscribe(
|
this.getBonusType();
|
||||||
(resp: any) => {
|
|
||||||
this.payrollType = resp;
|
|
||||||
},
|
|
||||||
(err: any) => {
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
this.salaryMonth = new Date(this.payrollType.nextPayProcessDate);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.getBonusType();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,34 +174,8 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
|
|
||||||
Loadlayout() {
|
Loadlayout() {
|
||||||
this.selectedProdBSdata = undefined;
|
this.selectedProdBSdata = undefined;
|
||||||
debugger;
|
debugger;
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
const data = {
|
||||||
this.salaryService.IsSalaryProcessed(new Date(this.payrollType.nextPayProcessDate)).subscribe(
|
|
||||||
(resp: any) => {
|
|
||||||
this.iSalaryProcesed = resp;
|
|
||||||
},
|
|
||||||
(err: any) => {
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
this.notificationService.showError(err.error);
|
|
||||||
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
|
|
||||||
if (new Date(this.selectedSalaryDate) <= new Date(this.payrollType.lastPayProcessDate) ||
|
|
||||||
(new Date(this.selectedSalaryDate) > new Date(this.payrollType.lastPayProcessDate) &&
|
|
||||||
new Date(this.payrollType.nextPayProcessDate) >= new Date(this.selectedSalaryDate) && this.iSalaryProcesed)) {
|
|
||||||
this.isprevious = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.isprevious = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
createdDate: this.selectedSalaryDate
|
createdDate: this.selectedSalaryDate
|
||||||
}
|
}
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
this.loadingPanelService.ShowLoadingPanel = true;
|
||||||
|
|
|
@ -519,7 +519,7 @@ namespace HRM.UI.Controllers.Payroll
|
||||||
}
|
}
|
||||||
prodLine.ProdBonusWorkSchedules = _prodBonusWorkScheduleService.GetByLineID(prodLine.ID);
|
prodLine.ProdBonusWorkSchedules = _prodBonusWorkScheduleService.GetByLineID(prodLine.ID);
|
||||||
}
|
}
|
||||||
// item.ProdBonusWorkSchedules = _prodBonusWorkScheduleService.GetWithSetupID(ID);
|
item.ProdBonusWorkSchedules = _prodBonusWorkScheduleService.GetWithSetupID(ID);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -956,27 +956,6 @@ namespace HRM.UI.Controllers.Payroll
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
[Route("IsSalaryprocessedMonthly/{salarymonth}")]
|
|
||||||
public ActionResult IsSalaryprocessedMonthly(string salarymonth)
|
|
||||||
{
|
|
||||||
bool isSalaryprocessed = false;
|
|
||||||
DateTime month=Convert.ToDateTime(salarymonth);
|
|
||||||
|
|
||||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
isSalaryprocessed= _salaryProcessService.IsSalaryprocessed(month, (int)currentUser.PayrollTypeID);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(isSalaryprocessed);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("salaryProcessApprove")]
|
[Route("salaryProcessApprove")]
|
||||||
public ActionResult SalaryProcessApprove(SalaryProcess process)
|
public ActionResult SalaryProcessApprove(SalaryProcess process)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user