feat: search invoice now cover more field
This commit is contained in:
parent
58389ed47f
commit
c2fb5ab1ec
1 changed files with 21 additions and 0 deletions
|
|
@ -47,9 +47,30 @@ export class InvoiceController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() query: string = "",
|
||||
@Query() quotationId?: string,
|
||||
) {
|
||||
const where: Prisma.InvoiceWhereInput = {
|
||||
OR: [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ quotation: { workName: { contains: query } } },
|
||||
{
|
||||
quotation: {
|
||||
customerBranch: {
|
||||
OR: [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ customerName: { contains: query } },
|
||||
{ registerName: { contains: query } },
|
||||
{ registerNameEN: { contains: query } },
|
||||
{ firstName: { contains: query } },
|
||||
{ firstNameEN: { contains: query } },
|
||||
{ lastName: { contains: query } },
|
||||
{ lastNameEN: { contains: query } },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
quotationId,
|
||||
quotation: {
|
||||
registeredBranch: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue