Bổ sung người thanh toán vào thêm địa điểm
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user