- 부가세 신고 페이지 다국어화 (3개 페이지) * 조회 페이지: 헤더 타이틀, 탭, 검색/다운로드 * 상세 페이지: 세금계산서 상세 정보 * 참조번호 발급 페이지: 신청 완료/실패 메시지 - 부가세 엔티티 컴포넌트 다국어화 (11개 컴포넌트) * vat-return-tab: 세금계산서/부가세참고 탭 * list-wrap: 조회 페이지 래퍼 * list-item: 거래 항목 (통화 표기 포함) * reference-wrap: 참조 자료 신청 * reference-request-success/fail: 신청 결과 * list-detail-bottom-sheet: 상세 내역 (10개 통화 인스턴스) - 섹션 컴포넌트 다국어화 (4개) * amount-section: 금액 상세 (공급가액, VAT, 합계금액) * issue-section: 발행 정보 (발행대상일자, 적요 등) * supplier-section: 공급자 정보 * receiver-section: 공급받는 자 정보 - 통화 표기 통일 (10개 인스턴스) * 한국어: 1,000원 (suffix) * 영어: ₩1,000 (prefix) - 번역 키 추가: vatReturn 네임스페이스 29개 키 - 기존 번역 키 재사용 (merchant, transaction, common, home) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
126 lines
4.5 KiB
TypeScript
126 lines
4.5 KiB
TypeScript
import { useEffect, useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { PATHS } from '@/shared/constants/paths';
|
|
import { useLocation } from 'react-router';
|
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
import { useVatReturnDetailMutation } from '@/entities/vat-return/api/use-vat-return-detail-mutation';
|
|
import { HeaderType } from '@/entities/common/model/types';
|
|
import {
|
|
Breakdown,
|
|
VatReturnBreakdownParams,
|
|
VatReturnBreakdownResponse,
|
|
VatReturnDetailParams,
|
|
VatReturnDetailResponse
|
|
} from '@/entities/vat-return/model/types';
|
|
import {
|
|
useSetOnBack,
|
|
useSetHeaderTitle,
|
|
useSetHeaderType,
|
|
useSetFooterMode
|
|
} from '@/widgets/sub-layout/use-sub-layout';
|
|
import { SupplierSection } from '@/entities/vat-return/ui/section/supplier-section';
|
|
import { ReceiverSection } from '@/entities/vat-return/ui/section/receiver-section';
|
|
import { IssueSection } from '@/entities/vat-return/ui/section/issue-section';
|
|
import { AmountSection } from '@/entities/vat-return/ui/section/amount-section';
|
|
import { useVatReturnTaxInvoiceMutation } from '@/entities/vat-return/api/use-vat-return-tax-invoice-mutation';
|
|
import { VatReturnListDetailBottomSheet } from '@/entities/vat-return/ui/list-detail-bottom-sheet';
|
|
import { useVatReturnBreakdownMutation } from '@/entities/vat-return/api/use-vat-return-breakdown-mutation';
|
|
|
|
export const DetailPage = () => {
|
|
const { t } = useTranslation();
|
|
const { navigate } = useNavigate();
|
|
const location = useLocation();
|
|
|
|
let taxInvoiceNumber = location?.state.taxInvoiceNumber;
|
|
// taxInvoiceNumber = 'TAX202506300001';
|
|
|
|
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
|
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
|
const [detail, setDetail] = useState<VatReturnDetailResponse>({});
|
|
const [breakdown, setBreakdown] = useState<Array<Breakdown>>([]);
|
|
|
|
useSetHeaderTitle(t('vatReturn.taxInvoiceDetail'));
|
|
useSetHeaderType(HeaderType.RightClose);
|
|
useSetOnBack(() => {
|
|
navigate(PATHS.vatReturn.list);
|
|
});
|
|
useSetFooterMode(false);
|
|
|
|
const { mutateAsync: vatReturnTaxInvoice } = useVatReturnTaxInvoiceMutation();
|
|
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
|
const { mutateAsync: vatReturnBreakdown } = useVatReturnBreakdownMutation();
|
|
|
|
const callTaxInvoice = () => {
|
|
let params: VatReturnDetailParams = {
|
|
taxInvoiceNumber: taxInvoiceNumber,
|
|
};
|
|
vatReturnDetail(params).then((rs: VatReturnDetailResponse) => {
|
|
setDetail(rs);
|
|
|
|
});
|
|
};
|
|
const callVatReturnBreakdown = async() => {
|
|
let params: VatReturnBreakdownParams = {
|
|
taxInvoiceNumber: taxInvoiceNumber,
|
|
};
|
|
vatReturnBreakdown(params).then((rs: VatReturnBreakdownResponse) => {
|
|
setBreakdown(rs.breakdown);
|
|
});
|
|
};
|
|
|
|
const onClickToOpenBottomSheet = () => {
|
|
setBottomSheetOn(true);
|
|
};
|
|
|
|
useEffect(() => {
|
|
callTaxInvoice();
|
|
callVatReturnBreakdown();
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<main className="full-height">
|
|
<div className="tab-content pb-86">
|
|
<div className="tab-pane sub active">
|
|
<div className="option-list">
|
|
<div className="txn-detail">
|
|
<AmountSection
|
|
detail={ detail }
|
|
></AmountSection>
|
|
<div className="txn-divider minus"></div>
|
|
<IssueSection
|
|
detail={ detail }
|
|
></IssueSection>
|
|
<div className="txn-divider minus"></div>
|
|
<ReceiverSection
|
|
detail={ detail }
|
|
></ReceiverSection>
|
|
<div className="txn-divider"></div>
|
|
<SupplierSection
|
|
detail={ detail }
|
|
></SupplierSection>
|
|
</div>
|
|
</div>
|
|
<div className="apply-row">
|
|
<button
|
|
className="btn-50 btn-blue flex-1"
|
|
onClick={ onClickToOpenBottomSheet }
|
|
>{t('vatReturn.viewDetails')}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
{ !!bottomSheetOn &&
|
|
<VatReturnListDetailBottomSheet
|
|
bottomSheetOn={ bottomSheetOn }
|
|
setBottomSheetOn={ setBottomSheetOn }
|
|
breakdown={ breakdown }
|
|
transactionAmount={ detail?.transactionAmount }
|
|
supplyAmount={ detail?.supplyAmount }
|
|
vatAmount={ detail?.vatAmount }
|
|
totalAmount={ detail?.totalAmount }
|
|
></VatReturnListDetailBottomSheet>
|
|
}
|
|
</>
|
|
)
|
|
}; |