Bổ sung người thanh toán vào thêm địa điểm

This commit is contained in:
2026-06-14 15:59:27 +07:00
parent 65a9b39966
commit 71007bd9a1
23 changed files with 245 additions and 449 deletions
+3 -3
View File
@@ -134,7 +134,6 @@ class TourController {
plannedEnd: body.plannedEnd ? new Date(body.plannedEnd) : null,
}
}).then(async (loc) => {
// Thêm nhanh chi phí nếu có số tiền
if (body.expenseAmount && Number(body.expenseAmount) > 0) {
await this.prisma.expense.create({
data: {
@@ -142,7 +141,9 @@ class TourController {
category: body.expenseCategory || 'OTHER',
locationId: loc.id,
legId: loc.legId,
description: `Chi phí tại ${loc.name}`
description: body.expenseDescription || `Chi phí tại ${loc.name}`,
note: body.expenseNote || null,
paidById: body.paidById || null,
}
});
}
@@ -344,7 +345,6 @@ class TourController {
orderBy: { sequence: 'asc' },
include: {
locations: { orderBy: { plannedStart: 'asc' } },
expenses: true,
},
},
},