This commit is contained in:
AdisakKanthawilang 2025-06-04 13:52:02 +07:00
parent 26a224eeda
commit 0af89e7ecf
2 changed files with 391 additions and 9 deletions

View file

@ -2953,8 +2953,8 @@ export class ReportController extends Controller {
* @summary 04- ..1-
*
*/
@Get("emp-04/{rootId}/{salaryPeriodId}")
async SalaryReportEmp1_4(@Path() rootId: string, @Path() salaryPeriodId: string) {
@Get("emp-04/{rootId}/{salaryPeriodId}/{type}")
async SalaryReportEmp1_4(@Path() rootId: string, @Path() salaryPeriodId: string, @Path() type: string = 'ALL') {
const salaryPeriod = await this.salaryPeriodRepository.findOne({
where: {
id: salaryPeriodId,
@ -2970,11 +2970,21 @@ export class ReportController extends Controller {
salaryPeriodId: salaryPeriodId,
},
};
condition.type = In(["HAFT", "FULL", "FULLHAFT"]);
if(salaryPeriod.period == "APR"){
condition.type = In(["HAFT", "FULL"]);
if(type == "HAFT"){
condition.type = "HAFT";
}else if(type == "FULL"){
condition.type = "FULL";
}
}else{
condition.type = In(["HAFT", "FULL", "FULLHAFT"]);
if(type == "HAFT"){
condition.type = "HAFT";
}else if(type == "FULL"){
condition.type = "FULL";
}else if(type == "FULLHAFT"){
condition.type = "FULLHAFT";
}
}
const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({