แสดงกลุ่มทั้งหมดในdashboard
This commit is contained in:
parent
acbc71c2e6
commit
7280da0b05
3 changed files with 64 additions and 32 deletions
|
|
@ -124,26 +124,21 @@ export class SalaryPeriodEmployeeController extends Controller {
|
|||
const _salaryOrg = await this.salaryOrgRepository.find({
|
||||
relations: ["salaryPeriod", "salaryProfiles"],
|
||||
where: {
|
||||
group: Like(`%${body.group.trim().toUpperCase()}%`),
|
||||
group: Like(
|
||||
`%${body.group.trim().toUpperCase() == "GROUP1" ? "GROUP1" : body.group.trim().toUpperCase() == "GROUP2" ? "GROUP2" : "GROUP1"}%`,
|
||||
),
|
||||
snapshot: body.snapshot.trim().toUpperCase(),
|
||||
salaryPeriod: { period: body.period.trim().toUpperCase(), year: body.year },
|
||||
salaryPeriod: { id: body.period },
|
||||
},
|
||||
});
|
||||
const salaryOrg: any[] = [];
|
||||
await Promise.all(
|
||||
_salaryOrg.map(async (item) => {
|
||||
const fullNameParts = [
|
||||
item == null || item.salaryProfiles.length == 0 || item.salaryProfiles[0].root == null
|
||||
? null
|
||||
: item.salaryProfiles[0].root,
|
||||
];
|
||||
const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/");
|
||||
const sum = item.salaryProfiles.reduce((accumulator, object) => {
|
||||
return accumulator + object.amountSpecial;
|
||||
}, 0);
|
||||
const data = {
|
||||
org: org,
|
||||
group: item.group,
|
||||
org: item.root,
|
||||
total: item.total,
|
||||
fifteenPercent: item.fifteenPercent,
|
||||
chosen: item.quantityUsed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue