Changeset 87c9f1e for src/app/api/invoices
- Timestamp:
- 02/27/25 00:42:38 (6 weeks ago)
- Branches:
- main
- Children:
- 32e9876
- Parents:
- 3c5302a
- Location:
- src/app/api/invoices
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/app/api/invoices/[id]/route.ts
r3c5302a r87c9f1e 100 100 data: { 101 101 invoiceNumber: validation.data.invoiceNumber, 102 createDate: validation.data.createDate,102 issueDate: validation.data.issueDate, 103 103 dueDate: validation.data.dueDate, 104 104 status: validation.data.status, -
src/app/api/invoices/route.ts
r3c5302a r87c9f1e 45 45 ? { equals: validatedFilters.status as InvoiceStatus } 46 46 : undefined, 47 createDate: {47 issueDate: { 48 48 ...(validatedFilters.startDate && { gte: validatedFilters.startDate }), 49 49 ...(validatedFilters.endDate && { lte: validatedFilters.endDate }), … … 108 108 quantityType: validatedData.quantityType, 109 109 subTotal: validatedData.subTotal, 110 createDate: validatedData.createDate,110 issueDate: validatedData.issueDate, 111 111 month: validatedData.month, 112 112 discount: validatedData.discount, -
src/app/api/invoices/totals/route.ts
r3c5302a r87c9f1e 20 20 const searchParams = request.nextUrl.searchParams; 21 21 const startDate = searchParams.get('startDate') 22 ? new Date(searchParams.get(' startDate')!)22 ? new Date(searchParams.get('issueDate')!) 23 23 : null; 24 24 … … 32 32 status, 33 33 currency, 34 SUM("total Amount") as total34 SUM("total_amount") as total 35 35 FROM "Invoice" 36 WHERE " createDate" >= ${startDate}37 AND " invoiceFromId" = ${tenantId}36 WHERE "issue_date" >= ${startDate} 37 AND "tenant_id" = ${tenantId} 38 38 GROUP BY status, currency 39 39 `;
Note:
See TracChangeset
for help on using the changeset viewer.