diff --git a/src/stores/report/index.ts b/src/stores/report/index.ts index f23d62c6..419d9994 100644 --- a/src/stores/report/index.ts +++ b/src/stores/report/index.ts @@ -130,8 +130,8 @@ export async function getReportProfit(params?: { if (params?.years) { const currentYear = new Date().getFullYear(); - opts.startDate = new Date(currentYear - params.years, 0, 1); // ✅ 1 ม.ค. ของปีที่ต้องการ - opts.endDate = new Date(currentYear, 11, 31); // ✅ 31 ธ.ค. ของปีปัจจุบัน + opts.startDate = new Date(currentYear - params.years, 0, 1); + opts.endDate = new Date(currentYear, 11, 31); } const res = await api.get(`/${ENDPOINT}/profit`, {