update fix data chicken counting not showing before publish cutoff #2

This commit is contained in:
Alberto-Audrix committed 2026-10-02 11:51:29 +07:00
1 parent 3fe6b05258
commit d9e04a2bd7
2 files changed
+5 -7

No files matched your search

+2 -4
View File
@@ -114,13 +114,11 @@ const DataManagementPage: React.FC<{ onSettings: () => void }> = ({ onSettings }
const manualByDate = new Map(manualRows.map((m) => [m.date, m]));
const kpiByDate = new Map(kpis.map((k) => [k.date, k]));
const lastCycleDay = Math.max(0, (selectedCycle.total_days || 1) - 1);
const calendarDay = cycleDayForDate(selectedCycle.start_date, todayIso());
// Closed cycles stop at end_date; active / open cycles build daily rows through calendar today.
const endDay = selectedCycle.end_date
? cycleDayForDate(selectedCycle.start_date, selectedCycle.end_date)
const maxDay = selectedCycle.end_date
? Math.min(calendarDay, cycleDayForDate(selectedCycle.start_date, selectedCycle.end_date))
: calendarDay;
const maxDay = Math.min(calendarDay, lastCycleDay, endDay);
const today = todayIso();
let previousStockAkhir = 0;
+3 -3
View File
@@ -38,10 +38,10 @@ function stockAkhirByDate(
const kpiByDate = new Map(kpis.map((k) => [k.date, k]));
const manualByDate = new Map(manualInputs.map((m) => [m.date, m]));
const lastCycleDay = Math.max(0, (cycle.total_days || 1) - 1);
const calendarDay = cycleDayForDate(cycle.start_date, todayIso());
const endDay = cycle.end_date ? cycleDayForDate(cycle.start_date, cycle.end_date) : calendarDay;
const maxDay = Math.min(calendarDay, lastCycleDay, endDay);
const maxDay = cycle.end_date
? Math.min(calendarDay, cycleDayForDate(cycle.start_date, cycle.end_date))
: calendarDay;
const result = new Map<string, number>();
let previousStockAkhir = 0;