mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: adjustments.
This commit is contained in:
@@ -75,6 +75,17 @@ function ItemsDataTable({
|
||||
[addItemsTableQueries],
|
||||
);
|
||||
|
||||
const handleMakeAdjustment = useCallback(
|
||||
(item) => () => {
|
||||
openDialog('inventory-adjustment-form', {
|
||||
action: 'make_adjustment',
|
||||
item_id: item.id,
|
||||
quantity_on_hand: item.quantity_on_hand,
|
||||
});
|
||||
},
|
||||
[openDialog],
|
||||
);
|
||||
|
||||
const handleEditItem = useCallback(
|
||||
(item) => () => {
|
||||
onEditItem && onEditItem(item);
|
||||
@@ -89,10 +100,6 @@ function ItemsDataTable({
|
||||
[onDeleteItem],
|
||||
);
|
||||
|
||||
const handleMakeAdjustment = useCallback(() => {
|
||||
openDialog('inventory-adjustment-form', {});
|
||||
}, [openDialog]);
|
||||
|
||||
const actionMenuList = useCallback(
|
||||
(item) => (
|
||||
<Menu>
|
||||
@@ -120,11 +127,11 @@ function ItemsDataTable({
|
||||
onClick={() => onActivateItem(item)}
|
||||
/>
|
||||
</If>
|
||||
|
||||
|
||||
<If condition={item.type === 'inventory'}>
|
||||
<MenuItem
|
||||
text={formatMessage({ id: 'make_adjustment' })}
|
||||
onClick={handleMakeAdjustment}
|
||||
onClick={handleMakeAdjustment(item)}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
|
||||
Reference in New Issue
Block a user