Merge branch 'main' of https://git.shiblysolution.id/TCEL-ANATL/entity
This commit is contained in:
@ -37,11 +37,26 @@ export class HrmsPayroll {
|
|||||||
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
subsidy: number;
|
subsidy: number;
|
||||||
|
|
||||||
@Column({ type: "decimal", precision: 5, scale: 2, nullable: false, default: 4.0 })
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
niss_percentage: number;
|
total_gross: number;
|
||||||
|
|
||||||
@Column({ type: "decimal", precision: 5, scale: 2, nullable: false, default: 10.0 })
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
tax_percentage: number;
|
ss_4_percent: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
ss_6_percent: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
ss_total: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
tax_amount: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
total_deduct: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
total_nett: number;
|
||||||
|
|
||||||
@Column({ length: 64 })
|
@Column({ length: 64 })
|
||||||
status: Status;
|
status: Status;
|
||||||
|
|||||||
115
src/entity/hrms/hrms_payroll_monthly.ts
Normal file
115
src/entity/hrms/hrms_payroll_monthly.ts
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
Index,
|
||||||
|
} from "typeorm";
|
||||||
|
import { Status } from "../../types/status";
|
||||||
|
import { HrmsEmployee } from "./hrms_employee";
|
||||||
|
import { HrmsPayroll } from "./hrms_payroll";
|
||||||
|
|
||||||
|
@Entity("hrms_payroll_monthly", { schema: "hrms" })
|
||||||
|
@Index(["employee", "period_month", "period_year"], { unique: true })
|
||||||
|
export class HrmsPayrollMonthly {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsEmployee, { onDelete: "RESTRICT", nullable: false })
|
||||||
|
@JoinColumn({ name: "employee_id" })
|
||||||
|
employee: HrmsEmployee;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsPayroll, { onDelete: "RESTRICT", nullable: true })
|
||||||
|
@JoinColumn({ name: "payroll_setup_id" })
|
||||||
|
payroll_setup: HrmsPayroll;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: false })
|
||||||
|
period_month: number; // 1-12
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: false })
|
||||||
|
period_year: number; // e.g., 2026
|
||||||
|
|
||||||
|
// Payroll Setup Data (snapshot at the time of generation)
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false })
|
||||||
|
basic_salary: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
subsidy: number;
|
||||||
|
|
||||||
|
// Working Days Calculation
|
||||||
|
@Column({ type: "int", nullable: false })
|
||||||
|
working_days_in_month: number;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: false, default: 0 })
|
||||||
|
days_present: number;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: false, default: 0 })
|
||||||
|
days_absent: number;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: false, default: 0 })
|
||||||
|
unpaid_leave_days: number;
|
||||||
|
|
||||||
|
// Deductions for Absences
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
deduction_absence: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
deduction_unpaid_leave: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
total_attendance_deduction: number;
|
||||||
|
|
||||||
|
// Recalculated Amounts
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false })
|
||||||
|
adjusted_basic_salary: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false })
|
||||||
|
total_gross: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
ss_4_percent: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
ss_6_percent: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
ss_total: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
tax_amount: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
total_deduct: number;
|
||||||
|
|
||||||
|
@Column({ type: "decimal", precision: 15, scale: 2, nullable: false, default: 0 })
|
||||||
|
total_nett: number;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
notes: string;
|
||||||
|
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@UpdateDateColumn({ nullable: true })
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@DeleteDateColumn({ nullable: true })
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
|
|
||||||
@ -10,5 +10,6 @@ export * from "../entity/hrms/hrms_training";
|
|||||||
export * from "../entity/hrms/hrms_training_participant";
|
export * from "../entity/hrms/hrms_training_participant";
|
||||||
export * from "../entity/hrms/hrms_bank";
|
export * from "../entity/hrms/hrms_bank";
|
||||||
export * from "../entity/hrms/hrms_payroll";
|
export * from "../entity/hrms/hrms_payroll";
|
||||||
|
export * from "../entity/hrms/hrms_payroll_monthly";
|
||||||
|
|
||||||
export * from "../types/hrms";
|
export * from "../types/hrms";
|
||||||
|
|||||||
Reference in New Issue
Block a user