refactor(FE): Rename available_qty to transfer_available_qty

This commit is contained in:
rstubryan
2026-03-16 10:51:02 +07:00
parent 375de4c86c
commit b020f2b187
2 changed files with 9 additions and 5 deletions
@@ -82,7 +82,7 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
warehouse_id: number; warehouse_id: number;
warehouse_name: string; warehouse_name: string;
quantity: number; quantity: number;
available_qty?: number; transfer_available_qty?: number;
} }
// ===== USE SELECT HOOKS ===== // ===== USE SELECT HOOKS =====
@@ -394,7 +394,7 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
warehouse_id: pw.warehouse.id, warehouse_id: pw.warehouse.id,
warehouse_name: pw.warehouse.name, warehouse_name: pw.warehouse.name,
quantity: pw.quantity, quantity: pw.quantity,
available_qty: pw.available_qty, transfer_available_qty: pw.transfer_available_qty,
})) }))
: []; : [];
}, [productWarehouses]); }, [productWarehouses]);
@@ -844,7 +844,11 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
(pw) => pw.product_id === productId (pw) => pw.product_id === productId
); );
return productWarehouse?.available_qty ?? productWarehouse?.quantity ?? 0; return (
productWarehouse?.transfer_available_qty ??
productWarehouse?.quantity ??
0
);
}, },
[productWarehouseOptions, type] [productWarehouseOptions, type]
); );
@@ -865,7 +869,7 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
const productWarehouse = productWarehouseOptions.find( const productWarehouse = productWarehouseOptions.find(
(pw) => pw.product_id === productId (pw) => pw.product_id === productId
); );
return productWarehouse?.available_qty !== undefined; return productWarehouse?.transfer_available_qty !== undefined;
}, },
[productWarehouseOptions] [productWarehouseOptions]
); );
+1 -1
View File
@@ -9,7 +9,7 @@ export type BaseProductWarehouse = {
warehouse_id: number; warehouse_id: number;
uom: Uom; uom: Uom;
quantity: number; quantity: number;
available_qty?: number; transfer_available_qty?: number;
product: Product; product: Product;
warehouse: Warehouse; warehouse: Warehouse;
project_flock_kandang?: { project_flock_kandang?: {