Merge branch 'main' of https://git.shiblysolution.id/TCEL-ANATL/entity
This commit is contained in:
102
src/entity/finance/finance_payment_orders.ts
Normal file
102
src/entity/finance/finance_payment_orders.ts
Normal 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;
|
||||
}
|
||||
@ -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_approval";
|
||||
export * from "../entity/finance/finance_checklist_payment_document";
|
||||
export * from "../entity/finance/finance_payment_orders";
|
||||
|
||||
export * from "../types/finance";
|
||||
|
||||
@ -42,6 +42,13 @@ export enum FinanceCpvStatusType {
|
||||
reject = "reject",
|
||||
}
|
||||
|
||||
export enum FinancePaymentOrderStatusType {
|
||||
draft = "draft",
|
||||
pending_approve = "pending_approve",
|
||||
approve = "approve",
|
||||
reject = "reject",
|
||||
}
|
||||
|
||||
export enum FinanceChecklistPaymentItemType {
|
||||
ADVANCE_FUND = "advance_fund",
|
||||
FCP_CPV = "fcp_cpv",
|
||||
|
||||
Reference in New Issue
Block a user