mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat : inventory adjustments.
This commit is contained in:
@@ -27,6 +27,7 @@ import { CLASSES } from 'common/classes';
|
||||
import withItems from 'containers/Items/withItems';
|
||||
import withItemsActions from 'containers/Items/withItemsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import { compose, saveInvoke, isBlank, defaultToTransform } from 'utils';
|
||||
|
||||
// Items datatable.
|
||||
@@ -38,6 +39,9 @@ function ItemsDataTable({
|
||||
itemsCurrentViewId,
|
||||
itemsPagination,
|
||||
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
|
||||
// #withItemsActions
|
||||
addItemsTableQueries,
|
||||
|
||||
@@ -84,6 +88,11 @@ function ItemsDataTable({
|
||||
},
|
||||
[onDeleteItem],
|
||||
);
|
||||
|
||||
const handleMakeAdjustment = useCallback(() => {
|
||||
openDialog('inventory-adjustment-form', {});
|
||||
}, [openDialog]);
|
||||
|
||||
const actionMenuList = useCallback(
|
||||
(item) => (
|
||||
<Menu>
|
||||
@@ -111,6 +120,13 @@ function ItemsDataTable({
|
||||
onClick={() => onActivateItem(item)}
|
||||
/>
|
||||
</If>
|
||||
|
||||
<If condition={item.type === 'inventory'}>
|
||||
<MenuItem
|
||||
text={formatMessage({ id: 'make_adjustment' })}
|
||||
onClick={handleMakeAdjustment}
|
||||
/>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={formatMessage({ id: 'delete_item' })}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
@@ -300,4 +316,5 @@ export default compose(
|
||||
baseCurrency: organizationSettings?.baseCurrency,
|
||||
})),
|
||||
withItemsActions,
|
||||
withDialogActions,
|
||||
)(ItemsDataTable);
|
||||
|
||||
Reference in New Issue
Block a user