mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat( S&P ): add branch name to details.
This commit is contained in:
@@ -2,6 +2,8 @@ import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { DrawerHeaderContent, DrawerLoading } from 'components';
|
||||
import { useBill, useBillLocatedLandedCost } from 'hooks/query';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
import { Features } from 'common';
|
||||
|
||||
const BillDrawerContext = React.createContext();
|
||||
|
||||
@@ -9,6 +11,9 @@ const BillDrawerContext = React.createContext();
|
||||
* Bill drawer provider.
|
||||
*/
|
||||
function BillDrawerProvider({ billId, ...props }) {
|
||||
// Features guard.
|
||||
const { featureCan } = useFeatureCan();
|
||||
|
||||
// Handle fetch bill details.
|
||||
const { isLoading: isBillLoading, data: bill } = useBill(billId, {
|
||||
enabled: !!billId,
|
||||
@@ -36,6 +41,13 @@ function BillDrawerProvider({ billId, ...props }) {
|
||||
title={intl.get('bill.drawer.title', {
|
||||
number: bill.bill_number ? `(${bill.bill_number})` : null,
|
||||
})}
|
||||
subTitle={
|
||||
featureCan(Features.Branches)
|
||||
? intl.get('bill.drawer.subtitle', {
|
||||
value: bill.branch?.name,
|
||||
})
|
||||
: null
|
||||
}
|
||||
/>
|
||||
<BillDrawerContext.Provider value={provider} {...props} />
|
||||
</DrawerLoading>
|
||||
|
||||
Reference in New Issue
Block a user