Procházet zdrojové kódy

inventory search fix

fix負數倉
CANCERYS\kw093 před 4 dny
rodič
revize
5eab59df8c
4 změnil soubory, kde provedl 13 přidání a 3 odebrání
  1. +3
    -0
      src/app/api/settings/item/index.ts
  2. +1
    -0
      src/app/api/stockAdjustment/actions.ts
  3. +5
    -1
      src/components/InventorySearch/InventoryLotLineTable.tsx
  4. +4
    -2
      src/components/InventorySearch/InventorySearch.tsx

+ 3
- 0
src/app/api/settings/item/index.ts Zobrazit soubor

@@ -66,6 +66,9 @@ export type ItemsResult = {
latestMarketUnitPrice?: number; latestMarketUnitPrice?: number;
latestMupUpdatedDate?: string; latestMupUpdatedDate?: string;
purchaseUnit?: string; purchaseUnit?: string;
uomId?: number;
uom?: string;
uomDesc?: string;
}; };


export type Result = { export type Result = {


+ 1
- 0
src/app/api/stockAdjustment/actions.ts Zobrazit soubor

@@ -16,6 +16,7 @@ export interface StockAdjustmentLineRequest {
expiryDate: string; expiryDate: string;
warehouseId: number; warehouseId: number;
uom?: string | null; uom?: string | null;
uomId?: number | null;
remarks?: string | null; remarks?: string | null;
} }




+ 5
- 1
src/components/InventorySearch/InventoryLotLineTable.tsx Zobrazit soubor

@@ -44,6 +44,7 @@ type AdjustmentEntry = InventoryLotLineResult & {
isNew?: boolean; isNew?: boolean;
isOpeningInventory?: boolean; isOpeningInventory?: boolean;
remarks?: string; remarks?: string;
uomId?: number;
}; };




@@ -61,7 +62,7 @@ interface Props {
onStockAdjustmentSuccess?: () => void | Promise<void>; onStockAdjustmentSuccess?: () => void | Promise<void>;
} }


/** FP-MTMS Version Checklist | Functions Ref. No. 3 | v1.0.8 | 2026-09-10 */
/** FP-MTMS Version Checklist | Functions Ref. No. 3 | v1.0.9 | 2026-09-16 */
const InventoryLotLineTable: React.FC<Props> = ({ const InventoryLotLineTable: React.FC<Props> = ({
inventoryLotLines, pagingController, setPagingController, totalCount, inventory, inventoryLotLines, pagingController, setPagingController, totalCount, inventory,
filterLotNo, filterLotNo,
@@ -157,6 +158,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
adjustedQty: line.availableQty ?? 0, adjustedQty: line.availableQty ?? 0,
originalQty: line.availableQty ?? 0, originalQty: line.availableQty ?? 0,
remarks: '', remarks: '',
uomId: inventory.stockUomId ?? inventory.uomId,
})); }));
setAdjustmentEntries(initial); setAdjustmentEntries(initial);
originalAdjustmentLinesRef.current = initial; originalAdjustmentLinesRef.current = initial;
@@ -276,6 +278,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
expiryDate, expiryDate,
warehouseId: line.warehouse?.id ?? 0, warehouseId: line.warehouse?.id ?? 0,
uom: line.uom ?? null, uom: line.uom ?? null,
uomId: line.uomId ?? null,
remarks: line.remarks?.trim() || null, remarks: line.remarks?.trim() || null,
}; };
}, []); }, []);
@@ -345,6 +348,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
status: 'available', status: 'available',
availableQty: addEntryForm.qty, availableQty: addEntryForm.qty,
uom: inventory.uomUdfudesc || inventory.uomShortDesc || inventory.uomCode, uom: inventory.uomUdfudesc || inventory.uomShortDesc || inventory.uomCode,
uomId: inventory.stockUomId ?? inventory.uomId,
qtyPerSmallestUnit: inventory.qtyPerSmallestUnit ?? 1, qtyPerSmallestUnit: inventory.qtyPerSmallestUnit ?? 1,
baseUom: inventory.baseUom || '', baseUom: inventory.baseUom || '',
stockInLineId: 0, stockInLineId: 0,


+ 4
- 2
src/components/InventorySearch/InventorySearch.tsx Zobrazit soubor

@@ -62,6 +62,7 @@ type ItemLookupRow = {
type?: string; type?: string;
uom?: string; uom?: string;
uomDesc?: string; uomDesc?: string;
uomId?: number;
purchaseUnit?: string; purchaseUnit?: string;
}; };


@@ -83,7 +84,7 @@ const inventoryPageRowKey = (row: InventoryResult, byLocation: boolean) =>
? `${row.itemId}-${row.uomId ?? row.stockUomId ?? row.uomUdfudesc ?? ''}` ? `${row.itemId}-${row.uomId ?? row.stockUomId ?? row.uomUdfudesc ?? ''}`
: String(row.id); : String(row.id);


/** FP-MTMS Version Checklist | Functions Ref. No. 18 | v1.0.4 | 2026-09-10 */
/** FP-MTMS Version Checklist | Functions Ref. No. 18 | v1.0.5 | 2026-09-16 */
const InventorySearch: React.FC<Props> = ({ const InventorySearch: React.FC<Props> = ({
inventories, inventories,
printerCombo, printerCombo,
@@ -108,10 +109,11 @@ const InventorySearch: React.FC<Props> = ({
onHoldQty: 0, onHoldQty: 0,
unavailableQty: 0, unavailableQty: 0,
availableQty: 0, availableQty: 0,
uomId: item.uomId != null ? Number(item.uomId) : undefined,
uomCode: item.uom || uom, uomCode: item.uom || uom,
uomUdfudesc: uom, uomUdfudesc: uom,
uomShortDesc: item.uom || uom, uomShortDesc: item.uom || uom,
stockUomId: undefined,
stockUomId: item.uomId != null ? Number(item.uomId) : undefined,
qtyPerSmallestUnit: 1, qtyPerSmallestUnit: 1,
baseUom: uom, baseUom: uom,
price: 0, price: 0,


Načítá se…
Zrušit
Uložit