From a52a73c62b5f380e2bb516c6027cafc5f1351c9a Mon Sep 17 00:00:00 2001 From: avicenan Date: Tue, 28 Apr 2026 15:00:13 +0700 Subject: [PATCH] fix change unit price and total price format in medicine and change compound to item --- src/entity/emr/emr_compounding_medicine.ts | 8 -------- src/entity/emr/emr_compounding_medicine_item.ts | 6 ++++++ src/entity/emr/emr_prescription.ts | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/entity/emr/emr_compounding_medicine.ts b/src/entity/emr/emr_compounding_medicine.ts index b07a5aa..a264e31 100644 --- a/src/entity/emr/emr_compounding_medicine.ts +++ b/src/entity/emr/emr_compounding_medicine.ts @@ -14,9 +14,7 @@ import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item"; import { UsageTime } from "../pharmacy/usage_time"; import { UsageInstructions } from "../pharmacy/usage_instructions"; import { EmrRegistration } from "./emr_registration"; -import { Room } from "../room"; import { EmrPatient } from "./emr_patient"; -import { User } from "../users"; import { EmrPharmacyOrder } from "./emr_pharmacy_order"; @Entity("emr_compounding_medicine", { schema: "emr" }) @@ -59,12 +57,6 @@ export class EmrCompoundingMedicine { @OneToMany(() => EmrCompoundingMedicineItem, (item) => item.compounding_medicine, { cascade: true }) items: EmrCompoundingMedicineItem[]; - @Column({ nullable: true, type: "float" }) - unit_price?: number | null; - - @Column({ nullable: true, type: "float" }) - total_price?: number | null; - @Column() @CreateDateColumn() created_at: Date; diff --git a/src/entity/emr/emr_compounding_medicine_item.ts b/src/entity/emr/emr_compounding_medicine_item.ts index 6590a91..fa05606 100644 --- a/src/entity/emr/emr_compounding_medicine_item.ts +++ b/src/entity/emr/emr_compounding_medicine_item.ts @@ -35,6 +35,12 @@ export class EmrCompoundingMedicineItem { @JoinColumn({ name: "room_stock_id" }) room_stock: RoomStock; + @Column({ type: "decimal", precision: 10, scale: 2, nullable: true }) + unit_price?: number | null; + + @Column({ type: "decimal", precision: 10, scale: 2, nullable: true }) + total_price?: number | null; + @Column() @CreateDateColumn() created_at: Date; diff --git a/src/entity/emr/emr_prescription.ts b/src/entity/emr/emr_prescription.ts index 002b552..050d21a 100644 --- a/src/entity/emr/emr_prescription.ts +++ b/src/entity/emr/emr_prescription.ts @@ -57,10 +57,10 @@ export class EmrPrescription { @JoinColumn({ name: "room_stock_id" }) room_stock: RoomStock; - @Column({ nullable: true, type: "float" }) + @Column({ type: "decimal", precision: 10, scale: 2, nullable: true }) unit_price?: number | null; - @Column({ nullable: true, type: "float" }) + @Column({ type: "decimal", precision: 10, scale: 2, nullable: true }) total_price?: number | null; @Column()