mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
fix: warehouse transfer.
This commit is contained in:
@@ -36,8 +36,8 @@ export const MIN_LINES_NUMBER = 1;
|
|||||||
export const defaultWarehouseTransferEntry = {
|
export const defaultWarehouseTransferEntry = {
|
||||||
index: 0,
|
index: 0,
|
||||||
item_id: '',
|
item_id: '',
|
||||||
source_warehouse: '100',
|
source_warehouse: '',
|
||||||
destination_warehouse: '0',
|
destination_warehouse: '',
|
||||||
description: '',
|
description: '',
|
||||||
quantity: '',
|
quantity: '',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ import React from 'react';
|
|||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { Button, Intent } from '@blueprintjs/core';
|
import { Button, Intent } from '@blueprintjs/core';
|
||||||
import { EmptyStatus } from 'components';
|
import { EmptyStatus } from 'components';
|
||||||
import { Can, FormattedMessage as T } from 'components';
|
import { FormattedMessage as T } from 'components';
|
||||||
|
|
||||||
export default function WarehouseTransfersEmptyStatus() {
|
export default function WarehouseTransfersEmptyStatus() {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EmptyStatus
|
<EmptyStatus
|
||||||
title={<T id={'the_organization_doesn_t_receive_money_yet'} />}
|
title={<T id={'warehouse_transfer.empty_status.title'} />}
|
||||||
description={<p></p>}
|
description={
|
||||||
|
<p>
|
||||||
|
<T id={'warehouse_transfer.empty_status.description'} />
|
||||||
|
</p>
|
||||||
|
}
|
||||||
action={
|
action={
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -25,28 +25,18 @@ function WarehouseTransfersListProvider({
|
|||||||
// warehouse transfers refresh action.
|
// warehouse transfers refresh action.
|
||||||
const { refresh } = useRefreshWarehouseTransfers();
|
const { refresh } = useRefreshWarehouseTransfers();
|
||||||
|
|
||||||
// Features guard.
|
|
||||||
const { featureCan } = useFeatureCan();
|
|
||||||
|
|
||||||
const isWarehouseFeatureCan = featureCan(Features.Warehouses);
|
|
||||||
|
|
||||||
// Fetch warehouse transfers list according to the given custom view id.
|
// Fetch warehouse transfers list according to the given custom view id.
|
||||||
const {
|
const {
|
||||||
data: { warehousesTransfers, pagination, filterMeta },
|
data: { warehousesTransfers, pagination, filterMeta },
|
||||||
isFetching: isWarehouseTransfersFetching,
|
isFetching: isWarehouseTransfersFetching,
|
||||||
isLoading: isWarehouseTransfersLoading,
|
isLoading: isWarehouseTransfersLoading,
|
||||||
} = useWarehousesTransfers(
|
} = useWarehousesTransfers(query, { keepPreviousData: true });
|
||||||
query,
|
|
||||||
// { keepPreviousData: true },
|
|
||||||
{ enabled: isWarehouseFeatureCan },
|
|
||||||
);
|
|
||||||
|
|
||||||
// Detarmines the datatable empty status.
|
// Detarmines the datatable empty status.
|
||||||
const isEmptyStatus =
|
const isEmptyStatus =
|
||||||
(isEmpty(warehousesTransfers) &&
|
isEmpty(warehousesTransfers) &&
|
||||||
!tableStateChanged &&
|
!tableStateChanged &&
|
||||||
!isWarehouseTransfersLoading) ||
|
!isWarehouseTransfersLoading;
|
||||||
!isWarehouseFeatureCan;
|
|
||||||
|
|
||||||
// Fetch create notes resource views and fields.
|
// Fetch create notes resource views and fields.
|
||||||
const { data: WarehouseTransferView, isLoading: isViewsLoading } =
|
const { data: WarehouseTransferView, isLoading: isViewsLoading } =
|
||||||
|
|||||||
@@ -1,24 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import { Intent, Tag, Menu, MenuItem, MenuDivider } from '@blueprintjs/core';
|
||||||
Intent,
|
|
||||||
Tag,
|
|
||||||
Menu,
|
|
||||||
MenuItem,
|
|
||||||
MenuDivider,
|
|
||||||
ProgressBar,
|
|
||||||
} from '@blueprintjs/core';
|
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import clsx from 'classnames';
|
|
||||||
import { CLASSES } from '../../../common/classes';
|
|
||||||
import { safeCallback } from 'utils';
|
import { safeCallback } from 'utils';
|
||||||
import {
|
import {
|
||||||
FormatDateCell,
|
FormatDateCell,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
AppToaster,
|
|
||||||
Choose,
|
Choose,
|
||||||
If,
|
If,
|
||||||
Icon,
|
Icon,
|
||||||
Can,
|
|
||||||
} from 'components';
|
} from 'components';
|
||||||
|
|
||||||
export function ActionsMenu({
|
export function ActionsMenu({
|
||||||
@@ -146,14 +136,6 @@ export function useWarehouseTransfersTableColumns() {
|
|||||||
className: 'status',
|
className: 'status',
|
||||||
clickable: true,
|
clickable: true,
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: 'created_at',
|
|
||||||
// Header: intl.get('created_at'),
|
|
||||||
// accessor: 'created_at',
|
|
||||||
// Cell: FormatDateCell,
|
|
||||||
// width: 120,
|
|
||||||
// clickable: true,
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user