diff --git a/src/containers/Drawers/InvoiceDetailDrawer/InvoiceGLEntriesTable.js b/src/containers/Drawers/InvoiceDetailDrawer/InvoiceGLEntriesTable.js
index b7d1f2572..aade4e656 100644
--- a/src/containers/Drawers/InvoiceDetailDrawer/InvoiceGLEntriesTable.js
+++ b/src/containers/Drawers/InvoiceDetailDrawer/InvoiceGLEntriesTable.js
@@ -40,10 +40,6 @@ export default function InvoiceGLEntriesTable() {
);
}
-const InvoiceGLEntriesDatatable = styled(JournalEntriesTable)`
- .table .tbody .tr:last-child .td {
- border-bottom: 0;
- }
-`;
+const InvoiceGLEntriesDatatable = styled(JournalEntriesTable)``;
const InvoiceGLEntriesRoot = styled(Card)``;
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
index f1c725c8e..5f2cad543 100644
--- a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
@@ -1,6 +1,5 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
-
import {
Button,
NavbarGroup,
@@ -8,7 +7,6 @@ import {
NavbarDivider,
Intent,
} from '@blueprintjs/core';
-import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
@@ -16,7 +14,13 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
-import { Can, Icon, FormattedMessage as T, MoreMenuItems } from 'components';
+import {
+ Can,
+ Icon,
+ FormattedMessage as T,
+ MoreMenuItems,
+ DrawerActionsBar,
+} from 'components';
import {
PaymentReceiveAction,
AbilitySubject,
@@ -59,7 +63,7 @@ function PaymentReceiveActionsBar({
};
return (
-
+
-
+
-
+
);
}
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetail.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetail.js
index ce98e4ee0..2bf9a0b17 100644
--- a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetail.js
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetail.js
@@ -1,36 +1,46 @@
import React from 'react';
import { Tab } from '@blueprintjs/core';
import intl from 'react-intl-universal';
-import clsx from 'classnames';
+import styled from 'styled-components';
import { DrawerMainTabs } from 'components';
+
import PaymentReceiveDetailTab from './PaymentReceiveDetailTab';
+import PaymentReceiveActionsBar from './PaymentReceiveActionsBar';
+import { PaymentReceiveGLEntriesPanel } from './PaymentReceiveGLEntriesPanel';
-import JournalEntriesTable from '../../JournalEntriesTable/JournalEntriesTable';
-import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
-
-import PaymentDrawerCls from './PaymentReceiveDrawer.module.scss';
+/**
+ * Payment receive details tabs.
+ * @returns {React.JSX}
+ */
+function PaymentReceiveDetailsTabs() {
+ return (
+
+ }
+ />
+ }
+ />
+
+ );
+}
/**
* Payment receive view detail.
+ * @returns {React.JSX}
*/
export default function PaymentReceiveDetail() {
- const { transactions } = usePaymentReceiveDetailContext();
-
return (
-
-
- }
- />
- }
- />
-
-
+
+
+
+
);
}
+
+const PaymentReceiveDetailsRoot = styled.div``;
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailHeader.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailHeader.js
index d57659edf..c8affc18a 100644
--- a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailHeader.js
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailHeader.js
@@ -1,13 +1,19 @@
import React from 'react';
import intl from 'react-intl-universal';
-import clsx from 'classnames';
import { defaultTo } from 'lodash';
-import { FormatDate, DetailsMenu, DetailItem } from 'components';
+import {
+ Row,
+ Col,
+ FormatDate,
+ DetailsMenu,
+ DetailItem,
+ CommercialDocHeader,
+ CommercialDocTopHeader,
+ ButtonLink,
+} from 'components';
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
-import PaymentDrawerCls from './PaymentReceiveDrawer.module.scss';
-
/**
* Payment receive detail header.
*/
@@ -15,42 +21,54 @@ export default function PaymentReceiveDetailHeader() {
const { paymentReceive } = usePaymentReceiveDetailContext();
return (
-
-
-
+
+
+
{paymentReceive.formatted_amount}
- }
- />
-
-
-
- }
- />
-
+
+
+
-
-
- }
- />
-
-
+
+
+
+
+
+ {paymentReceive.customer?.display_name}
+
+
+
+ }
+ />
+
+
+
+
+
+
+ }
+ />
+
+
+
+
);
}
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
index aa79010e1..04bb1902b 100644
--- a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
@@ -1,7 +1,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import { DrawerHeaderContent, DrawerLoading } from 'components';
-import { useTransactionsByReference, usePaymentReceive } from 'hooks/query';
+import { usePaymentReceive } from 'hooks/query';
const PaymentReceiveDetailContext = React.createContext();
@@ -9,6 +9,7 @@ const PaymentReceiveDetailContext = React.createContext();
* Payment receive detail provider.
*/
function PaymentReceiveDetailProvider({ paymentReceiveId, ...props }) {
+ // Fetches specific payment receive details.
const {
data: paymentReceive,
isLoading: isPaymentLoading,
@@ -17,28 +18,15 @@ function PaymentReceiveDetailProvider({ paymentReceiveId, ...props }) {
enabled: !!paymentReceiveId,
});
- // Handle fetch transaction by reference.
- const {
- data: { transactions },
- isLoading: isTransactionLoading,
- } = useTransactionsByReference(
- {
- reference_id: paymentReceiveId,
- reference_type: 'paymentReceive',
- },
- { enabled: !!paymentReceiveId },
- );
-
// Provider.
const provider = {
isPaymentFetching,
- transactions,
paymentReceive,
paymentReceiveId,
};
return (
-
+
-
-
-
+
+
-
-
+
+
);
}
+
+const PaymentReceiveDetailsTabPanelRoot = styled.div``;
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailTable.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailTable.js
index b5b941c5a..c08736b3b 100644
--- a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailTable.js
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailTable.js
@@ -1,12 +1,11 @@
import React from 'react';
-import clsx from 'classnames';
+
+import { CommercialDocEntriesTable } from 'components';
import { usePaymentReceiveEntriesColumns } from './utils';
-import { DataTable } from 'components';
-
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
-import PaymentDrawerCls from './PaymentReceiveDrawer.module.scss';
+import { TableStyle } from 'common';
/**
* Payment receive readonly details table.
@@ -19,12 +18,10 @@ export default function PaymentReceiveDetailTable() {
} = usePaymentReceiveDetailContext();
return (
-
-
-
+
);
}
diff --git a/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveGLEntriesPanel.js b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveGLEntriesPanel.js
new file mode 100644
index 000000000..49105d8c0
--- /dev/null
+++ b/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveGLEntriesPanel.js
@@ -0,0 +1,42 @@
+import React from 'react';
+import styled from 'styled-components';
+
+import { Card } from 'components';
+import JournalEntriesTable, {
+ AmountDisplayedBaseCurrencyMessage,
+} from '../../JournalEntriesTable/JournalEntriesTable';
+
+import { useTransactionsByReference } from 'hooks/query';
+import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
+
+/**
+ * Payment receive GL entries table panel.
+ * @returns {React.JSX}
+ */
+export function PaymentReceiveGLEntriesPanel() {
+ const { paymentReceiveId } = usePaymentReceiveDetailContext();
+
+ // Handle fetch transaction by reference.
+ const {
+ data: { transactions },
+ isLoading: isTransactionsLoading,
+ } = useTransactionsByReference(
+ {
+ reference_id: paymentReceiveId,
+ reference_type: 'paymentReceive',
+ },
+ { enabled: !!paymentReceiveId },
+ );
+
+ return (
+
+
+
+
+ );
+}
+
+const PaymentReceiveGLEntriesRoot = styled(Card)``;