feat(InvoiceForm): remove the entries table footer.

This commit is contained in:
a.bouhuolia
2022-03-19 23:15:37 +02:00
parent ad149c1b18
commit 69c47aee4d
3 changed files with 29 additions and 64 deletions

View File

@@ -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>
);
}

View File

@@ -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,