diff --git a/src/controllers/OrganizationDotnetController.ts b/src/controllers/OrganizationDotnetController.ts index 0ab0bbc9..75dd9c55 100644 --- a/src/controllers/OrganizationDotnetController.ts +++ b/src/controllers/OrganizationDotnetController.ts @@ -6949,7 +6949,9 @@ export class OrganizationDotnetController extends Controller { break; } } - const date = body.date.setHours(23, 59, 59, 999); + const date = body.date ? new Date(body.date.toISOString().slice(0, 10)) : new Date(); + // set เวลาเป็น 23:59:59 ของวันนั้น + date.setHours(23, 59, 59, 999); let profile = await this.posMasterHistoryRepository.find({ where: {