Merge branch 'main' of https://gitea.bpsoft.co.kr/nicepayments/nice-app-web
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { API_URL_TRANSACTION } from '@/shared/api/api-url-transaction';
|
||||||
|
import { resultify } from '@/shared/lib/resultify';
|
||||||
|
import { NiceAxiosError } from '@/shared/@types/error';
|
||||||
|
import {
|
||||||
|
CashReceiptExcelDownloadParams,
|
||||||
|
CashReceiptExcelDownloadResponse
|
||||||
|
} from '../model/types';
|
||||||
|
import {
|
||||||
|
useMutation,
|
||||||
|
UseMutationOptions
|
||||||
|
} from '@tanstack/react-query';
|
||||||
|
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||||
|
|
||||||
|
export const cashReceiptExcelDownload = (params: CashReceiptExcelDownloadParams) => {
|
||||||
|
let headerOptions = {
|
||||||
|
menuId: 32,
|
||||||
|
apiType: 'DOWNLOAD'
|
||||||
|
};
|
||||||
|
let options = {
|
||||||
|
headers: {
|
||||||
|
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return resultify(
|
||||||
|
axios.post<CashReceiptExcelDownloadResponse>(API_URL_TRANSACTION.cashReceiptReceiptDownload(), params, options),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useCashReceiptExcelDownloadMutation = (options?: UseMutationOptions<CashReceiptExcelDownloadResponse, NiceAxiosError, CashReceiptExcelDownloadParams>) => {
|
||||||
|
const mutation = useMutation<CashReceiptExcelDownloadResponse, NiceAxiosError, CashReceiptExcelDownloadParams>({
|
||||||
|
...options,
|
||||||
|
mutationFn: (params: CashReceiptExcelDownloadParams) => cashReceiptExcelDownload(params),
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...mutation,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -292,6 +292,22 @@ export interface CashReceiptReceiptDownloadResponse {
|
|||||||
customerInfo: CustomerInfo;
|
customerInfo: CustomerInfo;
|
||||||
productInfo: ProductInfo;
|
productInfo: ProductInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum CashReceiptDateType {
|
||||||
|
ISSUE_DATE = 'ISSUE_DATE',
|
||||||
|
CANCEL_DATE = 'CANCEL_DATE'
|
||||||
|
};
|
||||||
|
export interface CashReceiptExcelDownloadParams {
|
||||||
|
email: string;
|
||||||
|
mid: string;
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
dateType: CashReceiptDateType;
|
||||||
|
purposeType: CashReceiptPurposeType;
|
||||||
|
transactionType: CashReceiptTransactionType;
|
||||||
|
processResult: CashReceiptProcessResult;
|
||||||
|
};
|
||||||
|
export interface CashReceiptExcelDownloadResponse {};
|
||||||
export interface EscrowListParams {
|
export interface EscrowListParams {
|
||||||
mid?: string;
|
mid?: string;
|
||||||
searchType?: string;
|
searchType?: string;
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ export const AmountInfoSection = ({
|
|||||||
}
|
}
|
||||||
<div className="txn-doc">
|
<div className="txn-doc">
|
||||||
{ (transactionCategory === TransactionCategory.CashReceipt) &&
|
{ (transactionCategory === TransactionCategory.CashReceipt) &&
|
||||||
// !!canDownloadReceipt &&
|
!!canDownloadReceipt &&
|
||||||
<button
|
<button
|
||||||
className="doc-btn"
|
className="doc-btn"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -446,7 +446,7 @@ export const AmountInfoSection = ({
|
|||||||
sendRequest={ onRequestDownload }
|
sendRequest={ onRequestDownload }
|
||||||
></DownloadBottomSheet>
|
></DownloadBottomSheet>
|
||||||
}
|
}
|
||||||
{
|
{ !!cashReceiptSampleOn &&
|
||||||
<CashReceiptSample
|
<CashReceiptSample
|
||||||
cashReceiptSampleOn={ cashReceiptSampleOn }
|
cashReceiptSampleOn={ cashReceiptSampleOn }
|
||||||
setCashReceiptSampleOn={ setCashReceiptSampleOn }
|
setCashReceiptSampleOn={ setCashReceiptSampleOn }
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import useIntersectionObserver from '@/widgets/intersection-observer';
|
|||||||
import { TaxInvoiceDetail } from './detail/tax-invoice-detail';
|
import { TaxInvoiceDetail } from './detail/tax-invoice-detail';
|
||||||
import { showAlert } from '@/widgets/show-alert';
|
import { showAlert } from '@/widgets/show-alert';
|
||||||
import { checkGrant } from '@/shared/lib/check-grant';
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
|
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
|
||||||
|
|
||||||
/* 세금계산서 48 */
|
/* 세금계산서 48 */
|
||||||
const menuId = 48;
|
const menuId = 48;
|
||||||
@@ -41,6 +42,7 @@ export const ListWrap = () => {
|
|||||||
const [targetType, setTargetType] = useState<VatReturnTargetType>(VatReturnTargetType.ALL);
|
const [targetType, setTargetType] = useState<VatReturnTargetType>(VatReturnTargetType.ALL);
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||||
|
const [taxInvoiceSampleOn, setTaxInvoiceSampleOn] = useState<boolean>(false);
|
||||||
|
|
||||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||||
const [detailTaxInvoiceNumber, setDetailTaxInvoiceNumber] = useState<string>('');
|
const [detailTaxInvoiceNumber, setDetailTaxInvoiceNumber] = useState<string>('');
|
||||||
@@ -258,6 +260,13 @@ export const ListWrap = () => {
|
|||||||
sendRequest={ onRequestDownloadExcel }
|
sendRequest={ onRequestDownloadExcel }
|
||||||
></DownloadBottomSheet>
|
></DownloadBottomSheet>
|
||||||
}
|
}
|
||||||
|
{ !!taxInvoiceSampleOn &&
|
||||||
|
<TaxInvoiceSample
|
||||||
|
taxInvoiceSampleOn={ taxInvoiceSampleOn }
|
||||||
|
setTaxInvoiceSampleOn={ setTaxInvoiceSampleOn }
|
||||||
|
></TaxInvoiceSample>
|
||||||
|
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -57,6 +57,10 @@ export const API_URL_TRANSACTION = {
|
|||||||
// POST: 현금영수증 거래확인서 다운로드
|
// POST: 현금영수증 거래확인서 다운로드
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/cash-receipt/receipt/download`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/cash-receipt/receipt/download`;
|
||||||
},
|
},
|
||||||
|
cashReceiptExcelDownload: () => {
|
||||||
|
// POST: 현금영수증 엑셀 다운로드
|
||||||
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/cash-receipt/excel/download`;
|
||||||
|
},
|
||||||
|
|
||||||
/* Escro Management - 에스크로 API */
|
/* Escro Management - 에스크로 API */
|
||||||
escrowList: () => {
|
escrowList: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user