This commit is contained in:
Rizki
2026-01-22 16:51:55 +07:00
3 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,102 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { HrmsEmployee } from "../hrms/hrms_employee";
import { FinanceCpv } from "./finance_cpvs";
import { FinanceBankAccount } from "./finance_bank_account";
import { FinancePaymentOrderStatusType } from "../../types/finance";
@Entity("finance_payment_orders", { schema: "finances" })
export class FinancePaymentOrder {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
cpv: FinanceCpv;
@Column({
unique: true,
length: 128,
})
code: string;
@Column({
nullable: false,
})
payment_order_at: Date;
@Column({
nullable: true,
length: 256,
})
paid_to_name: string;
@Column({
nullable: true,
length: 256,
})
paid_to_title: string;
@Column({
nullable: true,
length: 128,
})
subject_type: string;
@ManyToOne(() => FinanceBankAccount, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
bank_account: FinanceBankAccount;
@Column({
nullable: true,
type: "float8",
})
amount: number;
@Column({
type: "text",
nullable: true,
})
amount_words: string;
@Column({
type: "text",
nullable: true,
})
objective: string;
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
approved_by: HrmsEmployee;
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
authorized_by: HrmsEmployee;
@Column({
nullable: false,
default: FinancePaymentOrderStatusType.draft,
length: 128,
})
status: FinancePaymentOrderStatusType;
@Column()
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@Column({ nullable: true })
@UpdateDateColumn()
updated_at: Date;
@Column({ nullable: true, length: 256 })
updated_by: string;
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
@Column({ nullable: true, length: 256 })
deleted_by: string;
}

View File

@ -16,5 +16,6 @@ export * from "../entity/finance/finance_checklist_payment";
export * from "../entity/finance/finance_checklist_payment_item"; export * from "../entity/finance/finance_checklist_payment_item";
export * from "../entity/finance/finance_checklist_payment_approval"; export * from "../entity/finance/finance_checklist_payment_approval";
export * from "../entity/finance/finance_checklist_payment_document"; export * from "../entity/finance/finance_checklist_payment_document";
export * from "../entity/finance/finance_payment_orders";
export * from "../types/finance"; export * from "../types/finance";

View File

@ -42,6 +42,13 @@ export enum FinanceCpvStatusType {
reject = "reject", reject = "reject",
} }
export enum FinancePaymentOrderStatusType {
draft = "draft",
pending_approve = "pending_approve",
approve = "approve",
reject = "reject",
}
export enum FinanceChecklistPaymentItemType { export enum FinanceChecklistPaymentItemType {
ADVANCE_FUND = "advance_fund", ADVANCE_FUND = "advance_fund",
FCP_CPV = "fcp_cpv", FCP_CPV = "fcp_cpv",