hotfix(FE): Pass sales data to ClosingDetail and fix sales API

This commit is contained in:
rstubryan
2025-12-10 15:05:52 +07:00
parent 8c2683c440
commit d7199fad53
4 changed files with 30 additions and 20 deletions
+12 -3
View File
@@ -7,15 +7,24 @@ import Button from '@/components/Button';
import Tabs from '@/components/Tabs';
import ClosingGeneralInformationTable from '@/components/pages/closing/ClosingGeneralInformationTable';
import { ClosingGeneralInformation } from '@/types/api/closing';
import {
ClosingGeneralInformation,
BaseClosingSales,
} from '@/types/api/closing';
import ClosingSapronakTabContent from './ClosingSapronakTabContent';
import SalesReportTable from './sale/SalesReportTable';
interface ClosingDetailProps {
id: number;
initialValue?: ClosingGeneralInformation;
salesData?: BaseClosingSales;
}
const ClosingDetail: React.FC<ClosingDetailProps> = ({ id, initialValue }) => {
const ClosingDetail: React.FC<ClosingDetailProps> = ({
id,
initialValue,
salesData,
}) => {
const [activeTab, setActiveTab] = useState<string>('sapronak');
const closingDetailTabs = useMemo(() => {
@@ -33,7 +42,7 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({ id, initialValue }) => {
{
id: 'penjualan',
label: 'Penjualan',
content: 'Penjualan',
content: <SalesReportTable initialValues={salesData} />,
},
{
id: 'overhead',