feat: add installment no to quotation data

This is for when issue invoice.
This commit is contained in:
Methapon Metanipat 2024-10-25 09:01:32 +07:00
parent af463ee509
commit 73ec9bd323
3 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "QuotationProductServiceList" ADD COLUMN "installmentNo" INTEGER;

View file

@ -1208,6 +1208,8 @@ model QuotationProductServiceList {
discount Float discount Float
pricePerUnit Float pricePerUnit Float
installmentNo Int?
productId String productId String
product Product @relation(fields: [productId], references: [id]) product Product @relation(fields: [productId], references: [id])

View file

@ -76,6 +76,7 @@ type QuotationCreate = {
productId: string; productId: string;
amount: number; amount: number;
discount?: number; discount?: number;
installmentNo?: number;
workerIndex?: number[]; workerIndex?: number[];
}[]; }[];
}; };
@ -130,6 +131,7 @@ type QuotationUpdate = {
productId: string; productId: string;
amount: number; amount: number;
discount?: number; discount?: number;
installmentNo?: number;
workerIndex?: number[]; workerIndex?: number[];
}[]; }[];
}; };
@ -412,6 +414,7 @@ export class QuotationController extends Controller {
pricePerUnit, pricePerUnit,
amount: v.amount, amount: v.amount,
discount: v.discount || 0, discount: v.discount || 0,
installmentNo: v.installmentNo,
vat, vat,
worker: { worker: {
create: sortedEmployeeId create: sortedEmployeeId
@ -667,6 +670,7 @@ export class QuotationController extends Controller {
pricePerUnit, pricePerUnit,
amount: v.amount, amount: v.amount,
discount: v.discount || 0, discount: v.discount || 0,
installmentNo: v.installmentNo,
vat, vat,
worker: { worker: {
create: sortedEmployeeId create: sortedEmployeeId