세금계산서 샘플링
This commit is contained in:
@@ -8,6 +8,7 @@ import { snackBar } from '@/shared/lib';
|
||||
import { useCashReceiptReceiptDownloadMutation } from '../../api/use-cash-receipt-receipt-download-mutation';
|
||||
import { useState } from 'react';
|
||||
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
|
||||
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
|
||||
|
||||
export const AmountInfoSection = ({
|
||||
transactionCategory,
|
||||
@@ -22,6 +23,7 @@ export const AmountInfoSection = ({
|
||||
|
||||
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
const [taxInvoiceOn, setTaxInvoiceOn] = useState<boolean>(false);
|
||||
|
||||
let newAmountInfo: Record<string, any> | undefined = amountInfo;
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
@@ -194,13 +196,20 @@ export const AmountInfoSection = ({
|
||||
selectedMode: DownloadSelectedMode,
|
||||
userEmail?: string
|
||||
) => {
|
||||
console.log(selectedMode, userEmail, tid)
|
||||
if(!!tid){
|
||||
let params: CashReceiptReceiptDownloadParams = {
|
||||
tid: tid
|
||||
};
|
||||
cashReceiptReceiptDownload(params).then((rs: CashReceiptReceiptDownloadResponse) => {
|
||||
console.log(rs);
|
||||
snackBar('거래확인서 다운 성공');
|
||||
if(selectedMode === DownloadSelectedMode.IMAGE){
|
||||
setTaxInvoiceOn(true);
|
||||
}
|
||||
else if(selectedMode === DownloadSelectedMode.EMAIL){
|
||||
snackBar('거래확인서 다운 성공');
|
||||
}
|
||||
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
snackBar(e.response?.data?.error?.message);
|
||||
@@ -403,7 +412,7 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
<div className="txn-doc">
|
||||
{ (transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
!!canDownloadReceipt &&
|
||||
// !!canDownloadReceipt &&
|
||||
<button
|
||||
className="doc-btn"
|
||||
type="button"
|
||||
@@ -421,6 +430,12 @@ export const AmountInfoSection = ({
|
||||
sendRequest={ onRequestDownload }
|
||||
></DownloadBottomSheet>
|
||||
}
|
||||
{
|
||||
<TaxInvoiceSample
|
||||
taxInvoiceOn={ taxInvoiceOn }
|
||||
setTaxInvoiceOn={ setTaxInvoiceOn }
|
||||
></TaxInvoiceSample>
|
||||
}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user