แก้ชื่อหน่วยงาน
This commit is contained in:
parent
1cf851c395
commit
de0f2572d6
1 changed files with 61 additions and 23 deletions
|
|
@ -248,8 +248,14 @@ export class ReportController extends Controller {
|
||||||
if (!_salaryPeriod) {
|
if (!_salaryPeriod) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.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 = [
|
||||||
|
|
@ -281,7 +287,7 @@ export class ReportController extends Controller {
|
||||||
reportName: salaryPeriod.period == "APR" ? "gov1-01" : "gov2-01",
|
reportName: salaryPeriod.period == "APR" ? "gov1-01" : "gov2-01",
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
agency: agency,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -311,6 +317,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const agency =
|
const agency =
|
||||||
_salaryPeriod[0] == null || _salaryPeriod[0].salaryProfiles[0] == null
|
_salaryPeriod[0] == null || _salaryPeriod[0].salaryProfiles[0] == null
|
||||||
? ""
|
? ""
|
||||||
|
|
@ -1104,7 +1111,7 @@ export class ReportController extends Controller {
|
||||||
yearSlice: year.slice(-2),
|
yearSlice: year.slice(-2),
|
||||||
point: fifteenPercent_Group1 + fifteenPoint_Group1,
|
point: fifteenPercent_Group1 + fifteenPoint_Group1,
|
||||||
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
||||||
root: salaryProfileGroup1[0]?.root,
|
root: salaryOrg_Group1?.root,
|
||||||
profile: salaryProfileGroup1.map((item, index) => ({
|
profile: salaryProfileGroup1.map((item, index) => ({
|
||||||
no: Extension.ToThaiNumber(String(index + 1)),
|
no: Extension.ToThaiNumber(String(index + 1)),
|
||||||
fullname:
|
fullname:
|
||||||
|
|
@ -1404,7 +1411,7 @@ export class ReportController extends Controller {
|
||||||
yearSlice: year.slice(-2),
|
yearSlice: year.slice(-2),
|
||||||
point: fifteenPercent + fifteenPoint,
|
point: fifteenPercent + fifteenPoint,
|
||||||
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
||||||
root: salaryProfileGroup1[0]?.root,
|
root: salaryOrg_Group1?.root,
|
||||||
profile: salaryProfileGroup1.map((item, index) => ({
|
profile: salaryProfileGroup1.map((item, index) => ({
|
||||||
no: Extension.ToThaiNumber(String(index + 1)),
|
no: Extension.ToThaiNumber(String(index + 1)),
|
||||||
fullname:
|
fullname:
|
||||||
|
|
@ -1557,7 +1564,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
type: "NONE", //ไม่ได้เลื่อน
|
type: "NONE", //ไม่ได้เลื่อน
|
||||||
isReserve: false, //กรองเฉพาะคนที่ไม่เกษียณ
|
isRetired: false, //กรองเฉพาะคนที่ไม่เกษียณ
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
|
|
@ -1568,8 +1575,14 @@ export class ReportController extends Controller {
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.root;
|
||||||
|
// const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
||||||
|
|
||||||
const formattedData = _salaryPeriod.map((profile, index) => {
|
const formattedData = _salaryPeriod.map((profile, index) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1618,7 +1631,7 @@ export class ReportController extends Controller {
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
effectiveDate: salaryPeriod.effectiveDate,
|
effectiveDate: salaryPeriod.effectiveDate,
|
||||||
root: agency,
|
root: root,
|
||||||
profile: formattedData,
|
profile: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1653,7 +1666,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
type: "NONE", //ไม่ได้เลื่อน
|
type: "NONE", //ไม่ได้เลื่อน
|
||||||
isReserve: true, //กรองเฉพาะคนที่เกษียณ
|
isRetired: true, //กรองเฉพาะคนที่เกษียณ
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
|
|
@ -1664,8 +1677,14 @@ export class ReportController extends Controller {
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.root;
|
||||||
|
// const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
||||||
|
|
||||||
const formattedData = _salaryPeriod.map((profile, index) => {
|
const formattedData = _salaryPeriod.map((profile, index) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1714,7 +1733,7 @@ export class ReportController extends Controller {
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
effectiveDate: salaryPeriod.effectiveDate,
|
effectiveDate: salaryPeriod.effectiveDate,
|
||||||
root: agency,
|
root: root,
|
||||||
profile: formattedData,
|
profile: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1749,7 +1768,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
type: "NONE", //ไม่ได้เลื่อน
|
type: "NONE", //ไม่ได้เลื่อน
|
||||||
isReserve: false, //กรองเฉพาะคนที่ไม่เกษียณ
|
isRetired: false, //กรองเฉพาะคนที่ไม่เกษียณ
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
|
|
@ -1759,8 +1778,14 @@ export class ReportController extends Controller {
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.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 = [
|
||||||
|
|
@ -1795,7 +1820,7 @@ export class ReportController extends Controller {
|
||||||
reportName: salaryPeriod.period == "APR" ? "gov1-05" : "gov2-05",
|
reportName: salaryPeriod.period == "APR" ? "gov1-05" : "gov2-05",
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
agency: agency,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1830,7 +1855,7 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriodId,
|
salaryPeriodId: salaryPeriodId,
|
||||||
},
|
},
|
||||||
type: "NONE", //ไม่ได้เลื่อน
|
type: "NONE", //ไม่ได้เลื่อน
|
||||||
isReserve: true, //กรองเฉพาะคนที่เกษียณ
|
isRetired: true, //กรองเฉพาะคนที่เกษียณ
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
|
|
@ -1840,8 +1865,14 @@ export class ReportController extends Controller {
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
const agency = _salaryPeriod[0] == null ? "" : _salaryPeriod[0].root;
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.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 = [
|
||||||
|
|
@ -1875,7 +1906,7 @@ export class ReportController extends Controller {
|
||||||
reportName: salaryPeriod.period == "APR" ? "gov1-05" : "gov2-05",
|
reportName: salaryPeriod.period == "APR" ? "gov1-05" : "gov2-05",
|
||||||
data: {
|
data: {
|
||||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
|
||||||
agency: agency,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1930,7 +1961,14 @@ export class ReportController extends Controller {
|
||||||
posMasterNo: "ASC",
|
posMasterNo: "ASC",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const agency = salaryProfile[0] == null ? "" : salaryProfile[0].root;
|
const _root = await this.salaryOrgRepository.findOne({
|
||||||
|
where: {
|
||||||
|
rootId: rootId,
|
||||||
|
salaryPeriodId: salaryPeriodId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const root = _root?.root == null ? "" : _root.root;
|
||||||
|
// const agency = salaryProfile[0] == null ? "" : salaryProfile[0].root;
|
||||||
|
|
||||||
const formattedData = salaryProfile.map((item, index) => ({
|
const formattedData = salaryProfile.map((item, index) => ({
|
||||||
no: Extension.ToThaiNumber(String(index + 1)),
|
no: Extension.ToThaiNumber(String(index + 1)),
|
||||||
|
|
@ -1973,7 +2011,7 @@ export class ReportController extends Controller {
|
||||||
date: Extension.ToThaiNumber(
|
date: Extension.ToThaiNumber(
|
||||||
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
|
||||||
),
|
),
|
||||||
agency: agency,
|
agency: root,
|
||||||
data: formattedData,
|
data: formattedData,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue