mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: item & inventory.
This commit is contained in:
@@ -12,10 +12,14 @@ import {
|
||||
import intl from 'react-intl-universal';
|
||||
import moment from 'moment';
|
||||
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import { FormattedMessage as T, Can } from 'components';
|
||||
import { isNumber } from 'lodash';
|
||||
import { Icon, Money, If } from 'components';
|
||||
import { isBlank, safeCallback } from 'utils';
|
||||
import {
|
||||
InventoryAdjustment,
|
||||
AbilitySubject,
|
||||
} from '../../common/abilityOption';
|
||||
|
||||
/**
|
||||
* Publish accessor
|
||||
@@ -102,20 +106,30 @@ export const ActionsMenu = ({
|
||||
text={intl.get('view_details')}
|
||||
onClick={safeCallback(onViewDetails, original)}
|
||||
/>
|
||||
<MenuDivider />
|
||||
<If condition={!original.is_published}>
|
||||
<MenuItem
|
||||
icon={<Icon icon={'arrow-to-top'} size={16} />}
|
||||
text={intl.get('publish_adjustment')}
|
||||
onClick={safeCallback(onPublish, original)}
|
||||
/>
|
||||
<MenuDivider />
|
||||
<Can
|
||||
I={InventoryAdjustment.Create}
|
||||
a={AbilitySubject.InventoryAdjustment}
|
||||
>
|
||||
<MenuItem
|
||||
icon={<Icon icon={'arrow-to-top'} size={16} />}
|
||||
text={intl.get('publish_adjustment')}
|
||||
onClick={safeCallback(onPublish, original)}
|
||||
/>
|
||||
</Can>
|
||||
</If>
|
||||
<MenuItem
|
||||
text={intl.get('delete_adjustment')}
|
||||
intent={Intent.DANGER}
|
||||
onClick={safeCallback(onDelete, original)}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
/>
|
||||
<Can
|
||||
I={InventoryAdjustment.Delete}
|
||||
a={AbilitySubject.InventoryAdjustment}
|
||||
>
|
||||
<MenuItem
|
||||
text={intl.get('delete_adjustment')}
|
||||
intent={Intent.DANGER}
|
||||
onClick={safeCallback(onDelete, original)}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
/>
|
||||
</Can>
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user