คำนวนเงินเดือน กรณีไม่พอดีฐาน
This commit is contained in:
parent
08af376c6a
commit
168e59fdf4
1 changed files with 10 additions and 37 deletions
|
|
@ -13,7 +13,7 @@ import {
|
|||
Query,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import { In, Not, MoreThan, Brackets, Like } from "typeorm";
|
||||
import { In, Not, MoreThan, Brackets, Like, MoreThanOrEqual } from "typeorm";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
|
|
@ -385,20 +385,11 @@ export class SalaryPeriodController extends Controller {
|
|||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: salaryProfile.amount,
|
||||
salary: MoreThanOrEqual(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
if (salaryRanks == null) {
|
||||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
});
|
||||
}
|
||||
if (salaryRanks != null) {
|
||||
if (salaryProfile.type == "HAFT") {
|
||||
if (salaryRanks.salaryHalfSpecial != null && salaryRanks.salaryHalfSpecial > 0) {
|
||||
|
|
@ -457,7 +448,7 @@ export class SalaryPeriodController extends Controller {
|
|||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: true,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -707,20 +698,11 @@ export class SalaryPeriodController extends Controller {
|
|||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: salaryProfile.amount,
|
||||
salary: MoreThanOrEqual(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
if (salaryRanks == null) {
|
||||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
});
|
||||
}
|
||||
if (salaryRanks != null) {
|
||||
if (salaryProfile.type == "HAFT") {
|
||||
if (salaryRanks.salaryHalfSpecial != null && salaryRanks.salaryHalfSpecial > 0) {
|
||||
|
|
@ -779,7 +761,7 @@ export class SalaryPeriodController extends Controller {
|
|||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: true,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1085,20 +1067,11 @@ export class SalaryPeriodController extends Controller {
|
|||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: salaryProfile.amount,
|
||||
salary: MoreThanOrEqual(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
if (salaryRanks == null) {
|
||||
salaryRanks = await this.salaryRankRepository.findOne({
|
||||
where: {
|
||||
salaryId: salarys.id,
|
||||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: false,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
});
|
||||
}
|
||||
if (salaryRanks != null) {
|
||||
if (salaryProfile.type == "HAFT") {
|
||||
if (salaryRanks.salaryHalfSpecial != null && salaryRanks.salaryHalfSpecial > 0) {
|
||||
|
|
@ -1157,7 +1130,7 @@ export class SalaryPeriodController extends Controller {
|
|||
salary: MoreThan(salaryProfile.amount),
|
||||
isNext: true,
|
||||
},
|
||||
order: { salary: "DESC" },
|
||||
order: { salary: "ASC" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue