ออกคำสั่งเงินเดือน
This commit is contained in:
parent
a8a227e062
commit
9e749fbbcd
4 changed files with 476 additions and 164 deletions
|
|
@ -254,7 +254,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP1",
|
group: "GROUP1",
|
||||||
},
|
},
|
||||||
type: "HAFT"
|
type: "HAFT",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -270,7 +270,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP1",
|
group: "GROUP1",
|
||||||
},
|
},
|
||||||
type: "FULL"
|
type: "FULL",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -286,7 +286,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP1",
|
group: "GROUP1",
|
||||||
},
|
},
|
||||||
type: "NONE"
|
type: "NONE",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -302,7 +302,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP2",
|
group: "GROUP2",
|
||||||
},
|
},
|
||||||
type: "HAFT"
|
type: "HAFT",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -318,7 +318,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP2",
|
group: "GROUP2",
|
||||||
},
|
},
|
||||||
type: "FULL"
|
type: "FULL",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -334,7 +334,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
group: "GROUP2",
|
group: "GROUP2",
|
||||||
},
|
},
|
||||||
type: "NONE"
|
type: "NONE",
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
citizenId: "ASC",
|
citizenId: "ASC",
|
||||||
|
|
@ -347,7 +347,7 @@ export class ReportController extends Controller {
|
||||||
_salaryPeriod3,
|
_salaryPeriod3,
|
||||||
_salaryPeriod4,
|
_salaryPeriod4,
|
||||||
_salaryPeriod5,
|
_salaryPeriod5,
|
||||||
_salaryPeriod6
|
_salaryPeriod6,
|
||||||
);
|
);
|
||||||
if (!_salaryPeriod) {
|
if (!_salaryPeriod) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
@ -560,7 +560,9 @@ export class ReportController extends Controller {
|
||||||
// Extension.ToThaiFullDate2(new Date(`${salaryPeriod.year}-03-01`)),
|
// Extension.ToThaiFullDate2(new Date(`${salaryPeriod.year}-03-01`)),
|
||||||
// ),
|
// ),
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
yearSlice: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)).slice(-2)),
|
yearSlice: Extension.ToThaiNumber(
|
||||||
|
String(Extension.ToThaiYear(salaryPeriod.year)).slice(-2),
|
||||||
|
),
|
||||||
// dateNow: Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date())),
|
// dateNow: Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date())),
|
||||||
agency: agency,
|
agency: agency,
|
||||||
data1: formattedData1,
|
data1: formattedData1,
|
||||||
|
|
@ -1030,7 +1032,9 @@ export class ReportController extends Controller {
|
||||||
// Extension.ToThaiFullDate2(new Date(`${salaryPeriod.year}-03-01`)),
|
// Extension.ToThaiFullDate2(new Date(`${salaryPeriod.year}-03-01`)),
|
||||||
// ),
|
// ),
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
yearSlice: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)).slice(-2)),
|
yearSlice: Extension.ToThaiNumber(
|
||||||
|
String(Extension.ToThaiYear(salaryPeriod.year)).slice(-2),
|
||||||
|
),
|
||||||
// dateNow: Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date())),
|
// dateNow: Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date())),
|
||||||
agency: agency,
|
agency: agency,
|
||||||
data1: formattedData1,
|
data1: formattedData1,
|
||||||
|
|
@ -1276,7 +1280,11 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||||
salaryIncrease2:
|
salaryIncrease2:
|
||||||
|
|
@ -1286,7 +1294,11 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||||
score: null, //ผลการประเมินฯ
|
score: null, //ผลการประเมินฯ
|
||||||
|
|
@ -1320,7 +1332,11 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||||
salaryIncrease2:
|
salaryIncrease2:
|
||||||
|
|
@ -1330,7 +1346,11 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||||
score: null, //ผลการประเมินฯ
|
score: null, //ผลการประเมินฯ
|
||||||
|
|
@ -1572,7 +1592,13 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||||
salaryIncrease2:
|
salaryIncrease2:
|
||||||
|
|
@ -1582,20 +1608,37 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||||
salaryIncreaseAPR:
|
salaryIncreaseAPR:
|
||||||
salaryProfile_APR_Group1.length > 0
|
salaryProfile_APR_Group1.length > 0
|
||||||
? (() => {
|
? (() => {
|
||||||
const filteredType = salaryProfile_APR_Group1
|
const filteredType = salaryProfile_APR_Group1
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
})()
|
? "ครึ่งขั้น"
|
||||||
: null, //การเลื่อนเงินเดือนรอบเมษา
|
: Type === "FULL"
|
||||||
Type: item.type === "FULL" ? "หนึ่งขั้น" : item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : null,
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
|
})()
|
||||||
|
: null, //การเลื่อนเงินเดือนรอบเมษา
|
||||||
|
Type:
|
||||||
|
item.type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: item.type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: null,
|
||||||
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
||||||
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
||||||
})),
|
})),
|
||||||
|
|
@ -1627,7 +1670,13 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||||
salaryIncrease2:
|
salaryIncrease2:
|
||||||
|
|
@ -1637,20 +1686,37 @@ export class ReportController extends Controller {
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
|
? "ครึ่งขั้น"
|
||||||
|
: Type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
})()
|
})()
|
||||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||||
salaryIncreaseAPR:
|
salaryIncreaseAPR:
|
||||||
salaryProfile_APR_Group2.length > 0
|
salaryProfile_APR_Group2.length > 0
|
||||||
? (() => {
|
? (() => {
|
||||||
const filteredType = salaryProfile_APR_Group2
|
const filteredType = salaryProfile_APR_Group2
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.type);
|
.map((profile) => profile.type);
|
||||||
const Type = filteredType[0];
|
const Type = filteredType[0];
|
||||||
return Type === "HAFT" ? "ครึ่งขั้น" : Type === "FULL" ? "หนึ่งขั้น" : Type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : "ไม่ได้เลื่อนขั้น"
|
return Type === "HAFT"
|
||||||
})()
|
? "ครึ่งขั้น"
|
||||||
: null, //การเลื่อนเงินเดือนรอบเมษา
|
: Type === "FULL"
|
||||||
Type: item.type === "FULL" ? "หนึ่งขั้น" : item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : null,
|
? "หนึ่งขั้น"
|
||||||
|
: Type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: "ไม่ได้เลื่อนขั้น";
|
||||||
|
})()
|
||||||
|
: null, //การเลื่อนเงินเดือนรอบเมษา
|
||||||
|
Type:
|
||||||
|
item.type === "FULL"
|
||||||
|
? "หนึ่งขั้น"
|
||||||
|
: item.type === "FULLHAFT"
|
||||||
|
? "หนึ่งขั้นครึ่ง"
|
||||||
|
: null,
|
||||||
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
||||||
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
||||||
})),
|
})),
|
||||||
|
|
@ -1896,7 +1962,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
type: "NONE", //ไม่ได้เลื่อน
|
type: "NONE", //ไม่ได้เลื่อน
|
||||||
isRetired: salaryPeriod.period === 'APR' ? In([true, false]) : false, //กรองเฉพาะคนที่ไม่เกษียณเฉพาะรอบตุลา
|
isRetired: salaryPeriod.period === "APR" ? In([true, false]) : false, //กรองเฉพาะคนที่ไม่เกษียณเฉพาะรอบตุลา
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
|
|
@ -2068,7 +2134,7 @@ export class ReportController extends Controller {
|
||||||
const salaryPeriod = await this.salaryPeriodRepository.findOne({
|
const salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
id: salaryPeriodId,
|
id: salaryPeriodId,
|
||||||
isActive: true
|
isActive: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -2142,13 +2208,14 @@ export class ReportController extends Controller {
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()),
|
yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()),
|
||||||
date: salaryPeriod.period === "APR"
|
date:
|
||||||
? Extension.ToThaiNumber(
|
salaryPeriod.period === "APR"
|
||||||
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
? Extension.ToThaiNumber(
|
||||||
)
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
||||||
: Extension.ToThaiNumber(
|
)
|
||||||
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
|
: Extension.ToThaiNumber(
|
||||||
),
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
|
||||||
|
),
|
||||||
agency: root,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
|
|
@ -2184,10 +2251,10 @@ export class ReportController extends Controller {
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
salaryPeriod: {
|
salaryPeriod: {
|
||||||
period: salaryPeriod.period
|
period: salaryPeriod.period,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isRetired: true // เฉพาะคนที่เกษียณ
|
isRetired: true, // เฉพาะคนที่เกษียณ
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
type: "DESC",
|
type: "DESC",
|
||||||
|
|
@ -2243,7 +2310,9 @@ export class ReportController extends Controller {
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()),
|
yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()),
|
||||||
date: Extension.ToThaiNumber(Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`))),
|
date: Extension.ToThaiNumber(
|
||||||
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
|
||||||
|
),
|
||||||
agency: root,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
|
|
@ -2389,13 +2458,14 @@ export class ReportController extends Controller {
|
||||||
reportName: salaryPeriod.period === "APR" ? "gov1-08" : "gov2-09",
|
reportName: salaryPeriod.period === "APR" ? "gov1-08" : "gov2-09",
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
date: salaryPeriod.period === "APR"
|
date:
|
||||||
? Extension.ToThaiNumber(
|
salaryPeriod.period === "APR"
|
||||||
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
? Extension.ToThaiNumber(
|
||||||
)
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
||||||
: Extension.ToThaiNumber(
|
)
|
||||||
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
|
: Extension.ToThaiNumber(
|
||||||
),
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
|
||||||
|
),
|
||||||
agency: salaryOrgGroup1?.root,
|
agency: salaryOrgGroup1?.root,
|
||||||
profileSpecial: profileSpecial,
|
profileSpecial: profileSpecial,
|
||||||
profileNoAmount: profileNoAmount,
|
profileNoAmount: profileNoAmount,
|
||||||
|
|
@ -2784,9 +2854,7 @@ export class ReportController extends Controller {
|
||||||
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
|
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
|
||||||
: "",
|
: "",
|
||||||
amountSpecial:
|
amountSpecial:
|
||||||
profile.amountSpecial > 0
|
profile.amountSpecial > 0 ? Extension.ToThaiNumber(profile.amountSpecial.toString()) : "",
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toString())
|
|
||||||
: "",
|
|
||||||
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
|
|
@ -3216,7 +3284,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel ? Extension.ToThaiNumber(String(profile.posLevel.toLocaleString())): null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(String(profile.posLevel.toLocaleString()))
|
||||||
|
: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -3467,82 +3537,82 @@ export class ReportController extends Controller {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API 14-บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับค่าตอบแทนพิเศษ
|
* API 14-บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับค่าตอบแทนพิเศษ
|
||||||
*
|
*
|
||||||
* @summary 14-บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับค่าตอบแทนพิเศษ
|
* @summary 14-บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับค่าตอบแทนพิเศษ
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get("emp-14/{rootId}/{salaryPeriodId}")
|
@Get("emp-14/{rootId}/{salaryPeriodId}")
|
||||||
async SalaryReportEmp1_14(@Path() rootId: string, @Path() salaryPeriodId: string) {
|
async SalaryReportEmp1_14(@Path() rootId: string, @Path() salaryPeriodId: string) {
|
||||||
const salaryPeriod = await this.salaryPeriodRepository.findOne({
|
const salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
id: salaryPeriodId,
|
id: salaryPeriodId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!salaryPeriod) {
|
if (!salaryPeriod) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
}
|
}
|
||||||
const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({
|
const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
isNext: false,
|
isNext: false,
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
positionSalaryAmount: "ASC",
|
positionSalaryAmount: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!_salaryPeriod) {
|
if (!_salaryPeriod) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
||||||
|
|
||||||
const formattedData = _salaryPeriod.map((profile, index) => {
|
const formattedData = _salaryPeriod.map((profile, index) => {
|
||||||
const fullNameParts = [
|
const fullNameParts = [
|
||||||
profile.child4,
|
profile.child4,
|
||||||
profile.child3,
|
profile.child3,
|
||||||
profile.child2,
|
profile.child2,
|
||||||
profile.child1,
|
profile.child1,
|
||||||
profile.root,
|
profile.root,
|
||||||
`${profile.prefix}${profile.firstName} ${profile.lastName}`,
|
`${profile.prefix}${profile.firstName} ${profile.lastName}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
const fullName = fullNameParts
|
const fullName = fullNameParts
|
||||||
.filter((part) => part !== undefined && part !== null)
|
.filter((part) => part !== undefined && part !== null)
|
||||||
.join("/");
|
.join("/");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel
|
posLevel: profile.posLevel
|
||||||
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
? `${profile.posTypeShort} ${Extension.ToThaiNumber(profile.posLevel.toLocaleString())}`
|
||||||
: null,
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
||||||
reason: null, // หมายเหตุ
|
reason: null, // หมายเหตุ
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: "emp1-14",
|
template: "emp1-14",
|
||||||
reportName: "emp1-14",
|
reportName: "emp1-14",
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
agency: agency,
|
agency: agency,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* API 15-บัญชีรายละเอียดลูกจ้างประจำที่ได้รับค่าตอบแทนพิเศษ(แนบท้ายคำสั่ง)
|
* API 15-บัญชีรายละเอียดลูกจ้างประจำที่ได้รับค่าตอบแทนพิเศษ(แนบท้ายคำสั่ง)
|
||||||
*
|
*
|
||||||
|
|
@ -3909,22 +3979,31 @@ export class ReportController extends Controller {
|
||||||
totalSalary:
|
totalSalary:
|
||||||
octSnap1 == null ? "" : Extension.ToThaiNumber(octSnap1.currentAmount.toLocaleString()),
|
octSnap1 == null ? "" : Extension.ToThaiNumber(octSnap1.currentAmount.toLocaleString()),
|
||||||
sixPercent:
|
sixPercent:
|
||||||
octSnap1 == null ? "" : Extension.ToThaiNumber(octSnap1.sixPercentAmount.toLocaleString()),
|
octSnap1 == null
|
||||||
|
? ""
|
||||||
|
: Extension.ToThaiNumber(octSnap1.sixPercentAmount.toLocaleString()),
|
||||||
remainingAmountApr:
|
remainingAmountApr:
|
||||||
// aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.useAmount.toLocaleString()), //จำนวนเงินที่ใช้เลื่อนขั้นค่าจ้างไปแล้วในวันที่ 1 เม.ย.
|
// aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.useAmount.toLocaleString()), //จำนวนเงินที่ใช้เลื่อนขั้นค่าจ้างไปแล้วในวันที่ 1 เม.ย.
|
||||||
aprSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()),
|
aprSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()),
|
||||||
remainingAmountOct:
|
remainingAmountOct:
|
||||||
//octSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()), //เหลือเงินใช้เลื่อนขั้นค่าจ้างในวันที่ 1 ต.ค.
|
//octSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()), //เหลือเงินใช้เลื่อนขั้นค่าจ้างในวันที่ 1 ต.ค.
|
||||||
octSnap2 == null ? "" : Extension.ToThaiNumber((octSnap2.sixPercentAmount - octSnap2.spentAmount).toLocaleString()),
|
octSnap2 == null
|
||||||
|
? ""
|
||||||
|
: Extension.ToThaiNumber(
|
||||||
|
(octSnap2.sixPercentAmount - octSnap2.spentAmount).toLocaleString(),
|
||||||
|
),
|
||||||
totalOld: aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.total.toLocaleString()), //จำนวน(คน)(โควตาเลื่อนขั้นค่าจ้าง)
|
totalOld: aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.total.toLocaleString()), //จำนวน(คน)(โควตาเลื่อนขั้นค่าจ้าง)
|
||||||
fifteenPercentOld:
|
fifteenPercentOld:
|
||||||
aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.fifteenPercent.toLocaleString()),
|
aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.fifteenPercent.toLocaleString()),
|
||||||
totalUseOld:
|
totalUseOld:
|
||||||
aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.quantityUsed.toLocaleString()), //พิจารณาให้(คน)(โควตาเลื่อนขั้นค่าจ้าง)
|
aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.quantityUsed.toLocaleString()), //พิจารณาให้(คน)(โควตาเลื่อนขั้นค่าจ้าง)
|
||||||
full2: totalEmp2step == null ? "" : Extension.ToThaiNumber(totalEmp2step.toLocaleString()), //เลื่อนขั้นค่าจ้างรวมทั้งปีสองขั้นจำนวน(คน)
|
full2: totalEmp2step == null ? "" : Extension.ToThaiNumber(totalEmp2step.toLocaleString()), //เลื่อนขั้นค่าจ้างรวมทั้งปีสองขั้นจำนวน(คน)
|
||||||
fullHaft: fullHaftCount == null ? "" : Extension.ToThaiNumber(fullHaftCount.toLocaleString()), //จำนวน(คน)(หนึ่งขั้นครึ่ง)
|
fullHaft:
|
||||||
|
fullHaftCount == null ? "" : Extension.ToThaiNumber(fullHaftCount.toLocaleString()), //จำนวน(คน)(หนึ่งขั้นครึ่ง)
|
||||||
fullHaftSalary:
|
fullHaftSalary:
|
||||||
fullHaftTotalAmount == null ? "" : Extension.ToThaiNumber(fullHaftTotalAmount.toLocaleString()), //ใช้เงิน(หนึ่งขั้นครึ่ง)
|
fullHaftTotalAmount == null
|
||||||
|
? ""
|
||||||
|
: Extension.ToThaiNumber(fullHaftTotalAmount.toLocaleString()), //ใช้เงิน(หนึ่งขั้นครึ่ง)
|
||||||
full: fullCount == null ? "" : Extension.ToThaiNumber(fullCount.toLocaleString()), //จำนวน(คน)(หนึ่งขั้น)
|
full: fullCount == null ? "" : Extension.ToThaiNumber(fullCount.toLocaleString()), //จำนวน(คน)(หนึ่งขั้น)
|
||||||
fullSalary:
|
fullSalary:
|
||||||
fullTotalAmount == null ? "" : Extension.ToThaiNumber(fullTotalAmount.toLocaleString()), //ใช้เงิน(หนึ่งขั้น)
|
fullTotalAmount == null ? "" : Extension.ToThaiNumber(fullTotalAmount.toLocaleString()), //ใช้เงิน(หนึ่งขั้น)
|
||||||
|
|
@ -5174,7 +5253,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel ? Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -5451,7 +5532,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -5562,7 +5645,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -5651,7 +5736,9 @@ export class ReportController extends Controller {
|
||||||
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
||||||
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
||||||
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -5738,7 +5825,9 @@ export class ReportController extends Controller {
|
||||||
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
(profile.child2 == undefined && profile.child2 == null ? "" : profile.child2 + "/") +
|
||||||
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
(profile.child1 == undefined && profile.child1 == null ? "" : profile.child1 + "/") +
|
||||||
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
(profile.root == undefined && profile.root == null ? "" : profile.root),
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -5829,7 +5918,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -5936,7 +6027,9 @@ export class ReportController extends Controller {
|
||||||
return {
|
return {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -6018,21 +6111,20 @@ export class ReportController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
}
|
}
|
||||||
|
|
||||||
let perviousYearAPR:any;
|
let perviousYearAPR: any;
|
||||||
let perviousYearOCT:any;
|
let perviousYearOCT: any;
|
||||||
let salaryProfilePerviousAPR:any;
|
let salaryProfilePerviousAPR: any;
|
||||||
let salaryProfilePerviousOCT:any;
|
let salaryProfilePerviousOCT: any;
|
||||||
|
|
||||||
//งวดปีก่อนหน้า
|
//งวดปีก่อนหน้า
|
||||||
perviousYearAPR = await this.salaryPeriodRepository.findOne({
|
perviousYearAPR = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
period: "APR",
|
period: "APR",
|
||||||
year: salaryPeriodOCT.year - 1,
|
year: salaryPeriodOCT.year - 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
perviousYearOCT = await this.salaryPeriodRepository.findOne({
|
||||||
perviousYearOCT = await this.salaryPeriodRepository.findOne({
|
|
||||||
where: {
|
where: {
|
||||||
period: "OCT",
|
period: "OCT",
|
||||||
year: salaryPeriodOCT.year - 1,
|
year: salaryPeriodOCT.year - 1,
|
||||||
|
|
@ -6040,7 +6132,7 @@ export class ReportController extends Controller {
|
||||||
});
|
});
|
||||||
|
|
||||||
//ปีก่อนหน้า
|
//ปีก่อนหน้า
|
||||||
if(perviousYearAPR){
|
if (perviousYearAPR) {
|
||||||
salaryProfilePerviousAPR = await this.salaryProfileEmployeeRepository.find({
|
salaryProfilePerviousAPR = await this.salaryProfileEmployeeRepository.find({
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -6055,7 +6147,7 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(perviousYearOCT){
|
if (perviousYearOCT) {
|
||||||
salaryProfilePerviousOCT = await this.salaryProfileEmployeeRepository.find({
|
salaryProfilePerviousOCT = await this.salaryProfileEmployeeRepository.find({
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -6159,7 +6251,9 @@ export class ReportController extends Controller {
|
||||||
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
no: Extension.ToThaiNumber((index + 1).toLocaleString()),
|
||||||
fullName: fullName,
|
fullName: fullName,
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
posLevel: profile.posLevel?Extension.ToThaiNumber(profile.posLevel.toLocaleString()):null,
|
posLevel: profile.posLevel
|
||||||
|
? Extension.ToThaiNumber(profile.posLevel.toLocaleString())
|
||||||
|
: null,
|
||||||
posNumber:
|
posNumber:
|
||||||
Extension.ToThaiNumber(profile.orgShortName) +
|
Extension.ToThaiNumber(profile.orgShortName) +
|
||||||
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
|
|
@ -6183,4 +6277,184 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ออกคำสั่ง 33
|
||||||
|
*
|
||||||
|
* @summary ออกคำสั่ง 33
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
*/
|
||||||
|
@Get("command/33/{id}")
|
||||||
|
async SalaryReport33(@Path() id: string) {
|
||||||
|
const salary = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!salary) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
|
}
|
||||||
|
const salaryOrgs = await this.salaryOrgRepository.find({
|
||||||
|
where: { id: salary.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
const salaryRank = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In(salaryOrgs.map((x) => x.id)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const _salaryRank = salaryRank.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess(_salaryRank);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ออกคำสั่ง 34
|
||||||
|
*
|
||||||
|
* @summary ออกคำสั่ง 34
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
*/
|
||||||
|
@Get("command/34/{id}")
|
||||||
|
async SalaryReport34(@Path() id: string) {
|
||||||
|
const salary = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!salary) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
|
}
|
||||||
|
const salaryOrgs = await this.salaryOrgRepository.find({
|
||||||
|
where: { id: salary.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
const salaryRank = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In(salaryOrgs.map((x) => x.id)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const _salaryRank = salaryRank.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess(_salaryRank);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ออกคำสั่ง 35
|
||||||
|
*
|
||||||
|
* @summary ออกคำสั่ง 35
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
*/
|
||||||
|
@Get("command/35/{id}")
|
||||||
|
async SalaryReport35(@Path() id: string) {
|
||||||
|
const salary = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!salary) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
|
}
|
||||||
|
const salaryOrgs = await this.salaryOrgRepository.find({
|
||||||
|
where: { id: salary.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
const salaryRank = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In(salaryOrgs.map((x) => x.id)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const _salaryRank = salaryRank.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess(_salaryRank);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ออกคำสั่ง 36
|
||||||
|
*
|
||||||
|
* @summary ออกคำสั่ง 36
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
*/
|
||||||
|
@Get("command/36/{id}")
|
||||||
|
async SalaryReport36(@Path() id: string) {
|
||||||
|
const salary = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!salary) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
|
}
|
||||||
|
const salaryOrgs = await this.salaryOrgRepository.find({
|
||||||
|
where: { id: salary.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
const salaryRank = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In(salaryOrgs.map((x) => x.id)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const _salaryRank = salaryRank.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess(_salaryRank);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ออกคำสั่ง 37
|
||||||
|
*
|
||||||
|
* @summary ออกคำสั่ง 37
|
||||||
|
*
|
||||||
|
* @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
*/
|
||||||
|
@Get("command/37/{id}")
|
||||||
|
async SalaryReport37(@Path() id: string) {
|
||||||
|
const salary = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (!salary) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขึ้นเงินเดือน");
|
||||||
|
}
|
||||||
|
const salaryOrgs = await this.salaryOrgRepository.find({
|
||||||
|
where: { id: salary.id },
|
||||||
|
});
|
||||||
|
|
||||||
|
const salaryRank = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In(salaryOrgs.map((x) => x.id)),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const _salaryRank = salaryRank.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess(_salaryRank);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,14 @@ export class SalaryProfile extends EntityBase {
|
||||||
})
|
})
|
||||||
salaryOrgId: string;
|
salaryOrgId: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "ไอดีโปรไฟล์",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "คำนำหน้า",
|
comment: "คำนำหน้า",
|
||||||
|
|
@ -313,6 +321,9 @@ export class CreateSalaryProfile {
|
||||||
@Column()
|
@Column()
|
||||||
type: string;
|
type: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
profileId: string;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
prefix: string;
|
prefix: string;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,14 @@ export class SalaryProfileEmployee extends EntityBase {
|
||||||
})
|
})
|
||||||
salaryLevelNew: number;
|
salaryLevelNew: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "ไอดีโปรไฟล์",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "คำนำหน้า",
|
comment: "คำนำหน้า",
|
||||||
|
|
@ -365,6 +373,9 @@ export class CreateSalaryProfileEmployee {
|
||||||
@Column()
|
@Column()
|
||||||
type: string;
|
type: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
profileId: string;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
prefix: string;
|
prefix: string;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableSalaryprofileAddProfileId1713980385738 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableSalaryprofileAddProfileId1713980385738'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` ADD \`profileId\` varchar(40) NULL COMMENT 'ไอดีโปรไฟล์'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`profileId\` varchar(40) NULL COMMENT 'ไอดีโปรไฟล์'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`profileId\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` DROP COLUMN \`profileId\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue