|
|
@@ -57,7 +57,31 @@ type SearchQuery = Partial< |
|
|
type SearchParamNames = keyof SearchQuery; |
|
|
type SearchParamNames = keyof SearchQuery; |
|
|
|
|
|
|
|
|
const InventorySearch: React.FC<Props> = ({ inventories, printerCombo }) => { |
|
|
const InventorySearch: React.FC<Props> = ({ inventories, printerCombo }) => { |
|
|
const { t } = useTranslation(['inventory', 'common', 'item']); |
|
|
|
|
|
|
|
|
const { t, i18n } = useTranslation(['inventory', 'common', 'item']); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
fetch('http://127.0.0.1:7242/ingest/8c332e19-29c4-4171-9317-8619340856a2', { |
|
|
|
|
|
method: 'POST', |
|
|
|
|
|
headers: { |
|
|
|
|
|
'Content-Type': 'application/json', |
|
|
|
|
|
'X-Debug-Session-Id': 'aca475', |
|
|
|
|
|
}, |
|
|
|
|
|
body: JSON.stringify({ |
|
|
|
|
|
sessionId: 'aca475', |
|
|
|
|
|
runId: 'run1', |
|
|
|
|
|
hypothesisId: 'H1', |
|
|
|
|
|
location: 'src/components/InventorySearch/InventorySearch.tsx:63', |
|
|
|
|
|
message: 'Check current stock translation lookup', |
|
|
|
|
|
data: { |
|
|
|
|
|
language: i18n.language, |
|
|
|
|
|
translatedCurrentStock: t('Current Stock'), |
|
|
|
|
|
translatedHardcodedLabel: t('現有庫存'), |
|
|
|
|
|
}, |
|
|
|
|
|
timestamp: Date.now(), |
|
|
|
|
|
}), |
|
|
|
|
|
}).catch(() => {}); |
|
|
|
|
|
}, [i18n.language, t]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Inventory |
|
|
// Inventory |
|
|
const [filteredInventories, setFilteredInventories] = useState<InventoryResult[]>([]); |
|
|
const [filteredInventories, setFilteredInventories] = useState<InventoryResult[]>([]); |
|
|
@@ -407,7 +431,6 @@ const InventorySearch: React.FC<Props> = ({ inventories, printerCombo }) => { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Try to split label into code and name if possible: "CODE - Name" |
|
|
|
|
|
const rawLabel = openingSelectedItem.label ?? ''; |
|
|
const rawLabel = openingSelectedItem.label ?? ''; |
|
|
const [codePart, ...nameParts] = rawLabel.split(' - '); |
|
|
const [codePart, ...nameParts] = rawLabel.split(' - '); |
|
|
const itemCode = codePart?.trim() || rawLabel; |
|
|
const itemCode = codePart?.trim() || rawLabel; |
|
|
@@ -554,7 +577,7 @@ const InventorySearch: React.FC<Props> = ({ inventories, printerCombo }) => { |
|
|
<TableCell>{t('Code')}</TableCell> |
|
|
<TableCell>{t('Code')}</TableCell> |
|
|
<TableCell>{t('Name')}</TableCell> |
|
|
<TableCell>{t('Name')}</TableCell> |
|
|
<TableCell>{t('UoM')}</TableCell> |
|
|
<TableCell>{t('UoM')}</TableCell> |
|
|
<TableCell align="right">{t('現有庫存')}</TableCell> |
|
|
|
|
|
|
|
|
<TableCell align="right">{t('Current Stock')}</TableCell> |
|
|
</TableRow> |
|
|
</TableRow> |
|
|
</TableHead> |
|
|
</TableHead> |
|
|
<TableBody> |
|
|
<TableBody> |
|
|
|