mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
Merge branch 'develop' of https://github.com/bigcapitalhq/client into develop
This commit is contained in:
73
src/components/Accounts/AccountMultiSelect.js
Normal file
73
src/components/Accounts/AccountMultiSelect.js
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { MenuItem } from '@blueprintjs/core';
|
||||||
|
import { FMultiSelect } from '../Forms';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { Classes } from '@blueprintjs/popover2';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {*} query
|
||||||
|
* @param {*} account
|
||||||
|
* @param {*} _index
|
||||||
|
* @param {*} exactMatch
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const accountItemPredicate = (query, account, _index, exactMatch) => {
|
||||||
|
const normalizedTitle = account.name.toLowerCase();
|
||||||
|
const normalizedQuery = query.toLowerCase();
|
||||||
|
|
||||||
|
if (exactMatch) {
|
||||||
|
return normalizedTitle === normalizedQuery;
|
||||||
|
} else {
|
||||||
|
return `${account.code}. ${normalizedTitle}`.indexOf(normalizedQuery) >= 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {*} account
|
||||||
|
* @param {*} param1
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const accountItemRenderer = (
|
||||||
|
account,
|
||||||
|
{ handleClick, modifiers, query },
|
||||||
|
{ isSelected },
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
icon={isSelected ? 'tick' : 'blank'}
|
||||||
|
text={account.name}
|
||||||
|
label={account.code}
|
||||||
|
key={account.id}
|
||||||
|
onClick={handleClick}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const accountSelectProps = {
|
||||||
|
itemPredicate: accountItemPredicate,
|
||||||
|
itemRenderer: accountItemRenderer,
|
||||||
|
valueAccessor: (item) => item.id,
|
||||||
|
labelAccessor: (item) => item.code,
|
||||||
|
tagRenderer: (item) => item.name,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* branches mulit select.
|
||||||
|
* @param {*} param0
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
|
export function AccountMultiSelect({ accounts, ...rest }) {
|
||||||
|
return (
|
||||||
|
<FMultiSelect
|
||||||
|
items={accounts}
|
||||||
|
popoverProps={{
|
||||||
|
minimal: true,
|
||||||
|
}}
|
||||||
|
{...accountSelectProps}
|
||||||
|
{...rest}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
1
src/components/Accounts/index.js
Normal file
1
src/components/Accounts/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './AccountMultiSelect';
|
||||||
@@ -104,6 +104,7 @@ export * from './Warehouses';
|
|||||||
export * from './Currencies';
|
export * from './Currencies';
|
||||||
export * from './FormTopbar'
|
export * from './FormTopbar'
|
||||||
export * from './Paper';
|
export * from './Paper';
|
||||||
|
export * from './Accounts'
|
||||||
|
|
||||||
const Hint = FieldHint;
|
const Hint = FieldHint;
|
||||||
|
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ function BillDetailActionsBar({
|
|||||||
onClick={handleQuickBillPayment}
|
onClick={handleQuickBillPayment}
|
||||||
/>
|
/>
|
||||||
</If>
|
</If>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={BillAction.Delete} a={AbilitySubject.Bill}>
|
<Can I={BillAction.Delete} a={AbilitySubject.Bill}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -131,17 +131,17 @@ function CustomerDetailsActionsBar({
|
|||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
<NavbarDivider />
|
|
||||||
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
<Can I={CustomerAction.Edit} a={AbilitySubject.Customer}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon="pen-18" />}
|
icon={<Icon icon="pen-18" />}
|
||||||
text={intl.get('customer.drawer.action.edit')}
|
text={intl.get('customer.drawer.action.edit')}
|
||||||
onClick={handleEditContact}
|
onClick={handleEditContact}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={CustomerAction.Delete} a={AbilitySubject.Customer}>
|
<Can I={CustomerAction.Delete} a={AbilitySubject.Customer}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ function EstimateDetailActionsBar({
|
|||||||
intent={Intent.DANGER}
|
intent={Intent.DANGER}
|
||||||
onClick={handleDeleteEstimate}
|
onClick={handleDeleteEstimate}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={SaleEstimateAction.NotifyBySms} a={AbilitySubject.Estimate}>
|
<Can I={SaleEstimateAction.NotifyBySms} a={AbilitySubject.Estimate}>
|
||||||
|
<NavbarDivider />
|
||||||
<MoreMenuItems
|
<MoreMenuItems
|
||||||
payload={{
|
payload={{
|
||||||
onNotifyViaSMS: handleNotifyViaSMS,
|
onNotifyViaSMS: handleNotifyViaSMS,
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ function ExpenseDrawerActionBar({
|
|||||||
text={<T id={'edit_expense'} />}
|
text={<T id={'edit_expense'} />}
|
||||||
onClick={handleEditExpense}
|
onClick={handleEditExpense}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={ExpenseAction.Delete} a={AbilitySubject.Expense}>
|
<Can I={ExpenseAction.Delete} a={AbilitySubject.Expense}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import intl from 'react-intl-universal';
|
|||||||
import { defaultTo } from 'lodash';
|
import { defaultTo } from 'lodash';
|
||||||
import clsx from 'classnames';
|
import clsx from 'classnames';
|
||||||
|
|
||||||
import { DetailsMenu, DetailItem } from 'components';
|
import { DetailsMenu, DetailItem, FormatDate } from 'components';
|
||||||
import { useInventoryAdjustmentDrawerContext } from './InventoryAdjustmentDrawerProvider';
|
import { useInventoryAdjustmentDrawerContext } from './InventoryAdjustmentDrawerProvider';
|
||||||
|
|
||||||
import InventoryAdjustmentDrawerCls from 'style/components/Drawers/InventoryAdjustmentDrawer.module.scss';
|
import InventoryAdjustmentDrawerCls from 'style/components/Drawers/InventoryAdjustmentDrawer.module.scss';
|
||||||
@@ -20,7 +20,7 @@ export default function InventoryAdjustmentDetailHeader() {
|
|||||||
<div className={clsx(InventoryAdjustmentDrawerCls.detail_panel_header)}>
|
<div className={clsx(InventoryAdjustmentDrawerCls.detail_panel_header)}>
|
||||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||||
<DetailItem label={intl.get('date')}>
|
<DetailItem label={intl.get('date')}>
|
||||||
{moment(inventoryAdjustment.date).format('YYYY MMM DD')}
|
<FormatDate value={inventoryAdjustment.date} />
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={intl.get('type')}>
|
<DetailItem label={intl.get('type')}>
|
||||||
@@ -36,7 +36,7 @@ export default function InventoryAdjustmentDetailHeader() {
|
|||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={intl.get('published_at')}>
|
<DetailItem label={intl.get('published_at')}>
|
||||||
{moment(inventoryAdjustment.published_at).format('YYYY MMM DD')}
|
<FormatDate value={inventoryAdjustment.published_at} />
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={intl.get('reason')}>
|
<DetailItem label={intl.get('reason')}>
|
||||||
@@ -44,7 +44,7 @@ export default function InventoryAdjustmentDetailHeader() {
|
|||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={intl.get('created_at')}>
|
<DetailItem label={intl.get('created_at')}>
|
||||||
{moment(inventoryAdjustment.created_at).format('YYYY MMM DD')}
|
<FormatDate value={inventoryAdjustment.created_at} />
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,10 +55,9 @@ function ItemDetailActionsBar({
|
|||||||
text={<T id={'edit_item'} />}
|
text={<T id={'edit_item'} />}
|
||||||
onClick={handleEditItem}
|
onClick={handleEditItem}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={ItemAction.Delete} a={AbilitySubject.Item}>
|
<Can I={ItemAction.Delete} a={AbilitySubject.Item}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ function ManualJournalDrawerActionBar({
|
|||||||
text={<T id={'edit_journal'} />}
|
text={<T id={'edit_journal'} />}
|
||||||
onClick={handleEditManualJournal}
|
onClick={handleEditManualJournal}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={ManualJournalAction.Delete} a={AbilitySubject.ManualJournal}>
|
<Can I={ManualJournalAction.Delete} a={AbilitySubject.ManualJournal}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ function PaymentMadeDetailActionsBar({
|
|||||||
text={<T id={'edit_payment_made'} />}
|
text={<T id={'edit_payment_made'} />}
|
||||||
onClick={handleEditPaymentMade}
|
onClick={handleEditPaymentMade}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={PaymentMadeAction.Delete} a={AbilitySubject.PaymentMade}>
|
<Can I={PaymentMadeAction.Delete} a={AbilitySubject.PaymentMade}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -95,12 +95,12 @@ function PaymentReceiveActionsBar({
|
|||||||
intent={Intent.DANGER}
|
intent={Intent.DANGER}
|
||||||
onClick={handleDeletePaymentReceive}
|
onClick={handleDeletePaymentReceive}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can
|
<Can
|
||||||
I={PaymentReceiveAction.NotifyBySms}
|
I={PaymentReceiveAction.NotifyBySms}
|
||||||
a={AbilitySubject.PaymentReceive}
|
a={AbilitySubject.PaymentReceive}
|
||||||
>
|
>
|
||||||
|
<NavbarDivider />
|
||||||
<MoreMenuItems
|
<MoreMenuItems
|
||||||
payload={{
|
payload={{
|
||||||
onNotifyViaSMS: handleNotifyViaSMS,
|
onNotifyViaSMS: handleNotifyViaSMS,
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ function ReceiptDetailActionBar({
|
|||||||
intent={Intent.DANGER}
|
intent={Intent.DANGER}
|
||||||
onClick={safeCallback(onDeleteReceipt)}
|
onClick={safeCallback(onDeleteReceipt)}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={SaleReceiptAction.NotifyBySms} a={AbilitySubject.Receipt}>
|
<Can I={SaleReceiptAction.NotifyBySms} a={AbilitySubject.Receipt}>
|
||||||
|
<NavbarDivider />
|
||||||
<MoreMenuItems
|
<MoreMenuItems
|
||||||
payload={{
|
payload={{
|
||||||
onNotifyViaSMS: handleNotifyViaSMS,
|
onNotifyViaSMS: handleNotifyViaSMS,
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ function VendorCreditDetailActionsBar({
|
|||||||
text={<T id={'refund'} />}
|
text={<T id={'refund'} />}
|
||||||
onClick={handleRefundVendorCredit}
|
onClick={handleRefundVendorCredit}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</If>
|
</If>
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={VendorCreditAction.Delete} a={AbilitySubject.VendorCredit}>
|
<Can I={VendorCreditAction.Delete} a={AbilitySubject.VendorCredit}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -102,17 +102,17 @@ function VendorDetailsActionsBar({
|
|||||||
icon={<Icon icon={'plus'} />}
|
icon={<Icon icon={'plus'} />}
|
||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
<NavbarDivider />
|
|
||||||
<Can I={VendorAction.Edit} a={AbilitySubject.Vendor}>
|
<Can I={VendorAction.Edit} a={AbilitySubject.Vendor}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon="pen-18" />}
|
icon={<Icon icon="pen-18" />}
|
||||||
text={<T id={'vendor.drawer.action.edit'} />}
|
text={<T id={'vendor.drawer.action.edit'} />}
|
||||||
onClick={safeCallback(onEditContact)}
|
onClick={safeCallback(onEditContact)}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
|
||||||
</Can>
|
</Can>
|
||||||
<Can I={VendorAction.Delete} a={AbilitySubject.Vendor}>
|
<Can I={VendorAction.Delete} a={AbilitySubject.Vendor}>
|
||||||
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
icon={<Icon icon={'trash-16'} iconSize={16} />}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ function APAgingSummaryHeaderDimensionsProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ function ARAgingSummaryHeaderDimensionsProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ function BalanceSheetHeaderDimensionsProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -10,16 +10,16 @@ const CashFlowStatementDimensionsPanelContext = React.createContext();
|
|||||||
* cash flow statement dimensions panel provider.
|
* cash flow statement dimensions panel provider.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function CashFlowStatementDimensionsPanelProvider({ query,...props }) {
|
function CashFlowStatementDimensionsPanelProvider({ query, ...props }) {
|
||||||
// Features guard.
|
// Features guard.
|
||||||
const { featureCan } = useFeatureCan();
|
const { featureCan } = useFeatureCan();
|
||||||
const isBranchFeatureCan = featureCan(Features.Branches);
|
const isBranchFeatureCan = featureCan(Features.Branches);
|
||||||
|
|
||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
query,
|
enabled: isBranchFeatureCan,
|
||||||
{ enabled: isBranchFeatureCan },
|
keepPreviousData: true,
|
||||||
);
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
const provider = {
|
const provider = {
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ export const useCashFlowStatementColumns = () => {
|
|||||||
* Cash flow statement loading bar.
|
* Cash flow statement loading bar.
|
||||||
*/
|
*/
|
||||||
export function CashFlowStatementLoadingBar() {
|
export function CashFlowStatementLoadingBar() {
|
||||||
const { isCashFlowLoading } = useCashFlowStatementContext();
|
const { isCashFlowFetching } = useCashFlowStatementContext();
|
||||||
return (
|
return (
|
||||||
<If condition={isCashFlowLoading}>
|
<If condition={isCashFlowFetching}>
|
||||||
<FinancialLoadingBar />
|
<FinancialLoadingBar />
|
||||||
</If>
|
</If>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ function GeneralLedgerHeaderDimensionsPanelProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { FormGroup, Classes } from '@blueprintjs/core';
|
|||||||
import { FormattedMessage as T } from 'components';
|
import { FormattedMessage as T } from 'components';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { AccountsMultiSelect, Row, Col } from 'components';
|
import { AccountMultiSelect, Row, Col } from 'components';
|
||||||
|
import { FFormGroup } from '../../../components/Forms';
|
||||||
|
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
@@ -44,12 +45,13 @@ function GLHeaderGeneralPaneContent() {
|
|||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={4}>
|
<Col xs={4}>
|
||||||
<FormGroup
|
<FFormGroup
|
||||||
label={<T id={'specific_accounts'} />}
|
label={<T id={'specific_accounts'} />}
|
||||||
className={classNames('form-group--select-list', Classes.FILL)}
|
name={'accounts'}
|
||||||
|
className={Classes.FILL}
|
||||||
>
|
>
|
||||||
<AccountsMultiSelect items={accounts} />
|
<AccountMultiSelect name="accounts" accounts={accounts} />
|
||||||
</FormGroup>
|
</FFormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export const getDefaultGeneralLedgerQuery = () => {
|
|||||||
basis: 'accural',
|
basis: 'accural',
|
||||||
filterByOption: 'with-transactions',
|
filterByOption: 'with-transactions',
|
||||||
branchesIds: [],
|
branchesIds: [],
|
||||||
|
accounts: [],
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,12 +24,13 @@ function InventoryValuationHeaderDimensionsProvider({ ...props }) {
|
|||||||
// Fetches the warehouses list.
|
// Fetches the warehouses list.
|
||||||
const { data: warehouses, isLoading: isWarehouesLoading } = useWarehouses(
|
const { data: warehouses, isLoading: isWarehouesLoading } = useWarehouses(
|
||||||
null,
|
null,
|
||||||
{ enabled: isWarehouseFeatureCan },
|
{ enabled: isWarehouseFeatureCan, keepPreviousData: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { data: branches, isLoading: isBranchLoading } = useBranches(null, {
|
const { data: branches, isLoading: isBranchLoading } = useBranches(null, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ function ProfitLossSheetProvider({ query, ...props }) {
|
|||||||
isFetching,
|
isFetching,
|
||||||
isLoading,
|
isLoading,
|
||||||
refetch,
|
refetch,
|
||||||
} = useProfitLossSheet({
|
} = useProfitLossSheet(
|
||||||
|
{
|
||||||
...transformFilterFormToQuery(query),
|
...transformFilterFormToQuery(query),
|
||||||
});
|
},
|
||||||
|
{ keepPreviousData: true },
|
||||||
|
);
|
||||||
|
|
||||||
const provider = {
|
const provider = {
|
||||||
profitLossSheet,
|
profitLossSheet,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ function ProfitLossSheetHeaderDimensionsProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ function TrialBLHeaderDimensionsPanelProvider({ query, ...props }) {
|
|||||||
// Fetches the branches list.
|
// Fetches the branches list.
|
||||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||||
enabled: isBranchFeatureCan,
|
enabled: isBranchFeatureCan,
|
||||||
|
keepPreviousData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provider
|
// Provider
|
||||||
|
|||||||
@@ -47,11 +47,6 @@ export default function ItemFormPrimarySection() {
|
|||||||
<div class="mb1">
|
<div class="mb1">
|
||||||
<FormattedHTMLMessage id={'products_you_buy_and_or_sell'} />
|
<FormattedHTMLMessage id={'products_you_buy_and_or_sell'} />
|
||||||
</div>
|
</div>
|
||||||
<div class="mb1">
|
|
||||||
<FormattedHTMLMessage
|
|
||||||
id={'products_you_buy_and_or_sell_but_don_t_need'}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -86,7 +81,6 @@ export default function ItemFormPrimarySection() {
|
|||||||
disabled={!isNewMode && item.type === 'inventory'}
|
disabled={!isNewMode && item.type === 'inventory'}
|
||||||
>
|
>
|
||||||
<Radio label={<T id={'service'} />} value="service" />
|
<Radio label={<T id={'service'} />} value="service" />
|
||||||
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
|
||||||
<Radio label={<T id={'inventory'} />} value="inventory" />
|
<Radio label={<T id={'inventory'} />} value="inventory" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
@@ -126,7 +120,11 @@ export default function ItemFormPrimarySection() {
|
|||||||
helperText={<ErrorMessage name={'code'} />}
|
helperText={<ErrorMessage name={'code'} />}
|
||||||
inline={true}
|
inline={true}
|
||||||
>
|
>
|
||||||
<InputGroup medium={true} intent={inputIntent({ error, touched })} {...field} />
|
<InputGroup
|
||||||
|
medium={true}
|
||||||
|
intent={inputIntent({ error, touched })}
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export const transitionItemTypeKeyToLabel = (itemTypeKey) => {
|
|||||||
const table = {
|
const table = {
|
||||||
service: intl.get('service'),
|
service: intl.get('service'),
|
||||||
inventory: intl.get('inventory'),
|
inventory: intl.get('inventory'),
|
||||||
'non-inventory': intl.get('non_inventory'),
|
|
||||||
};
|
};
|
||||||
return typeof table[itemTypeKey] === 'string' ? table[itemTypeKey] : '';
|
return typeof table[itemTypeKey] === 'string' ? table[itemTypeKey] : '';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user