feat: add pay split field
This commit is contained in:
parent
ab91d0923f
commit
2765aac661
3 changed files with 14 additions and 5 deletions
8
prisma/migrations/20241003064126_add_field/migration.sql
Normal file
8
prisma/migrations/20241003064126_add_field/migration.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `amount` to the `QuotationPaySplit` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "QuotationPaySplit" ADD COLUMN "amount" DOUBLE PRECISION NOT NULL;
|
||||
|
|
@ -1066,8 +1066,9 @@ model Quotation {
|
|||
model QuotationPaySplit {
|
||||
id String @id @default(cuid())
|
||||
|
||||
no Int
|
||||
date DateTime @db.Date
|
||||
no Int
|
||||
date DateTime @db.Date
|
||||
amount Float
|
||||
|
||||
quotation Quotation? @relation(fields: [quotationId], references: [id])
|
||||
quotationId String?
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ type QuotationCreate = {
|
|||
payCondition: PayCondition;
|
||||
|
||||
paySplitCount?: number;
|
||||
paySplit?: Date[];
|
||||
paySplit?: { date: Date; amount: number }[];
|
||||
|
||||
payBillDate?: Date;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ type QuotationUpdate = {
|
|||
payCondition?: PayCondition;
|
||||
|
||||
paySplitCount?: number;
|
||||
paySplit?: Date[];
|
||||
paySplit?: { date: Date; amount: number }[];
|
||||
|
||||
payBillDate?: Date;
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ export class QuotationController extends Controller {
|
|||
createMany: {
|
||||
data: (rest.paySplit || []).map((v, i) => ({
|
||||
no: i + 1,
|
||||
date: v,
|
||||
...v,
|
||||
})),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue