From 84ade896c47660164f03c52737cf9c76c18be3ce Mon Sep 17 00:00:00 2001 From: "focp212@naver.com" Date: Tue, 28 Oct 2025 20:09:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=90=EC=8A=A4=ED=81=AC=EB=A1=9C=20?= =?UTF-8?q?=EB=B0=8F=20=EC=84=B8=EA=B8=88=EA=B3=84=EC=82=B0=EC=84=9C=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/vat-return/model/types.ts | 3 +- .../ui/list-detail-bottom-sheet.tsx | 212 +++++++++++------- src/pages/transaction/billing/list-page.tsx | 2 +- src/pages/vat-return/detail-page.tsx | 26 +-- 4 files changed, 142 insertions(+), 101 deletions(-) diff --git a/src/entities/vat-return/model/types.ts b/src/entities/vat-return/model/types.ts index 04c8076..dfe24b6 100644 --- a/src/entities/vat-return/model/types.ts +++ b/src/entities/vat-return/model/types.ts @@ -43,7 +43,7 @@ export interface Breakdown { totalAmount: number; supplyAmount: number; vatAmount: number; - transactionCount: number; + transactionAmount: number; }; export interface VatReturnListResponse extends DefaulResponsePagination { @@ -77,6 +77,7 @@ export interface VatReturnDetailParams { export interface VatReturnDetailResponse { id?: number; + transactionAmount?: number; totalAmount?: number; supplyAmount?: number; vatAmount?: number; diff --git a/src/entities/vat-return/ui/list-detail-bottom-sheet.tsx b/src/entities/vat-return/ui/list-detail-bottom-sheet.tsx index 4eea771..04fdb3e 100644 --- a/src/entities/vat-return/ui/list-detail-bottom-sheet.tsx +++ b/src/entities/vat-return/ui/list-detail-bottom-sheet.tsx @@ -1,21 +1,47 @@ import { IMAGE_ROOT } from "@/shared/constants/common"; import { Breakdown } from "../model/types"; +import moment from "moment"; +import { NumericFormat } from "react-number-format"; +import { SlideDown } from 'react-slidedown'; +import 'react-slidedown/lib/slidedown.css'; +import { useEffect, useState } from "react"; export interface VatReturnListDetailBottomSheetProps { bottomSheetOn: boolean; setBottomSheetOn: (bottomSheetOn: boolean) => void; - breakdown: Array + breakdown: Array; + transactionAmount?: number; + supplyAmount?: number; + vatAmount?: number; + totalAmount?: number; }; export const VatReturnListDetailBottomSheet = ({ bottomSheetOn, setBottomSheetOn, - breakdown + breakdown, + transactionAmount, + supplyAmount, + vatAmount, + totalAmount }: VatReturnListDetailBottomSheetProps) => { + const [isOpenDetail, setIsOpenDetail] = useState>([]); + const onClickToClose = () => { setBottomSheetOn(false); }; + const openDetail = (index: number) => { + let arr = breakdown.map((value, index) => false); + arr[index] = true; + setIsOpenDetail(arr); + }; + + useEffect(() => { + let arr = breakdown.map((value, index) => false); + setIsOpenDetail(arr); + }, []) + return ( <>
@@ -41,99 +67,119 @@ export const VatReturnListDetailBottomSheet = ({
거래금액 :
-
1,000,000,000
+
+ +
공급가액 :
-
43,758,520
+
+ +
VAT :
-
4,366,850
+
+ +
합계금액 :
-
48,125,100
-
-
-
-
-
거래일
-
합계금액
-
-
- - 2025/08/01 -
- 8,125,100 - -
-
-
-
- 거래금액 - 공급가액 - VAT -
-
- 1,000,000 - 720,000 - 80,000 -
-
-
- - 2025/08/01 -
- 8,125,100 - -
-
-
- - 2025/08/01 -
- 8,125,100 - -
-
-
- - 2025/08/01 -
- 8,125,100 - -
-
-
- - 2025/08/01 -
- 8,125,100 - +
+
+ { breakdown && breakdown.length > 0 && +
+
+
거래일
+
합계금액
+
+ { + breakdown.map((value, index) => ( + <> +
+ + { value.transactionDate? moment(value.transactionDate).format('YYYY-MM-DD'): '' } +
+ + + + openDetail(index) } + /> +
+
+ + { isOpenDetail[index] && +
+
+ 거래금액 + 공급가액 + VAT +
+
+ + + + + + + + + +
+
+ } +
+ + )) + } +
+ }
diff --git a/src/pages/transaction/billing/list-page.tsx b/src/pages/transaction/billing/list-page.tsx index 259c332..2eaf8ec 100644 --- a/src/pages/transaction/billing/list-page.tsx +++ b/src/pages/transaction/billing/list-page.tsx @@ -164,7 +164,7 @@ export const BillingListPage = () => { return ( <>
-
+
diff --git a/src/pages/vat-return/detail-page.tsx b/src/pages/vat-return/detail-page.tsx index 7844826..827da25 100644 --- a/src/pages/vat-return/detail-page.tsx +++ b/src/pages/vat-return/detail-page.tsx @@ -9,9 +9,7 @@ import { VatReturnBreakdownParams, VatReturnBreakdownResponse, VatReturnDetailParams, - VatReturnDetailResponse, - VatReturnTaxInvoiceParams, - VatReturnTaxInvoiceResponse + VatReturnDetailResponse } from '@/entities/vat-return/model/types'; import { useSetOnBack, @@ -32,13 +30,13 @@ export const DetailPage = () => { const location = useLocation(); let taxInvoiceNumber = location?.state.taxInvoiceNumber; - taxInvoiceNumber = 'TAX202506300001'; + // taxInvoiceNumber = 'TAX202506300001'; const [openAmount, setOpenAmount] = useState(false); const [bottomSheetOn, setBottomSheetOn] = useState(false); - const [detail, setDetail] = useState({}); + const [detail, setDetail] = useState({}); const [breakdown, setBreakdown] = useState>([]); - + useSetHeaderTitle('세금계산서 상세'); useSetHeaderType(HeaderType.RightClose); useSetOnBack(() => { @@ -56,24 +54,16 @@ export const DetailPage = () => { }; vatReturnDetail(params).then((rs: VatReturnDetailResponse) => { setDetail(rs); + }); }; const callVatReturnBreakdown = async() => { let params: VatReturnBreakdownParams = { taxInvoiceNumber: taxInvoiceNumber, }; - try{ - let rs = await vatReturnBreakdown(params); - } - catch{ - console.log('error'); - return; - } - /* vatReturnBreakdown(params).then((rs: VatReturnBreakdownResponse) => { setBreakdown(rs.breakdown); }); - */ }; const onClickToOpenBottomSheet = () => { @@ -82,7 +72,7 @@ export const DetailPage = () => { useEffect(() => { callTaxInvoice(); - // callVatReturnBreakdown(); + callVatReturnBreakdown(); }, []); return ( @@ -123,6 +113,10 @@ export const DetailPage = () => { bottomSheetOn={ bottomSheetOn } setBottomSheetOn={ setBottomSheetOn } breakdown={ breakdown } + transactionAmount={ detail?.transactionAmount } + supplyAmount={ detail?.supplyAmount } + vatAmount={ detail?.vatAmount } + totalAmount={ detail?.totalAmount } > }