diff --git a/src/containers/Purchases/Bills/BillForm/BillFormFooterLeft.js b/src/containers/Purchases/Bills/BillForm/BillFormFooterLeft.js
index fb827ead2..e7d41510f 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormFooterLeft.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormFooterLeft.js
@@ -1,4 +1,5 @@
import React from 'react';
+import intl from 'react-intl-universal';
import styled from 'styled-components';
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
@@ -6,12 +7,13 @@ export function BillFormFooterLeft() {
return (
{/* --------- note --------- */}
- } name={'note'}>
+ }
+ name={'note'}
+ >
diff --git a/src/containers/Purchases/Bills/BillForm/BillFormFooterRight.js b/src/containers/Purchases/Bills/BillForm/BillFormFooterRight.js
index 05ae8719f..fab6c5646 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormFooterRight.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormFooterRight.js
@@ -21,23 +21,23 @@ export function BillFormFooterRight() {
return (
}
+ title={}
value={formattedSubtotal}
borderStyle={TotalLineBorderStyle.None}
/>
}
+ title={}
value={formattedTotal}
borderStyle={TotalLineBorderStyle.SingleDark}
textStyle={TotalLineTextStyle.Bold}
/>
}
+ title={}
value={formattedPaymentTotal}
borderStyle={TotalLineBorderStyle.None}
/>
}
+ title={}
value={formattedDueTotal}
textStyle={TotalLineTextStyle.Bold}
/>
diff --git a/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.js b/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.js
index 5d6db0a98..f2ef0f2d3 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.js
@@ -59,19 +59,18 @@ function BillFormHeader() {
)}
labelInfo={}
>
-
- }
- onContactSelected={(contact) => {
- form.setFieldValue('vendor_id', contact.id);
- form.setFieldValue('currency_code', contact?.currency_code);
- }}
- popoverFill={true}
- allowCreate={true}
- />
-
+ }
+ onContactSelected={(contact) => {
+ form.setFieldValue('vendor_id', contact.id);
+ form.setFieldValue('currency_code', contact?.currency_code);
+ }}
+ popoverFill={true}
+ allowCreate={true}
+ />
+
{value && (
@@ -175,12 +174,6 @@ function BillFormHeader() {
export default compose(withDialogActions)(BillFormHeader);
-const ControlVendorGroup = styled(ControlGroup)`
- display: flex;
- align-items: center;
- transform: none;
-`;
-
const VendorButtonLink = styled(VendorDrawerLink)`
font-size: 11px;
margin-top: 6px;
diff --git a/src/containers/Purchases/Bills/BillForm/BillFormPage.js b/src/containers/Purchases/Bills/BillForm/BillFormPage.js
index a67881ffe..a711b86d4 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormPage.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormPage.js
@@ -4,22 +4,15 @@ import { useParams } from 'react-router-dom';
import BillForm from './BillForm';
import { BillFormProvider } from './BillFormProvider';
-import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
-import { compose } from 'utils';
-
import 'style/pages/Bills/PageForm.scss';
-function BillFormPage({
- // #withCurrentOrganization
- organization: { base_currency },
-}) {
+export default function BillFormPage() {
const { id } = useParams();
const billId = parseInt(id, 10);
return (
-
+
);
}
-export default compose(withCurrentOrganization())(BillFormPage);
diff --git a/src/containers/Purchases/Bills/BillForm/BillFormProvider.js b/src/containers/Purchases/Bills/BillForm/BillFormProvider.js
index f6c74d663..2705784e3 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormProvider.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormProvider.js
@@ -38,7 +38,7 @@ const stringifiedFilterRoles = JSON.stringify([
/**
* Bill form provider.
*/
-function BillFormProvider({ billId, baseCurrency, ...props }) {
+function BillFormProvider({ billId, ...props }) {
// Features guard.
const { featureCan } = useFeatureCan();
const isWarehouseFeatureCan = featureCan(Features.Warehouses);
@@ -86,7 +86,6 @@ function BillFormProvider({ billId, baseCurrency, ...props }) {
// Form submit payload.
const [submitPayload, setSubmitPayload] = useState({});
- const [selectVendor, setSelectVendor] = React.useState(null);
// Create and edit bills mutations.
const { mutateAsync: createBillMutate } = useCreateBill();
@@ -97,11 +96,6 @@ function BillFormProvider({ billId, baseCurrency, ...props }) {
// Determines whether the warehouse and branches are loading.
const isFeatureLoading = isWarehouesLoading || isBranchesLoading;
- // Determines whether the foreign vendor.
- const isForeignVendor =
- !isEqual(selectVendor?.currency_code, baseCurrency) &&
- !isUndefined(selectVendor?.currency_code);
-
const provider = {
accounts,
vendors,
@@ -109,9 +103,6 @@ function BillFormProvider({ billId, baseCurrency, ...props }) {
bill,
warehouses,
branches,
- baseCurrency,
- selectVendor,
- setSelectVendor,
submitPayload,
isNewMode,
@@ -123,7 +114,6 @@ function BillFormProvider({ billId, baseCurrency, ...props }) {
isFeatureLoading,
isBranchesSuccess,
isWarehousesSuccess,
- isForeignVendor,
createBillMutate,
editBillMutate,
diff --git a/src/containers/Purchases/Bills/BillForm/BillFormTopBar.js b/src/containers/Purchases/Bills/BillForm/BillFormTopBar.js
index ba5b673c2..e91dcf8d9 100644
--- a/src/containers/Purchases/Bills/BillForm/BillFormTopBar.js
+++ b/src/containers/Purchases/Bills/BillForm/BillFormTopBar.js
@@ -94,7 +94,7 @@ function BillFormSelectWarehouse() {
function BillWarehouseSelectButton({ label }) {
return (
}
@@ -105,7 +105,7 @@ function BillWarehouseSelectButton({ label }) {
function BillBranchSelectButton({ label }) {
return (
}
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterLeft.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterLeft.js
index 835900052..3d4912799 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterLeft.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterLeft.js
@@ -1,4 +1,5 @@
import React from 'react';
+import intl from 'react-intl-universal';
import styled from 'styled-components';
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
@@ -6,12 +7,13 @@ export function VendorCreditNoteFormFooterLeft() {
return (
{/* --------- Terms and conditions --------- */}
- } name={'note'}>
+ }
+ name={'note'}
+ >
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterRight.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterRight.js
index 47dedf41b..a7ebc5ca6 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterRight.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormFooterRight.js
@@ -18,14 +18,13 @@ export function VendorCreditNoteFormFooterRight() {
amountColWidth={'180px'}
>
}
+ title={}
value={formattedSubtotal}
borderStyle={TotalLineBorderStyle.None}
/>
}
+ title={}
value={formattedTotal}
- // borderStyle={TotalLineBorderStyle.SingleDark}
textStyle={TotalLineTextStyle.Bold}
/>
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormHeaderFields.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormHeaderFields.js
index f48775749..cfc441900 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormHeaderFields.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormHeaderFields.js
@@ -93,19 +93,18 @@ function VendorCreditNoteFormHeaderFields({
className={classNames(CLASSES.FILL, 'form-group--vendor')}
labelInfo={}
>
-
- }
- onContactSelected={(contact) => {
- form.setFieldValue('vendor_id', contact.id);
- form.setFieldValue('currency_code', contact?.currency_code);
- }}
- popoverFill={true}
- allowCreate={true}
- />
-
+ }
+ onContactSelected={(contact) => {
+ form.setFieldValue('vendor_id', contact.id);
+ form.setFieldValue('currency_code', contact?.currency_code);
+ }}
+ popoverFill={true}
+ allowCreate={true}
+ />
+
{value && (
@@ -214,12 +213,6 @@ export default compose(
})),
)(VendorCreditNoteFormHeaderFields);
-const ControlVendorGroup = styled(ControlGroup)`
- display: flex;
- align-items: center;
- transform: none;
-`;
-
const VendorButtonLink = styled(VendorDrawerLink)`
font-size: 11px;
margin-top: 6px;
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormPage.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormPage.js
index 57dcdfe6e..31a4c3e3e 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormPage.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormPage.js
@@ -6,26 +6,16 @@ import '../../../../style/pages/VendorsCreditNote/PageForm.scss';
import VendorCreditNoteForm from './VendorCreditNoteForm';
import { VendorCreditNoteFormProvider } from './VendorCreditNoteFormProvider';
-import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
-import { compose } from 'utils';
-
/**
* Vendor Credit note form pages.
*/
-function VendorCreditNoteFormPage({
- // #withCurrentOrganization
- organization: { base_currency },
-}) {
+export default function VendorCreditNoteFormPage() {
const { id } = useParams();
const idAsInteger = parseInt(id, 10);
return (
-
+
);
}
-export default compose(withCurrentOrganization())(VendorCreditNoteFormPage);
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormProvider.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormProvider.js
index 10c27045f..5e871387f 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormProvider.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import { useLocation } from 'react-router-dom';
-import { isEmpty, pick, isEqual, isUndefined } from 'lodash';
+import { isEmpty, pick } from 'lodash';
import DashboardInsider from 'components/Dashboard/DashboardInsider';
import { transformToEditForm } from './utils';
import { Features } from 'common';
@@ -22,11 +22,7 @@ const VendorCreditNoteFormContext = React.createContext();
/**
* Vendor Credit note data provider.
*/
-function VendorCreditNoteFormProvider({
- vendorCreditId,
- baseCurrency,
- ...props
-}) {
+function VendorCreditNoteFormProvider({ vendorCreditId, ...props }) {
const { state } = useLocation();
const billId = state?.billId;
@@ -79,7 +75,6 @@ function VendorCreditNoteFormProvider({
// Form submit payload.
const [submitPayload, setSubmitPayload] = React.useState();
- const [selectVendor, setSelectVendor] = React.useState(null);
// Create and edit vendor credit mutations.
const { mutateAsync: createVendorCreditMutate } = useCreateVendorCredit();
@@ -91,11 +86,6 @@ function VendorCreditNoteFormProvider({
// Determines whether the warehouse and branches are loading.
const isFeatureLoading = isWarehouesLoading || isBranchesLoading;
- // Determines whether the foreign vendor.
- const isForeignVendor =
- !isEqual(selectVendor?.currency_code, baseCurrency) &&
- !isUndefined(selectVendor?.currency_code);
-
const newVendorCredit = !isEmpty(bill)
? transformToEditForm({
...pick(bill, ['vendor_id', 'currency_code', 'entries']),
@@ -109,9 +99,6 @@ function VendorCreditNoteFormProvider({
vendorCredit,
warehouses,
branches,
- baseCurrency,
- selectVendor,
- setSelectVendor,
submitPayload,
isNewMode,
newVendorCredit,
@@ -120,7 +107,6 @@ function VendorCreditNoteFormProvider({
isFeatureLoading,
isBranchesSuccess,
isWarehousesSuccess,
- isForeignVendor,
createVendorCreditMutate,
editVendorCreditMutate,
diff --git a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormTopBar.js b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormTopBar.js
index 1efba700c..a6a487c30 100644
--- a/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormTopBar.js
+++ b/src/containers/Purchases/CreditNotes/CreditNoteForm/VendorCreditNoteFormTopBar.js
@@ -95,7 +95,7 @@ function VendorCreditFormSelectWarehouse() {
function VendorCreditNoteWarehouseSelectButton({ label }) {
return (
}
@@ -106,7 +106,7 @@ function VendorCreditNoteWarehouseSelectButton({ label }) {
function VendorCreditNoteBranchSelectButton({ label }) {
return (
}
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterLeft.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterLeft.js
index ead5cc418..700c2ba9a 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterLeft.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterLeft.js
@@ -1,4 +1,5 @@
import React from 'react';
+import intl from 'react-intl-universal';
import styled from 'styled-components';
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
@@ -8,14 +9,12 @@ export function PaymentMadeFormFooterLeft() {
{/* --------- Statement--------- */}
}
+ label={}
hintText={'Will be displayed on the Payment'}
>
- }
+ placeholder={intl.get('payment_made_form.statement.placeholder')}
/>
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterRight.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterRight.js
index 2622cf0f8..a1c7ff358 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterRight.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormFooterRight.js
@@ -11,17 +11,17 @@ import { usePaymentMadeTotals } from './utils';
export function PaymentMadeFormFooterRight() {
const { formattedSubtotal, formattedTotal } = usePaymentMadeTotals();
+
return (
}
+ title={}
value={formattedSubtotal}
borderStyle={TotalLineBorderStyle.None}
/>
}
+ title={}
value={formattedTotal}
- // borderStyle={TotalLineBorderStyle.SingleDark}
textStyle={TotalLineTextStyle.Bold}
/>
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormHeaderFields.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormHeaderFields.js
index 820e6abf2..a997910a8 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormHeaderFields.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormHeaderFields.js
@@ -54,15 +54,8 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
} = useFormikContext();
// Payment made form context.
- const {
- vendors,
- accounts,
- isNewMode,
- setPaymentVendorId,
- isForeignVendor,
- baseCurrency,
- selectVendor,
- } = usePaymentMadeFormContext();
+ const { vendors, accounts, isNewMode, setPaymentVendorId } =
+ usePaymentMadeFormContext();
// Sumation of payable full-amount.
const payableFullAmount = useMemo(
@@ -101,21 +94,20 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
className={classNames('form-group--select-list', Classes.FILL)}
labelInfo={}
>
-
- }
- onContactSelected={(contact) => {
- form.setFieldValue('vendor_id', contact.id);
- form.setFieldValue('currency_code', contact?.currency_code);
- setPaymentVendorId(contact.id);
- }}
- disabled={!isNewMode}
- popoverFill={true}
- allowCreate={true}
- />
-
+ }
+ onContactSelected={(contact) => {
+ form.setFieldValue('vendor_id', contact.id);
+ form.setFieldValue('currency_code', contact?.currency_code);
+ setPaymentVendorId(contact.id);
+ }}
+ disabled={!isNewMode}
+ popoverFill={true}
+ allowCreate={true}
+ />
+
{value && (
@@ -278,12 +270,6 @@ function PaymentMadeFormHeaderFields({ organization: { base_currency } }) {
export default compose(withCurrentOrganization())(PaymentMadeFormHeaderFields);
-const ControlVendorGroup = styled(ControlGroup)`
- display: flex;
- align-items: center;
- transform: none;
-`;
-
const VendorButtonLink = styled(VendorDrawerLink)`
font-size: 11px;
margin-top: 6px;
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormPage.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormPage.js
index f578ba915..766200d6d 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormPage.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormPage.js
@@ -6,25 +6,15 @@ import { PaymentMadeFormProvider } from './PaymentMadeFormProvider';
import 'style/pages/PaymentMade/PageForm.scss';
-import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
-import { compose } from 'utils';
-
/**
* Payment made - Page form.
*/
-function PaymentMadeFormPage({
- // #withCurrentOrganization
- organization: { base_currency },
-}) {
+export default function PaymentMadeFormPage() {
const { id: paymentMadeId } = useParams();
return (
-
+
);
}
-export default compose(withCurrentOrganization())(PaymentMadeFormPage);
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormProvider.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormProvider.js
index a2796fd48..af51416f8 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormProvider.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormProvider.js
@@ -1,5 +1,4 @@
import React, { createContext, useContext } from 'react';
-import { isEqual, isUndefined } from 'lodash';
import { Features } from 'common';
import { useFeatureCan } from 'hooks/state';
import {
@@ -20,21 +19,14 @@ const PaymentMadeFormContext = createContext();
/**
* Payment made form provider.
*/
-function PaymentMadeFormProvider({
- query,
- paymentMadeId,
- baseCurrency,
- ...props
-}) {
+function PaymentMadeFormProvider({ query, paymentMadeId, ...props }) {
const [submitPayload, setSubmitPayload] = React.useState({});
const [paymentVendorId, setPaymentVendorId] = React.useState(null);
- const [selectVendor, setSelectVendor] = React.useState(null);
// Features guard.
const { featureCan } = useFeatureCan();
const isBranchFeatureCan = featureCan(Features.Branches);
-
// Handle fetch accounts data.
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
@@ -67,7 +59,6 @@ function PaymentMadeFormProvider({
isSuccess: isBranchesSuccess,
} = useBranches(query, { enabled: isBranchFeatureCan });
-
// Fetch payment made settings.
useSettings();
@@ -79,11 +70,6 @@ function PaymentMadeFormProvider({
const isFeatureLoading = isBranchesLoading;
- // Determines whether the foreign vendor.
- const isForeignVendor =
- !isEqual(selectVendor?.currency_code, baseCurrency) &&
- !isUndefined(selectVendor?.currency_code);
-
// Provider payload.
const provider = {
paymentMadeId,
@@ -94,9 +80,6 @@ function PaymentMadeFormProvider({
items,
branches,
submitPayload,
- baseCurrency,
- selectVendor,
- setSelectVendor,
paymentVendorId,
isNewMode,
@@ -108,7 +91,6 @@ function PaymentMadeFormProvider({
isPaymentLoading,
isFeatureLoading,
isBranchesSuccess,
- isForeignVendor,
createPaymentMadeMutate,
editPaymentMadeMutate,
diff --git a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormTopBar.js b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormTopBar.js
index cfdda9616..af460d37b 100644
--- a/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormTopBar.js
+++ b/src/containers/Purchases/PaymentMades/PaymentForm/PaymentMadeFormTopBar.js
@@ -65,7 +65,7 @@ function PaymentMadeFormSelectBranch() {
function PaymentMadeBranchSelectButton({ label }) {
return (
}