diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 5d510f3..3ab1afc 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -372,6 +372,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: Level.posTypeId, posLevelId: Level.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); @@ -683,6 +684,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: Level.posTypeId, posLevelId: Level.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); @@ -1054,6 +1056,7 @@ export class SalaryPeriodController extends Controller { where: { posTypeId: posLevel.posTypeId, posLevelId: posLevel.id, + isSpecial: salaryProfile.isSpecial == false ? false : true, isActive: true, }, }); diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index bcb88c8..7575e4c 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -294,6 +294,13 @@ export class SalaryProfile extends EntityBase { }) isNext: boolean; + @Column({ + nullable: true, + comment: "ฉ", + default: null, + }) + isSpecial: boolean; + @ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) salaryOrg: SalaryOrg; @@ -395,4 +402,7 @@ export class CreateSalaryProfile { @Column() isRetired: boolean; + + @Column() + isSpecial: boolean; } diff --git a/src/entities/SalaryProfileEmployee.ts b/src/entities/SalaryProfileEmployee.ts index e85fc43..7407564 100644 --- a/src/entities/SalaryProfileEmployee.ts +++ b/src/entities/SalaryProfileEmployee.ts @@ -346,6 +346,13 @@ export class SalaryProfileEmployee extends EntityBase { }) isNext: boolean; + @Column({ + nullable: true, + comment: "ฉ", + default: null, + }) + isSpecial: boolean; + @ManyToOne(() => SalaryOrgEmployee, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) salaryOrg: SalaryOrgEmployee; @@ -456,4 +463,7 @@ export class CreateSalaryProfileEmployee { @Column() isRetired: boolean; + + @Column() + isSpecial: boolean; } diff --git a/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts b/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts new file mode 100644 index 0000000..ccab8d4 --- /dev/null +++ b/src/migration/1712043041340-update_table_salaryProfileEmployee_add_isSpecial.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileEmployeeAddIsSpecial1712043041340 implements MigrationInterface { + name = 'UpdateTableSalaryProfileEmployeeAddIsSpecial1712043041340' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` ADD \`isSpecial\` tinyint NULL COMMENT 'ฉ'`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isSpecial\` tinyint NULL COMMENT 'ฉ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isSpecial\``); + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` DROP COLUMN \`isSpecial\``); + } + +}