mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat(InvoiceForm): remove the entries table footer.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import React from 'react';
|
||||
import { useFormikContext } from 'formik';
|
||||
|
||||
import { BaseCurrency, BaseCurrencyRoot } from 'components';
|
||||
import { useInvoiceFormContext } from './InvoiceFormProvider';
|
||||
|
||||
@@ -6,15 +8,17 @@ import { useInvoiceFormContext } from './InvoiceFormProvider';
|
||||
* Invoice form currency tag.
|
||||
*/
|
||||
export default function InvoiceFormCurrencyTag() {
|
||||
const { isForeignCustomer, selectCustomer } = useInvoiceFormContext();
|
||||
const { isForeignCustomer } = useInvoiceFormContext();
|
||||
const {
|
||||
values: { currency_code },
|
||||
} = useFormikContext();
|
||||
|
||||
if (!isForeignCustomer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<BaseCurrencyRoot>
|
||||
<BaseCurrency currency={selectCustomer?.currency_code} />
|
||||
<BaseCurrency currency={currency_code} />
|
||||
</BaseCurrencyRoot>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { createContext, useState } from 'react';
|
||||
import { isEmpty, pick, isEqual, isUndefined } from 'lodash';
|
||||
import { isEmpty, pick } from 'lodash';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { Features } from 'common';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
@@ -94,9 +94,7 @@ function InvoiceFormProvider({ invoiceId, baseCurrency, ...props }) {
|
||||
const isFeatureLoading = isWarehouesLoading || isBranchesLoading;
|
||||
|
||||
// Determines whether the foreign customer.
|
||||
const isForeignCustomer =
|
||||
!isEqual(selectCustomer?.currency_code, baseCurrency) &&
|
||||
!isUndefined(selectCustomer?.currency_code);
|
||||
const isForeignCustomer = true;
|
||||
|
||||
const provider = {
|
||||
invoice,
|
||||
|
||||
Reference in New Issue
Block a user