diff --git a/src/api/index.ts b/src/api/index.ts index e15e188..b4cfcb5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -49,6 +49,8 @@ export const ApiId = { HT_CUSTOM_RECEIPT_ISSUING_ORDER_CREATE: id++, HT_CUSTOM_USE_SUMMARIES: id++, HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV: id++, + HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER: id++, + HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS: id++, } as const; export type ApiId = (typeof ApiId)[keyof typeof ApiId]; diff --git a/src/api/url.ts b/src/api/url.ts index 3218c24..0a31d33 100644 --- a/src/api/url.ts +++ b/src/api/url.ts @@ -42,6 +42,10 @@ const urls = { "custom/hello-techno/receipt-issuing-order/create", [A.HT_CUSTOM_USE_SUMMARIES]: "custom/hello-techno/use-summaries", [A.HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV]: "custom/hello-techno/use-summary/csv", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER]: + "custom/hello-techno/receipt-letter/download", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS]: + "custom/hello-techno/receipt-letters/download", }; const prefixs = { @@ -49,6 +53,8 @@ const prefixs = { [A.DOWNLOAD_RECEIPT]: "", [A.DOWNLOAD_RECEIPT_LETTER]: "", [A.HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV]: "", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER]: "", + [A.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS]: "", }; const DEFAULT_API_URL_PREFIX = "api"; diff --git a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx index 3a2dc15..5178bd6 100644 --- a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx +++ b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/detail.tsx @@ -188,7 +188,9 @@ export default function ReceiptIssuingOrderDetail() { }, [order]); const downloadUrl = useMemo(() => { - return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id; + return ( + getFullUrl(ApiId.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id + ); }, [order]); useEffect(() => { diff --git a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx index b9b30ab..60b2840 100644 --- a/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx +++ b/src/pages/dashboard/receipt-issuing-order/custom/hello-techno/list.tsx @@ -153,7 +153,20 @@ function SearchBox({ table }: CommonProps) { return data.status_order_mail_datetime !== null; }); if (data) { - return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + data.id; + const f = form.getValues(); + return ( + getFullUrl(ApiId.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS) + + "?" + + new URLSearchParams({ + ...f, + order_date_from: f.order_date_from + ? f.order_date_from.toISOString() + : "", + order_date_to: f.order_date_to ? f.order_date_to.toISOString() : "", + include_done: f.include_done ? "1" : "0", + done: f.include_done ? "1" : "0", + }) + ); } return ""; }, [table.row]);