-
+
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/BillPaymentTransactionsDataTable.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/BillPaymentTransactionsDataTable.js
new file mode 100644
index 000000000..3cfd3218c
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/BillPaymentTransactionsDataTable.js
@@ -0,0 +1,78 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import clsx from 'classnames';
+import { CLASSES } from '../../../../common/classes';
+import { DataTable, Card, FormatDateCell } from '../../../../components';
+
+/**
+ * Bill payment transactions data table.
+ */
+export default function BillPaymentTransactions() {
+ const columns = React.useMemo(
+ () => [
+ {
+ id: 'bill_date',
+ Header: intl.get('date'),
+ accessor: 'bill_date',
+ Cell: FormatDateCell,
+ width: 110,
+ className: 'bill_date',
+ },
+ {
+ id: 'bill_number',
+ Header: intl.get('bill_number'),
+ accessor: (row) => (row.bill_number ? `${row.bill_number}` : null),
+ width: 100,
+ className: 'bill_number',
+ },
+ {
+ id: 'vendor',
+ Header: intl.get('vendor_name'),
+ accessor: 'vendor.display_name',
+ width: 180,
+ className: 'vendor',
+ },
+ {
+ id: 'reference_no',
+ Header: intl.get('reference_no'),
+ accessor: 'reference_no',
+ width: 90,
+ className: 'reference_no',
+ },
+ {
+ id: 'qunatity',
+ Header: 'Quantity Purchase',
+ },
+ {
+ id: 'rate',
+ Header: 'Rate',
+ },
+ {
+ id: 'total',
+ Header: intl.get('total'),
+ },
+ {
+ id: 'status',
+ Header: intl.get('status'),
+ // accessor: (row) => statusAccessor(row),
+ width: 160,
+ className: 'status',
+ },
+ ],
+ [],
+ );
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/EstimatePaymentTransactionsDataTable.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/EstimatePaymentTransactionsDataTable.js
new file mode 100644
index 000000000..de04b499e
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/EstimatePaymentTransactionsDataTable.js
@@ -0,0 +1,73 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import clsx from 'classnames';
+import { CLASSES } from '../../../../common/classes';
+import { DataTable, Card, FormatDateCell } from '../../../../components';
+
+/**
+ * Esimtate payment transactions datatable.
+ */
+export default function EstimatePaymentTransactions() {
+ const columns = React.useMemo(
+ () => [
+ {
+ id: 'estimate_date',
+ Header: intl.get('date'),
+ accessor: 'estimate_date',
+ Cell: FormatDateCell,
+ width: 110,
+ className: 'estimate_date',
+ textOverview: true,
+ },
+ {
+ id: 'estimate_number',
+ Header: intl.get('estimate_no'),
+ accessor: 'estimate_number',
+ width: 100,
+ className: 'estimate_number',
+ textOverview: true,
+ },
+ {
+ id: 'reference',
+ Header: intl.get('reference_no'),
+ accessor: 'reference',
+ width: 140,
+ className: 'reference',
+ },
+ {
+ id: 'customer_id',
+ Header: intl.get('customer_name'),
+ accessor: 'customer.display_name',
+ width: 140,
+ className: 'customer_id',
+ },
+ {
+ id: 'qunatity',
+ Header: 'Quantity Sold',
+ },
+ {
+ id: 'rate',
+ Header: 'Rate',
+ },
+ {
+ id: 'total',
+ Header: intl.get('total'),
+ },
+ ],
+ [],
+ );
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/InvoicePaymentTransactionsDataTable.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/InvoicePaymentTransactionsDataTable.js
new file mode 100644
index 000000000..345ff9587
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/InvoicePaymentTransactionsDataTable.js
@@ -0,0 +1,83 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import clsx from 'classnames';
+import { CLASSES } from '../../../../common/classes';
+import { DataTable, Card, FormatDateCell } from '../../../../components';
+
+/**
+ * Invoice payment transactions datatable.
+ */
+export default function InvoicePaymentTransactionsTable() {
+ const columns = React.useMemo(
+ () => [
+ {
+ id: 'invoice_date',
+ Header: intl.get('date'),
+ accessor: 'invoice_date',
+ Cell: FormatDateCell,
+ width: 110,
+ className: 'invoice_date',
+ textOverview: true,
+ },
+ {
+ id: 'invoice_no',
+ Header: intl.get('invoice_no__'),
+ accessor: 'invoice_no',
+ width: 240,
+ className: 'invoice_no',
+ textOverview: true,
+ },
+ {
+ id: 'customer',
+ Header: intl.get('customer_name'),
+ accessor: 'customer.display_name',
+ width: 140,
+ className: 'customer_id',
+ clickable: true,
+ textOverview: true,
+ },
+ {
+ id: 'reference_no',
+ Header: intl.get('reference_no'),
+ accessor: 'reference_no',
+ width: 140,
+ className: 'reference_no',
+ textOverview: true,
+ },
+ {
+ id: 'qunatity',
+ Header: 'Quantity Sold',
+ },
+ {
+ id: 'rate',
+ Header: 'Rate',
+ },
+ {
+ id: 'total',
+ Header: intl.get('total'),
+ },
+ {
+ id: 'status',
+ Header: intl.get('status'),
+ // accessor: (row) => statusAccessor(row),
+ width: 160,
+ className: 'status',
+ },
+ ],
+ [],
+ );
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/ReceiptPaymentTransactionsDataTable.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/ReceiptPaymentTransactionsDataTable.js
new file mode 100644
index 000000000..3b82ce7b9
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/ReceiptPaymentTransactionsDataTable.js
@@ -0,0 +1,83 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import clsx from 'classnames';
+import { CLASSES } from '../../../../common/classes';
+import { DataTable, Card, FormatDateCell } from '../../../../components';
+
+/**
+ * Receipt payment transactions datatable.
+ */
+export default function ReceiptPaymentTransactions() {
+ const columns = React.useMemo(
+ () => [
+ {
+ id: 'receipt_date',
+ Header: intl.get('date'),
+ accessor: 'receipt_date',
+ Cell: FormatDateCell,
+ width: 110,
+ className: 'receipt_date',
+ textOverview: true,
+ },
+ {
+ id: 'receipt_number',
+ Header: intl.get('receipt_no'),
+ accessor: 'receipt_number',
+ width: 140,
+ className: 'receipt_number',
+ clickable: true,
+ textOverview: true,
+ },
+ {
+ id: 'customer',
+ Header: intl.get('customer_name'),
+ accessor: 'customer.display_name',
+ width: 140,
+ className: 'customer_id',
+ textOverview: true,
+ },
+ {
+ id: 'reference_no',
+ Header: intl.get('reference_no'),
+ accessor: 'reference_no',
+ width: 140,
+ className: 'reference_no',
+ textOverview: true,
+ },
+ {
+ id: 'status',
+ Header: intl.get('status'),
+ // accessor: StatusAccessor,
+ width: 140,
+ className: 'status',
+ },
+ {
+ id: 'qunatity',
+ Header: 'Quantity Sold',
+ },
+ {
+ id: 'rate',
+ Header: 'Rate',
+ },
+ {
+ id: 'total',
+ Header: intl.get('total'),
+ },
+ ],
+ [],
+ );
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/index.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/index.js
new file mode 100644
index 000000000..502918c8c
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/index.js
@@ -0,0 +1,37 @@
+import React from 'react';
+import { Tab } from '@blueprintjs/core';
+import { DrawerMainTabs, FormattedMessage as T } from 'components';
+import InvoicePaymentTransactionsTable from './InvoicePaymentTransactionsDataTable';
+import EstimatePaymentTransactionsTable from './EstimatePaymentTransactionsDataTable';
+import ReceiptPaymentTransactionsTable from './ReceiptPaymentTransactionsDataTable';
+import BillPaymentTransactionsTable from './BillPaymentTransactionsDataTable';
+
+import ItemSwitchMenuItem from './utils';
+
+export const ItemPaymentTransactions = () => {
+ return (
+
+ }
+ panel={}
+ />
+ }
+ panel={}
+ />
+ }
+ panel={}
+ />
+ }
+ />
+
+ );
+};
diff --git a/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/utils.js b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/utils.js
new file mode 100644
index 000000000..783e6dde0
--- /dev/null
+++ b/src/containers/Drawers/ItemDetailDrawer/ItemPaymentTransactions/utils.js
@@ -0,0 +1,59 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import {
+ Popover,
+ Menu,
+ Position,
+ Button,
+ MenuItem,
+ Classes,
+ NavbarGroup,
+ PopoverInteractionKind,
+} from '@blueprintjs/core';
+import { Icon } from '../../../../components';
+import { curry } from 'lodash/fp';
+import { Select } from '@blueprintjs/select';
+
+function ItemSwitchMenuItem({ onChange }) {
+ const Transaction = [
+ { name: 'Invoice' },
+ { name: 'Estimate' },
+ { name: 'Bill' },
+ { name: 'Receipt' },
+ ];
+
+ const handleSwitchMenutItem = (item) => {
+ onChange && onChange(item);
+ };
+
+ const content = (
+
+ );
+
+ return (
+
+ }
+ />
+
+ );
+}
+
+export default ItemSwitchMenuItem;
diff --git a/src/containers/Drawers/ItemDetailDrawer/index.js b/src/containers/Drawers/ItemDetailDrawer/index.js
index af6ef5569..9cd4f3b42 100644
--- a/src/containers/Drawers/ItemDetailDrawer/index.js
+++ b/src/containers/Drawers/ItemDetailDrawer/index.js
@@ -19,7 +19,12 @@ function ItemDetailDrawer({
payload: { itemId },
}) {
return (
-
+
diff --git a/src/hooks/query/bills.js b/src/hooks/query/bills.js
index a69444737..008daf3ce 100644
--- a/src/hooks/query/bills.js
+++ b/src/hooks/query/bills.js
@@ -186,3 +186,18 @@ export function useRefreshBills() {
},
};
}
+
+export function useBillPaymentTransactions(id, props) {
+ return useRequestQuery(
+ [t.BILLS_PAYMENT_TRANSACTIONS, id],
+ {
+ method: 'get',
+ url: `purchases/bills/${id}/payment-transactions`,
+ },
+ {
+ select: (res) => res.data.data,
+ defaultData: [],
+ ...props,
+ },
+ );
+}
diff --git a/src/hooks/query/invoices.js b/src/hooks/query/invoices.js
index 0f3ceb8b0..682ffecf5 100644
--- a/src/hooks/query/invoices.js
+++ b/src/hooks/query/invoices.js
@@ -273,3 +273,18 @@ export function useInvoiceSMSDetail(invoiceId, query, props) {
},
);
}
+
+export function useInvoicePaymentTransactions(invoiceId, props) {
+ return useRequestQuery(
+ [t.SALE_INVOICE_PAYMENT_TRANSACTIONS, invoiceId],
+ {
+ method: 'get',
+ url: `sales/invoices/${invoiceId}/payment-transactions`,
+ },
+ {
+ select: (res) => res.data.data,
+ defaultData: [],
+ ...props,
+ },
+ );
+}
diff --git a/src/hooks/query/paymentMades.js b/src/hooks/query/paymentMades.js
index f4589b480..9cfad50d8 100644
--- a/src/hooks/query/paymentMades.js
+++ b/src/hooks/query/paymentMades.js
@@ -30,6 +30,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate the cashflow transactions.
client.invalidateQueries(t.CASH_FLOW_TRANSACTIONS);
client.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
+
+ // Invalidate bills payment transactions.
+ client.invalidateQueries(t.BILLS_PAYMENT_TRANSACTIONS);
};
/**
diff --git a/src/hooks/query/paymentReceives.js b/src/hooks/query/paymentReceives.js
index bdaddf8b3..e4bb74be9 100644
--- a/src/hooks/query/paymentReceives.js
+++ b/src/hooks/query/paymentReceives.js
@@ -35,6 +35,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate reconcile.
client.invalidateQueries(t.RECONCILE_CREDIT_NOTE);
client.invalidateQueries(t.RECONCILE_CREDIT_NOTES);
+
+ // Invalidate invoices payment transactions.
+ client.invalidateQueries(t.SALE_INVOICE_PAYMENT_TRANSACTIONS);
};
// Transform payment receives.
diff --git a/src/hooks/query/types.js b/src/hooks/query/types.js
index 14172059d..36a2bb5ea 100644
--- a/src/hooks/query/types.js
+++ b/src/hooks/query/types.js
@@ -30,6 +30,7 @@ const BILLS = {
BILLS: 'BILLS',
BILL: 'BILL',
BILLS_DUE: 'BILLS_DUE',
+ BILLS_PAYMENT_TRANSACTIONS: 'BILLS_PAYMENT_TRANSACTIONS',
};
const VENDORS = {
@@ -95,6 +96,7 @@ const SALE_INVOICES = {
NOTIFY_SALE_INVOICE_BY_SMS: 'NOTIFY_SALE_INVOICE_BY_SMS',
BAD_DEBT: 'BAD_DEBT',
CANCEL_BAD_DEBT: 'CANCEL_BAD_DEBT',
+ SALE_INVOICE_PAYMENT_TRANSACTIONS: 'SALE_INVOICE_PAYMENT_TRANSACTIONS',
};
const USERS = {
diff --git a/src/lang/ar/index.json b/src/lang/ar/index.json
index 8309e7d23..efdb75b65 100644
--- a/src/lang/ar/index.json
+++ b/src/lang/ar/index.json
@@ -1497,5 +1497,6 @@
"users.column.role_name":"دور المستخدم",
"roles.error.you_cannot_edit_predefined_roles":"لا يمكنك تعديل أدوار المستخدم المحددة مسبقا.",
"roles.error.you_cannot_delete_predefined_roles":"لا يمكنك حذف أدوار المستخدم المحددة مسبقا",
- "roles.error.you_cannot_delete_role_that_associated_to_users":"لا يمكن حذف دور المستخدم لأنه لديه مستخدمين مرتبطة به."
+ "roles.error.you_cannot_delete_role_that_associated_to_users":"لا يمكن حذف دور المستخدم لأنه لديه مستخدمين مرتبطة به.",
+ "payment_transactions":"معاملات الدفع"
}
\ No newline at end of file
diff --git a/src/lang/en/index.json b/src/lang/en/index.json
index a866ba3fc..39a7bbdd2 100644
--- a/src/lang/en/index.json
+++ b/src/lang/en/index.json
@@ -1632,6 +1632,6 @@
"transactions_locking.of_the_module_locked_to": "Transactions of the module locked to {value}.",
"transactions_locking.lock_reason": "Lock Reason: {value}.",
"transactions_locking.partial_unlocked_from": "Partial unlocked from {fromDate} to {toDate}.",
- "transactions_locking.unlock_reason":"Unlock Reason: {value}."
-
+ "transactions_locking.unlock_reason":"Unlock Reason: {value}.",
+ "payment_transactions":"Payment transactions"
}
\ No newline at end of file
diff --git a/src/style/components/Drawers/ItemDrawer.scss b/src/style/components/Drawers/ItemDrawer.scss
index b97b84eaa..4da73cd21 100644
--- a/src/style/components/Drawers/ItemDrawer.scss
+++ b/src/style/components/Drawers/ItemDrawer.scss
@@ -1,12 +1,10 @@
.item-drawer {
-
.card {
margin: 15px;
padding: 22px 15px;
}
&__content {
-
.detail-item--name {
width: 30%;
@@ -16,7 +14,6 @@
}
.detail-item--quantity {
-
.detail-item__content {
font-weight: 600;
@@ -32,7 +29,6 @@
}
.details-menu--horizantal {
-
.detail-item:not(:first-of-type) {
margin-top: 16px;
}
@@ -42,4 +38,29 @@
}
}
}
-}
\ No newline at end of file
+ &__table {
+ .card {
+ padding: 12px 15px !important;
+ }
+
+ .table {
+ .tbody,
+ .thead {
+ .tr .th {
+ padding: 8px 8px;
+ background-color: #fff;
+ font-size: 14px;
+ border-bottom: 1px solid #000;
+ border-top: 1px solid #000;
+ }
+ }
+ .tbody {
+ .tr .td {
+ border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
+ }
+ }
+ }
+ }
+}
diff --git a/src/style/pages/PaymentTransactions/List.scss b/src/style/pages/PaymentTransactions/List.scss
new file mode 100644
index 000000000..baaff57df
--- /dev/null
+++ b/src/style/pages/PaymentTransactions/List.scss
@@ -0,0 +1,23 @@
+.payment-transactions {
+ padding: 12px;
+
+ .table {
+ .tbody,
+ .thead {
+ .tr .th {
+ padding: 8px 8px;
+ background-color: #fff;
+ font-size: 14px;
+ border-bottom: 1px solid #000;
+ border-top: 1px solid #000;
+ }
+ }
+ .tbody {
+ .tr .td {
+ border-bottom: 0;
+ padding-top: 0.4rem;
+ padding-bottom: 0.4rem;
+ }
+ }
+ }
+}