| @@ -49,6 +49,8 @@ export const ApiId = { | |||||
| HT_CUSTOM_RECEIPT_ISSUING_ORDER_CREATE: id++, | HT_CUSTOM_RECEIPT_ISSUING_ORDER_CREATE: id++, | ||||
| HT_CUSTOM_USE_SUMMARIES: id++, | HT_CUSTOM_USE_SUMMARIES: id++, | ||||
| HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV: id++, | HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV: id++, | ||||
| HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER: id++, | |||||
| HT_CUSTOM_DOWNLOAD_RECEIPT_LETTERS: id++, | |||||
| } as const; | } as const; | ||||
| export type ApiId = (typeof ApiId)[keyof typeof ApiId]; | export type ApiId = (typeof ApiId)[keyof typeof ApiId]; | ||||
| @@ -42,6 +42,10 @@ const urls = { | |||||
| "custom/hello-techno/receipt-issuing-order/create", | "custom/hello-techno/receipt-issuing-order/create", | ||||
| [A.HT_CUSTOM_USE_SUMMARIES]: "custom/hello-techno/use-summaries", | [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_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 = { | const prefixs = { | ||||
| @@ -49,6 +53,8 @@ const prefixs = { | |||||
| [A.DOWNLOAD_RECEIPT]: "", | [A.DOWNLOAD_RECEIPT]: "", | ||||
| [A.DOWNLOAD_RECEIPT_LETTER]: "", | [A.DOWNLOAD_RECEIPT_LETTER]: "", | ||||
| [A.HT_CUSTOM_USE_SUMMARY_DOWNLOAD_CSV]: "", | [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"; | const DEFAULT_API_URL_PREFIX = "api"; | ||||
| @@ -188,7 +188,9 @@ export default function ReceiptIssuingOrderDetail() { | |||||
| }, [order]); | }, [order]); | ||||
| const downloadUrl = useMemo(() => { | const downloadUrl = useMemo(() => { | ||||
| return getFullUrl(ApiId.DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id; | |||||
| return ( | |||||
| getFullUrl(ApiId.HT_CUSTOM_DOWNLOAD_RECEIPT_LETTER) + "?id=" + order?.id | |||||
| ); | |||||
| }, [order]); | }, [order]); | ||||
| useEffect(() => { | useEffect(() => { | ||||
| @@ -153,7 +153,20 @@ function SearchBox({ table }: CommonProps) { | |||||
| return data.status_order_mail_datetime !== null; | return data.status_order_mail_datetime !== null; | ||||
| }); | }); | ||||
| if (data) { | 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 ""; | return ""; | ||||
| }, [table.row]); | }, [table.row]); | ||||