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 {
|
model QuotationPaySplit {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
|
|
||||||
no Int
|
no Int
|
||||||
date DateTime @db.Date
|
date DateTime @db.Date
|
||||||
|
amount Float
|
||||||
|
|
||||||
quotation Quotation? @relation(fields: [quotationId], references: [id])
|
quotation Quotation? @relation(fields: [quotationId], references: [id])
|
||||||
quotationId String?
|
quotationId String?
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ type QuotationCreate = {
|
||||||
payCondition: PayCondition;
|
payCondition: PayCondition;
|
||||||
|
|
||||||
paySplitCount?: number;
|
paySplitCount?: number;
|
||||||
paySplit?: Date[];
|
paySplit?: { date: Date; amount: number }[];
|
||||||
|
|
||||||
payBillDate?: Date;
|
payBillDate?: Date;
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ type QuotationUpdate = {
|
||||||
payCondition?: PayCondition;
|
payCondition?: PayCondition;
|
||||||
|
|
||||||
paySplitCount?: number;
|
paySplitCount?: number;
|
||||||
paySplit?: Date[];
|
paySplit?: { date: Date; amount: number }[];
|
||||||
|
|
||||||
payBillDate?: Date;
|
payBillDate?: Date;
|
||||||
|
|
||||||
|
|
@ -394,7 +394,7 @@ export class QuotationController extends Controller {
|
||||||
createMany: {
|
createMany: {
|
||||||
data: (rest.paySplit || []).map((v, i) => ({
|
data: (rest.paySplit || []).map((v, i) => ({
|
||||||
no: i + 1,
|
no: i + 1,
|
||||||
date: v,
|
...v,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue