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