Przeglądaj źródła

inventory search fix

fix負數倉
CANCERYS\kw093 4 dni temu
rodzic
commit
5eab59df8c
4 zmienionych plików z 13 dodań i 3 usunięć
  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 Wyświetl plik

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

export type Result = {


+ 1
- 0
src/app/api/stockAdjustment/actions.ts Wyświetl plik

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



+ 5
- 1
src/components/InventorySearch/InventoryLotLineTable.tsx Wyświetl plik

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


@@ -61,7 +62,7 @@ interface Props {
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> = ({
inventoryLotLines, pagingController, setPagingController, totalCount, inventory,
filterLotNo,
@@ -157,6 +158,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
adjustedQty: line.availableQty ?? 0,
originalQty: line.availableQty ?? 0,
remarks: '',
uomId: inventory.stockUomId ?? inventory.uomId,
}));
setAdjustmentEntries(initial);
originalAdjustmentLinesRef.current = initial;
@@ -276,6 +278,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
expiryDate,
warehouseId: line.warehouse?.id ?? 0,
uom: line.uom ?? null,
uomId: line.uomId ?? null,
remarks: line.remarks?.trim() || null,
};
}, []);
@@ -345,6 +348,7 @@ const prevAdjustmentModalOpenRef = useRef(false);
status: 'available',
availableQty: addEntryForm.qty,
uom: inventory.uomUdfudesc || inventory.uomShortDesc || inventory.uomCode,
uomId: inventory.stockUomId ?? inventory.uomId,
qtyPerSmallestUnit: inventory.qtyPerSmallestUnit ?? 1,
baseUom: inventory.baseUom || '',
stockInLineId: 0,


+ 4
- 2
src/components/InventorySearch/InventorySearch.tsx Wyświetl plik

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

@@ -83,7 +84,7 @@ const inventoryPageRowKey = (row: InventoryResult, byLocation: boolean) =>
? `${row.itemId}-${row.uomId ?? row.stockUomId ?? row.uomUdfudesc ?? ''}`
: 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> = ({
inventories,
printerCombo,
@@ -108,10 +109,11 @@ const InventorySearch: React.FC<Props> = ({
onHoldQty: 0,
unavailableQty: 0,
availableQty: 0,
uomId: item.uomId != null ? Number(item.uomId) : undefined,
uomCode: item.uom || uom,
uomUdfudesc: uom,
uomShortDesc: item.uom || uom,
stockUomId: undefined,
stockUomId: item.uomId != null ? Number(item.uomId) : undefined,
qtyPerSmallestUnit: 1,
baseUom: uom,
price: 0,


Ładowanie…
Anuluj
Zapisz