search startDate and endDate
This commit is contained in:
parent
ee610c5686
commit
0aba9f9865
20 changed files with 123 additions and 32 deletions
|
|
@ -36,7 +36,7 @@ import {
|
|||
setFile,
|
||||
} from "../utils/minio";
|
||||
import { isUsedError, notFoundError, relationError } from "../utils/error";
|
||||
import { queryOrNot } from "../utils/relation";
|
||||
import { queryOrNot, whereDateQuery } from "../utils/relation";
|
||||
import { isSystem } from "../utils/keycloak";
|
||||
import { precisionRound } from "../utils/arithmetic";
|
||||
|
||||
|
|
@ -196,6 +196,8 @@ export class DebitNoteController extends Controller {
|
|||
@Query() includeRegisteredBranch?: boolean,
|
||||
@Query() code?: string,
|
||||
@Body() body?: {},
|
||||
@Query() startDate?: Date,
|
||||
@Query() endDate?: Date,
|
||||
) {
|
||||
const where = {
|
||||
OR: queryOrNot<Prisma.QuotationWhereInput[]>(query, [
|
||||
|
|
@ -220,6 +222,7 @@ export class DebitNoteController extends Controller {
|
|||
debitNoteQuotationId: quotationId,
|
||||
registeredBranch: isSystem(req.user) ? undefined : { OR: permissionCond(req.user) },
|
||||
quotationStatus: status,
|
||||
...whereDateQuery(startDate, endDate),
|
||||
} satisfies Prisma.QuotationWhereInput;
|
||||
|
||||
const [result, total] = await prisma.$transaction([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue