diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 4555920..8278e10 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -282,20 +282,33 @@ export class QuotationController extends Controller { select: { requestWork: { where: { + OR: [ + { request: { requestDataStatus: RequestDataStatus.Canceled } }, + { stepStatus: { some: { workStatus: RequestWorkStatus.Canceled } } }, + ], creditNoteId: null, - stepStatus: { some: { workStatus: RequestWorkStatus.Canceled } }, }, }, }, }, }, where: { - requestWork: { - some: { - creditNoteId: null, - stepStatus: { some: { workStatus: RequestWorkStatus.Canceled } }, + OR: [ + { + requestDataStatus: RequestDataStatus.Canceled, + requestWork: { + some: { creditNoteId: null }, + }, }, - }, + { + requestWork: { + some: { + creditNoteId: null, + stepStatus: { some: { workStatus: RequestWorkStatus.Canceled } }, + }, + }, + }, + ], quotationId: { in: result.map((v) => v.id) }, }, });