[Fix] "All" btn now downloads from all 3 categories instead of just the one currently selectedundefined
| @@ -68,7 +68,7 @@ export interface SearchStockIssueRecordParams { | |||||
| pageSize?: number; | pageSize?: number; | ||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */ | |||||
| export const fetchExpiryItemList = cache(async (filters?: ExpiryItemFilter) => { | export const fetchExpiryItemList = cache(async (filters?: ExpiryItemFilter) => { | ||||
| const params = new URLSearchParams(); | const params = new URLSearchParams(); | ||||
| if (filters?.itemCode) params.set("itemCode", filters.itemCode); | if (filters?.itemCode) params.set("itemCode", filters.itemCode); | ||||
| @@ -12,9 +12,9 @@ export interface ExportExpiryItemExcelParams extends ExpiryItemFilter { | |||||
| } | } | ||||
| /** | /** | ||||
| * FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 | |||||
| * GET /pickExecution/issues/expiryItem/excel | * GET /pickExecution/issues/expiryItem/excel | ||||
| * Query: itemCode, itemName, lotNo, daysAhead, bucket (expired|today|upcoming) | |||||
| * Query: itemCode, itemName, lotNo, daysAhead, bucket (expired|today|upcoming; omit for all categories) | |||||
| * Response: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | * Response: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | ||||
| * Optional Content-Disposition filename. | * Optional Content-Disposition filename. | ||||
| */ | */ | ||||
| @@ -105,7 +105,7 @@ function canHandleExpiryItem(item: ExpiryItemResult): boolean { | |||||
| return d != null && !d.isAfter(dayjs(), "day"); | return d != null && !d.isAfter(dayjs(), "day"); | ||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */ | |||||
| const ExpiryHandleTab: React.FC = () => { | const ExpiryHandleTab: React.FC = () => { | ||||
| const BATCH_CHUNK_SIZE = 20; | const BATCH_CHUNK_SIZE = 20; | ||||
| const { t } = useTranslation("stockIssue"); | const { t } = useTranslation("stockIssue"); | ||||
| @@ -316,7 +316,7 @@ const ExpiryHandleTab: React.FC = () => { | |||||
| const handleExportExcel = useCallback( | const handleExportExcel = useCallback( | ||||
| async (mode: "filtered" | "all") => { | async (mode: "filtered" | "all") => { | ||||
| if (mode === "filtered" && !hasSearched) return; | |||||
| if (!hasSearched) return; | |||||
| if (exportInFlightRef.current) return; | if (exportInFlightRef.current) return; | ||||
| exportInFlightRef.current = true; | exportInFlightRef.current = true; | ||||
| setExporting(mode); | setExporting(mode); | ||||
| @@ -325,7 +325,6 @@ const ExpiryHandleTab: React.FC = () => { | |||||
| mode === "all" | mode === "all" | ||||
| ? { | ? { | ||||
| daysAhead, | daysAhead, | ||||
| bucket: resultTab, | |||||
| } | } | ||||
| : { | : { | ||||
| ...lastFilters, | ...lastFilters, | ||||
| @@ -381,7 +380,7 @@ const ExpiryHandleTab: React.FC = () => { | |||||
| variant="outlined" | variant="outlined" | ||||
| startIcon={<FileDownload />} | startIcon={<FileDownload />} | ||||
| onClick={() => handleExportExcel("all")} | onClick={() => handleExportExcel("all")} | ||||
| disabled={exporting != null} | |||||
| disabled={!hasSearched || exporting != null} | |||||
| > | > | ||||
| {exporting === "all" ? t("Exporting...") : t("Export all in tab")} | {exporting === "all" ? t("Exporting...") : t("Export all in tab")} | ||||
| </Button> | </Button> | ||||
| @@ -31,7 +31,7 @@ interface Props { | |||||
| kind: RecordKind; | kind: RecordKind; | ||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */ | |||||
| const StockIssueRecordTab: React.FC<Props> = ({ kind }) => { | const StockIssueRecordTab: React.FC<Props> = ({ kind }) => { | ||||
| const { t } = useTranslation("stockIssue"); | const { t } = useTranslation("stockIssue"); | ||||
| const [items, setItems] = useState<StockIssueHandleRecord[]>([]); | const [items, setItems] = useState<StockIssueHandleRecord[]>([]); | ||||
| @@ -49,7 +49,7 @@ interface Props<K extends string> { | |||||
| disabled?: boolean; | disabled?: boolean; | ||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.1 | 2026-09-07 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 74 | v1.0.2 | 2026-09-07 */ | |||||
| function StockIssueSearchPanel<K extends string>({ | function StockIssueSearchPanel<K extends string>({ | ||||
| fields, | fields, | ||||
| onSearch, | onSearch, | ||||