| @@ -150,7 +150,7 @@ const SearchPage: React.FC<Props> = ({ dataList }) => { | |||||
| { name: "itemDescription", label: t("Item") }, | { name: "itemDescription", label: t("Item") }, | ||||
| { name: "lotNo", label: t("Lot No.") }, | { name: "lotNo", label: t("Lot No.") }, | ||||
| { name: "storeLocation", label: t("Location") }, | { name: "storeLocation", label: t("Location") }, | ||||
| { name: "missQty", label: t("Miss Qty") }, | |||||
| { name: "issueQty", label: t("Miss Qty") }, | |||||
| { | { | ||||
| name: "id", | name: "id", | ||||
| label: t("Action"), | label: t("Action"), | ||||
| @@ -176,7 +176,7 @@ const SearchPage: React.FC<Props> = ({ dataList }) => { | |||||
| { name: "itemDescription", label: t("Item") }, | { name: "itemDescription", label: t("Item") }, | ||||
| { name: "lotNo", label: t("Lot No.") }, | { name: "lotNo", label: t("Lot No.") }, | ||||
| { name: "storeLocation", label: t("Location") }, | { name: "storeLocation", label: t("Location") }, | ||||
| { name: "badItemQty", label: t("Defective Qty") }, | |||||
| { name: "issueQty", label: t("Defective Qty") }, | |||||
| { | { | ||||
| name: "id", | name: "id", | ||||
| label: t("Action"), | label: t("Action"), | ||||
| @@ -77,16 +77,10 @@ const SearchPage: React.FC<Props> = ({ dataList: initialDataList }) => { | |||||
| sorted.forEach((item) => { | sorted.forEach((item) => { | ||||
| const currentBalance = balanceMap.get(item.itemId) || 0; | const currentBalance = balanceMap.get(item.itemId) || 0; | ||||
| let newBalance = currentBalance; | |||||
| // 根据类型计算余额 | |||||
| if (item.transactionType === "IN") { | |||||
| newBalance = currentBalance + item.qty; | |||||
| } else if (item.transactionType === "OUT") { | |||||
| newBalance = currentBalance - item.qty; | |||||
| } | |||||
| balanceMap.set(item.itemId, newBalance); | |||||
| // 格式化日期 - 优先使用 date 字段 | // 格式化日期 - 优先使用 date 字段 | ||||
| let formattedDate = ""; | let formattedDate = ""; | ||||
| @@ -128,7 +122,7 @@ const SearchPage: React.FC<Props> = ({ dataList: initialDataList }) => { | |||||
| formattedDate, | formattedDate, | ||||
| inQty: item.transactionType === "IN" ? item.qty : 0, | inQty: item.transactionType === "IN" ? item.qty : 0, | ||||
| outQty: item.transactionType === "OUT" ? item.qty : 0, | outQty: item.transactionType === "OUT" ? item.qty : 0, | ||||
| balanceQty: item.balanceQty ? item.balanceQty : newBalance, | |||||
| balanceQty: item.balanceQty ?? 0, | |||||
| }); | }); | ||||
| }); | }); | ||||