mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: notes.
This commit is contained in:
@@ -3,11 +3,12 @@ import { Tab } from '@blueprintjs/core';
|
||||
import intl from 'react-intl-universal';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Can, DrawerMainTabs } from 'components';
|
||||
import { DrawerMainTabs } from 'components';
|
||||
import {
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../common/abilityOption';
|
||||
import { useAbilityContext } from 'hooks/utils';
|
||||
import BillDetailTab from './BillDetailTab';
|
||||
import LocatedLandedCostTable from './LocatedLandedCostTable';
|
||||
import BillGLEntriesTable from './BillGLEntriesTable';
|
||||
@@ -18,6 +19,8 @@ import BillDetailActionsBar from './BillDetailActionsBar';
|
||||
* Bill details tabs.
|
||||
*/
|
||||
function BillDetailsTabs() {
|
||||
const ability = useAbilityContext();
|
||||
|
||||
return (
|
||||
<DrawerMainTabs
|
||||
renderActiveTabPanelOnly={true}
|
||||
@@ -33,13 +36,13 @@ function BillDetailsTabs() {
|
||||
id={'journal_entries'}
|
||||
panel={<BillGLEntriesTable />}
|
||||
/>
|
||||
{/* <Can I={PaymentMadeAction.View} a={AbilitySubject.PaymentMade}> */}
|
||||
{ability.can(PaymentMadeAction.View, AbilitySubject.PaymentMade) && (
|
||||
<Tab
|
||||
title={intl.get('payment_transactions')}
|
||||
id={'payment_transactions'}
|
||||
panel={<BillPaymentTransactionTable />}
|
||||
/>
|
||||
{/* </Can> */}
|
||||
)}
|
||||
<Tab
|
||||
title={intl.get('located_landed_cost')}
|
||||
id={'landed_cost'}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { MenuItem, Intent } from '@blueprintjs/core';
|
||||
|
||||
import { TextStatus, Icon, Choose, T } from 'components';
|
||||
@@ -110,7 +111,7 @@ const transformVendorCreditsToSearch = (vendorCredit) => ({
|
||||
*/
|
||||
export const universalSearchVendorCreditBind = () => ({
|
||||
resourceType: RESOURCES_TYPES.VENDOR_CREDIT,
|
||||
optionItemLabel: 'Vendor credits',
|
||||
optionItemLabel: intl.get('vendor_credit.label'),
|
||||
selectItemAction: VendorCreditUniversalSearchSelect,
|
||||
itemRenderer: VendorCreditUniversalSearchItem,
|
||||
itemSelect: transformVendorCreditsToSearch,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { MenuItem, Intent } from '@blueprintjs/core';
|
||||
|
||||
import { Icon, Choose, T, TextStatus } from 'components';
|
||||
@@ -108,7 +109,7 @@ const transformReceiptsToSearch = (creditNote) => ({
|
||||
*/
|
||||
export const universalSearchCreditNoteBind = () => ({
|
||||
resourceType: RESOURCES_TYPES.CREDIT_NOTE,
|
||||
optionItemLabel: 'Credit notes',
|
||||
optionItemLabel: intl.get('credit_note.label'),
|
||||
selectItemAction: CreditNoteUniversalSearchSelect,
|
||||
itemRenderer: CreditNoteUniversalSearchItem,
|
||||
itemSelect: transformReceiptsToSearch,
|
||||
|
||||
Reference in New Issue
Block a user