เงินเดือนไม่มีค่าให้เป็นnull
This commit is contained in:
parent
6791dde26f
commit
0888d3d8d8
3 changed files with 30 additions and 15 deletions
|
|
@ -388,7 +388,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
if (body.type == "NONE") {
|
if (body.type == "NONE") {
|
||||||
salaryProfile.amountSpecial = 0;
|
salaryProfile.amountSpecial = 0;
|
||||||
salaryProfile.amountUse = 0;
|
salaryProfile.amountUse = 0;
|
||||||
salaryProfile.positionSalaryAmount = salaryProfile.amount;
|
salaryProfile.positionSalaryAmount = salaryProfile.amount == null ? 0 : salaryProfile.amount;
|
||||||
} else if (body.type == "PENDING") {
|
} else if (body.type == "PENDING") {
|
||||||
salaryProfile.amountSpecial = 0;
|
salaryProfile.amountSpecial = 0;
|
||||||
salaryProfile.amountUse = 0;
|
salaryProfile.amountUse = 0;
|
||||||
|
|
|
||||||
|
|
@ -111,31 +111,28 @@ export class SalaryProfile extends EntityBase {
|
||||||
comment: "เงินเดือนฐาน",
|
comment: "เงินเดือนฐาน",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
amount: number;
|
amount: number | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
|
||||||
type: "double",
|
type: "double",
|
||||||
comment: "เงินพิเศษ",
|
comment: "เงินพิเศษ",
|
||||||
default: null,
|
default: 0,
|
||||||
})
|
})
|
||||||
amountSpecial: number;
|
amountSpecial: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
|
||||||
type: "double",
|
type: "double",
|
||||||
comment: "จำนวนเงินที่ใช้เลื่อน",
|
comment: "จำนวนเงินที่ใช้เลื่อน",
|
||||||
default: null,
|
default: 0,
|
||||||
})
|
})
|
||||||
amountUse: number | null;
|
amountUse: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
|
||||||
type: "double",
|
type: "double",
|
||||||
comment: "เงินเดือนหลังเลื่อน",
|
comment: "เงินเดือนหลังเลื่อน",
|
||||||
default: null,
|
default: 0,
|
||||||
})
|
})
|
||||||
positionSalaryAmount: number | null;
|
positionSalaryAmount: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment:
|
comment:
|
||||||
|
|
@ -358,19 +355,19 @@ export class CreateSalaryProfile {
|
||||||
child4: string | null;
|
child4: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
result: string;
|
result: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
duration: string;
|
duration: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
punish: string;
|
punish: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
retired: string;
|
retired: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
retired2: string;
|
retired2: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
isRetired: boolean;
|
isRetired: boolean;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableSalaryProfileAddIsretired11709189881087 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableSalaryProfileAddIsretired11709189881087'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountSpecial\` \`amountSpecial\` double NOT NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountUse\` \`amountUse\` double NOT NULL COMMENT 'จำนวนเงินที่ใช้เลื่อน' DEFAULT '0'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`positionSalaryAmount\` \`positionSalaryAmount\` double NOT NULL COMMENT 'เงินเดือนหลังเลื่อน' DEFAULT '0'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`positionSalaryAmount\` \`positionSalaryAmount\` double NULL COMMENT 'เงินเดือนหลังเลื่อน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountUse\` \`amountUse\` double NULL COMMENT 'จำนวนเงินที่ใช้เลื่อน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfile\` CHANGE \`amountSpecial\` \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue