diff --git a/src/controllers/quotation-controller.ts b/src/controllers/quotation-controller.ts index 68d5dbb..02e4347 100644 --- a/src/controllers/quotation-controller.ts +++ b/src/controllers/quotation-controller.ts @@ -67,6 +67,7 @@ type QuotationCreate = { work: { id: string; // Name field will come from original data + excluded?: boolean; product: { id: string; amount: number; @@ -335,6 +336,8 @@ export class QuotationController extends Controller { detail: currentService.detail, attributes: currentService.attributes as Prisma.JsonObject, work: a.work.flatMap((c) => { + if (c.excluded) return []; + const currentWork = currentService.work.find((d) => d.id === c.id); if (!currentWork) return []; // should not possible