เคลียรค่าสำรองเงินเดือน
This commit is contained in:
parent
866dd91d81
commit
d94ca5480e
2 changed files with 31 additions and 11 deletions
|
|
@ -660,6 +660,11 @@ export class SalaryPeriodController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (body.type == "FULL") {
|
||||||
|
salaryProfile.isReserve = body.isReserve;
|
||||||
|
} else {
|
||||||
|
salaryProfile.isReserve = false;
|
||||||
|
}
|
||||||
|
|
||||||
//Type & Level
|
//Type & Level
|
||||||
const Type = await this.posTypeRepository.findOne({
|
const Type = await this.posTypeRepository.findOne({
|
||||||
|
|
@ -692,7 +697,6 @@ export class SalaryPeriodController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบระดับตำแหน่ง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบระดับตำแหน่ง");
|
||||||
}
|
}
|
||||||
salaryProfile.type = body.type;
|
salaryProfile.type = body.type;
|
||||||
salaryProfile.isReserve = body.isReserve;
|
|
||||||
let type = salaryProfile.type;
|
let type = salaryProfile.type;
|
||||||
//SalaryRank
|
//SalaryRank
|
||||||
let salaryRanks: any = null;
|
let salaryRanks: any = null;
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
if (salaryFormula != null) {
|
if (salaryFormula != null) {
|
||||||
//หาเงินตำ่สุดที่คำนวนเงิน
|
//หาเงินตำ่สุดที่คำนวนเงิน
|
||||||
let salary = 0;
|
let salary = 0;
|
||||||
|
let _step = 0;
|
||||||
if (
|
if (
|
||||||
salaryProfile.amount != null &&
|
salaryProfile.amount != null &&
|
||||||
salaryProfile.amount > 0 &&
|
salaryProfile.amount > 0 &&
|
||||||
|
|
@ -383,12 +384,15 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
} else {
|
} else {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0)
|
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0) {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//หาขั้นต่ำสุดตามเกณฑ์
|
//หาขั้นต่ำสุดตามเกณฑ์
|
||||||
let salaryRankMin = await this.salaryRankRepository.findOne({
|
let salaryRankMin = await this.salaryRankRepository.findOne({
|
||||||
|
|
@ -438,14 +442,14 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
||||||
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
group = salaryFormula.salaryEmployee.group;
|
group = salaryFormula.salaryEmployee.group;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step - 0.5;
|
step = salaryRankMin.step - 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = 0.5;
|
step = 0.5;
|
||||||
|
|
@ -718,6 +722,11 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (body.type == "FULL") {
|
||||||
|
salaryProfile.isReserve = body.isReserve;
|
||||||
|
} else {
|
||||||
|
salaryProfile.isReserve = false;
|
||||||
|
}
|
||||||
|
|
||||||
//Type & Level
|
//Type & Level
|
||||||
const Type = await this.posTypeRepository.findOne({
|
const Type = await this.posTypeRepository.findOne({
|
||||||
|
|
@ -737,7 +746,6 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบระดับตำแหน่ง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบระดับตำแหน่ง");
|
||||||
}
|
}
|
||||||
salaryProfile.isReserve = body.isReserve;
|
|
||||||
salaryProfile.type = body.type;
|
salaryProfile.type = body.type;
|
||||||
let type = salaryProfile.type;
|
let type = salaryProfile.type;
|
||||||
|
|
||||||
|
|
@ -783,6 +791,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
if (salaryFormula != null) {
|
if (salaryFormula != null) {
|
||||||
//หาเงินตำ่สุดที่คำนวนเงิน
|
//หาเงินตำ่สุดที่คำนวนเงิน
|
||||||
let salary = 0;
|
let salary = 0;
|
||||||
|
let _step = 0;
|
||||||
if (
|
if (
|
||||||
salaryProfile.amount != null &&
|
salaryProfile.amount != null &&
|
||||||
salaryProfile.amount > 0 &&
|
salaryProfile.amount > 0 &&
|
||||||
|
|
@ -793,12 +802,15 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
} else {
|
} else {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0)
|
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0) {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//หาขั้นต่ำสุดตามเกณฑ์
|
//หาขั้นต่ำสุดตามเกณฑ์
|
||||||
let salaryRankMin = await this.salaryRankRepository.findOne({
|
let salaryRankMin = await this.salaryRankRepository.findOne({
|
||||||
|
|
@ -848,14 +860,14 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
||||||
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
group = salaryFormula.salaryEmployee.group;
|
group = salaryFormula.salaryEmployee.group;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step - 0.5;
|
step = salaryRankMin.step - 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = 0.5;
|
step = 0.5;
|
||||||
|
|
@ -1302,6 +1314,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
if (salaryFormula != null) {
|
if (salaryFormula != null) {
|
||||||
//หาเงินตำ่สุดที่คำนวนเงิน
|
//หาเงินตำ่สุดที่คำนวนเงิน
|
||||||
let salary = 0;
|
let salary = 0;
|
||||||
|
let _step = 0;
|
||||||
if (
|
if (
|
||||||
salaryProfile.amount != null &&
|
salaryProfile.amount != null &&
|
||||||
salaryProfile.amount > 0 &&
|
salaryProfile.amount > 0 &&
|
||||||
|
|
@ -1312,12 +1325,15 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
} else {
|
} else {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
if (salaryProfile.amount != null && salaryProfile.amount > 0)
|
||||||
salary = salaryProfile.amount;
|
salary = salaryProfile.amount;
|
||||||
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0)
|
if (salaryFormula.salaryMin != null && salaryFormula.salaryMin > 0) {
|
||||||
salary = salaryFormula.salaryMin;
|
salary = salaryFormula.salaryMin;
|
||||||
|
_step = 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//หาขั้นต่ำสุดตามเกณฑ์
|
//หาขั้นต่ำสุดตามเกณฑ์
|
||||||
let salaryRankMin = await this.salaryRankRepository.findOne({
|
let salaryRankMin = await this.salaryRankRepository.findOne({
|
||||||
|
|
@ -1367,14 +1383,14 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
step = salaryRankMin == null ? 0.5 : salaryRankMin.step - 0.5;
|
||||||
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
group = salaryRankMin == null ? group : salaryFormula.salaryEmployee.group;
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
group = salaryFormula.salaryEmployee.group;
|
group = salaryFormula.salaryEmployee.group;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step - 0.5;
|
step = salaryRankMin.step - 0.5;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = salaryRankMin.step;
|
step = salaryRankMin.step - _step;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
step = 0.5;
|
step = 0.5;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue