เพิ่มฟิว isretire

This commit is contained in:
Kittapath 2024-02-29 11:29:05 +07:00
parent 77b8ef8a7d
commit 8358ed8773
3 changed files with 37 additions and 9 deletions

View file

@ -121,10 +121,14 @@ export class SalaryPeriodController extends Controller {
const data = {
total: salaryOrg.total,
fifteenPercent: salaryOrg.fifteenPercent,
chosen: salaryOrg.salaryProfiles.filter((x) => x.posType == "FULL").length,
remaining:
salaryOrg.fifteenPercent -
salaryOrg.salaryProfiles.filter((x) => x.posType == "FULL").length,
chosen: salaryOrg.quantityUsed,
remaining: salaryOrg.remainQuota,
currentAmount: salaryOrg.currentAmount,
sixPercentAmount: salaryOrg.sixPercentAmount,
spentAmount: salaryOrg.spentAmount,
sixPercentSpentAmount: salaryOrg.sixPercentAmount - salaryOrg.spentAmount,
useAmount: salaryOrg.useAmount,
remainingAmount: salaryOrg.remainingAmount,
};
return new HttpSuccess(data);
}

View file

@ -269,6 +269,13 @@ export class SalaryProfile extends EntityBase {
})
retired2: string;
@Column({
nullable: true,
comment: "เกษียญ",
default: false,
})
isRetired: boolean;
@ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles)
@JoinColumn({ name: "salaryOrgId" })
salaryOrg: SalaryOrg;
@ -351,17 +358,20 @@ export class CreateSalaryProfile {
child4: string | null;
@Column()
result: boolean;
result: string;
@Column()
duration: boolean;
duration: string;
@Column()
punish: boolean;
punish: string;
@Column()
retired: boolean;
retired: string;
@Column()
retired2: boolean;
retired2: string;
@Column()
isRetired: boolean;
}

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableSalaryProfileAddIsretired1709180884777 implements MigrationInterface {
name = 'UpdateTableSalaryProfileAddIsretired1709180884777'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isRetired\` tinyint NULL COMMENT 'เกษียญ' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isRetired\``);
}
}