알림 수정
This commit is contained in:
@@ -5,6 +5,9 @@ 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,
|
||||
VatReturnTaxInvoiceParams,
|
||||
@@ -22,6 +25,7 @@ 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 { navigate } = useNavigate();
|
||||
@@ -33,6 +37,7 @@ export const DetailPage = () => {
|
||||
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
||||
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
||||
const [detail, setDetail] = useState<VatReturnTaxInvoiceResponse>({});
|
||||
const [breakdown, setBreakdown] = useState<Array<Breakdown>>([]);
|
||||
|
||||
useSetHeaderTitle('세금계산서 상세');
|
||||
useSetHeaderType(HeaderType.RightClose);
|
||||
@@ -43,6 +48,7 @@ export const DetailPage = () => {
|
||||
|
||||
const { mutateAsync: vatReturnTaxInvoice } = useVatReturnTaxInvoiceMutation();
|
||||
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
||||
const { mutateAsync: vatReturnBreakdown } = useVatReturnBreakdownMutation();
|
||||
|
||||
const callTaxInvoice = () => {
|
||||
let params: VatReturnDetailParams = {
|
||||
@@ -52,6 +58,14 @@ export const DetailPage = () => {
|
||||
setDetail(rs);
|
||||
});
|
||||
};
|
||||
const callVatReturnBreakdown = () => {
|
||||
let params: VatReturnBreakdownParams = {
|
||||
taxInvoiceNumber: taxInvoiceNumber,
|
||||
};
|
||||
vatReturnBreakdown(params).then((rs: VatReturnBreakdownResponse) => {
|
||||
setBreakdown(rs.breakdown);
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToOpenBottomSheet = () => {
|
||||
setBottomSheetOn(true);
|
||||
@@ -59,6 +73,7 @@ export const DetailPage = () => {
|
||||
|
||||
useEffect(() => {
|
||||
callTaxInvoice();
|
||||
// callVatReturnBreakdown();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -98,6 +113,7 @@ export const DetailPage = () => {
|
||||
<VatReturnListDetailBottomSheet
|
||||
bottomSheetOn={ bottomSheetOn }
|
||||
setBottomSheetOn={ setBottomSheetOn }
|
||||
breakdown={ breakdown }
|
||||
></VatReturnListDetailBottomSheet>
|
||||
}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user