update api export for executive and fixing closing cycle flow

This commit is contained in:
Alberto-Audrix committed 2026-09-15 16:53:25 +07:00
1 parent d0d1ae7d24
commit 07d36081ce
23 files changed
+1378 -101

No files matched your search

+17 -13
View File
@@ -22,6 +22,7 @@ import {
import { throughVisibleDate } from '../utils/visibility.ts';
import { getCountingAccuracyWarning } from '../utils/countingAccuracyWarning.ts';
import DashboardReportCtas from './dashboard/DashboardReportCtas.tsx';
import DashboardCloseCycleControls from './dashboard/DashboardCloseCycleControls.tsx';
import DashboardManualInputForm from './dashboard/DashboardManualInputForm.tsx';
import ReportPreviewOverlay from './dashboard/ReportPreviewOverlay.tsx';
import CountingAccuracyWarningBanner from './counting/CountingAccuracyWarningBanner.tsx';
@@ -229,19 +230,22 @@ const Dashboard: React.FC<Props> = ({ setView }) => {
title="Dashboard"
subtitle={`${selectedSite?.site_name ?? ''} · ${selectedKandang?.kandang_name ?? ''} · Siklus ${formatDateRange(selectedCycle.start_date, selectedCycle.end_date)} (${cycleStatus === 'active' ? 'aktif' : cycleStatus === 'pending_close' ? 'menunggu GM' : 'selesai'})`}
/>
<DashboardReportCtas
cycleClosed={cycleStatus === 'closed'}
hasDailySnapshot={false}
hasEndCycleSnapshot={false}
onOpenDaily={() => {
setReportType('daily');
setReportOpen(true);
}}
onOpenEndCycle={() => {
setReportType('end_cycle');
setReportOpen(true);
}}
/>
<div className="flex flex-col items-end gap-3 sm:flex-row sm:items-start">
<DashboardCloseCycleControls />
<DashboardReportCtas
cycleClosed={cycleStatus === 'closed'}
hasDailySnapshot={false}
hasEndCycleSnapshot={false}
onOpenDaily={() => {
setReportType('daily');
setReportOpen(true);
}}
onOpenEndCycle={() => {
setReportType('end_cycle');
setReportOpen(true);
}}
/>
</div>
</div>
{error && (
<div className="mb-4">