}
- value={1000}
+ value={paymentMade.amount}
className={clsx(PaymentDrawerCls.total_line_subtotal)}
/>
}
- value={1000}
+ value={paymentMade.formatted_amount}
className={clsx(PaymentDrawerCls.total_line_total)}
/>
diff --git a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
index bb22f3756..b51368ba5 100644
--- a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
+++ b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
@@ -14,7 +14,7 @@ const PaymentMadeDetailContext = React.createContext();
*/
function PaymentMadeDetailProvider({ paymentMadeId, ...props }) {
// Handle fetch specific payment made details.
- const { data: paymentMade, isFetching: isPaymentMadeLoading } =
+ const { data: paymentMade, isLoading: isPaymentMadeLoading } =
usePaymentMade(paymentMadeId, {
enabled: !!paymentMadeId,
});
diff --git a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailTable.js b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailTable.js
index 150e17925..004ff81c4 100644
--- a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailTable.js
+++ b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailTable.js
@@ -8,7 +8,12 @@ import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
import PaymentDrawerCls from './PaymentMadeDrawer.module.scss';
+/**
+ * Payment made read-only details table.
+ */
export default function PaymentMadeDetailTable() {
+
+ // Retrieve payment made entries columns.
const columns = usePaymentMadeEntriesColumns();
// Payment made details context.
diff --git a/client/src/containers/Drawers/PaymentMadeDetailDrawer/utils.js b/client/src/containers/Drawers/PaymentMadeDetailDrawer/utils.js
index f5af95397..f0bdab8a2 100644
--- a/client/src/containers/Drawers/PaymentMadeDetailDrawer/utils.js
+++ b/client/src/containers/Drawers/PaymentMadeDetailDrawer/utils.js
@@ -2,6 +2,8 @@ import React from 'react';
import intl from 'react-intl-universal';
import moment from 'moment';
+import { FormatNumberCell } from '../../../components';
+
export const usePaymentMadeEntriesColumns = () =>
React.useMemo(() => [
{
@@ -21,20 +23,23 @@ export const usePaymentMadeEntriesColumns = () =>
{
Header: intl.get('bill_amount'),
accessor: 'amount',
- className: 'amount',
+ Cell: FormatNumberCell,
+ align: 'right',
},
{
Header: intl.get('due_amount'),
accessor: 'due_amount',
+ Cell: FormatNumberCell,
width: 100,
disableSortBy: true,
- className: 'due_amount',
+ align: 'right',
},
{
Header: intl.get('payment_amount'),
accessor: 'payment_amount',
+ Cell: FormatNumberCell,
width: 100,
disableSortBy: true,
- className: 'payment_amount',
+ align: 'right',
},
], []);
diff --git a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailFooter.js b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailFooter.js
index fa5febb58..88bf62cad 100644
--- a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailFooter.js
+++ b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailFooter.js
@@ -1,7 +1,7 @@
import React from 'react';
import clsx from 'classnames';
-import { T, TotalLine, TotalLines } from 'components';
+import { FormatNumber, T, TotalLine, TotalLines } from 'components';
import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider';
import PaymentDrawerCls from './PaymentReceiveDrawer.module.scss';
@@ -17,12 +17,12 @@ export default function PaymentReceiveDetailFooter() {
}
- value={paymentReceive.amount}
+ value={}
className={PaymentDrawerCls.total_line_subtotal}
/>
}
- value={paymentReceive.amount}
+ value={paymentReceive.formatted_amount}
className={PaymentDrawerCls.total_line_total}
/>
diff --git a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/utils.js b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/utils.js
index ecea1634a..91591aa14 100644
--- a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/utils.js
+++ b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/utils.js
@@ -1,6 +1,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import moment from 'moment';
+import { FormatNumberCell } from '../../../components';
/**
* Retrieve payment entries table columns.
@@ -25,19 +26,22 @@ export const usePaymentReceiveEntriesColumns = () =>
{
Header: intl.get('invoice_amount'),
accessor: 'invoice.balance',
- className: 'invoice_amount',
+ Cell: FormatNumberCell,
+ align: 'right',
},
{
Header: intl.get('amount_due'),
accessor: 'invoice.amount_due',
- className: 'amount_due',
+ Cell: FormatNumberCell,
+ align: 'right',
width: 100,
disableSortBy: true,
},
{
Header: intl.get('payment_amount'),
accessor: 'invoice.payment_amount',
- className: 'payment_amount',
+ Cell: FormatNumberCell,
+ align: 'right',
width: 100,
disableSortBy: true,
},
diff --git a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailFooter.js b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailFooter.js
index 522b94000..0a1f95d79 100644
--- a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailFooter.js
+++ b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailFooter.js
@@ -6,6 +6,11 @@ import { T, TotalLines, TotalLine } from 'components';
import ReceiptDrawerCls from 'style/components/Drawers/ReceiptDrawer.module.scss';
import { useReceiptDetailDrawerContext } from './ReceiptDetailDrawerProvider';
+import { FormatNumber } from '../../../components';
+
+/**
+ * Receipts read-only details footer.
+ */
export function ReceiptDetailFooter() {
const { receipt } = useReceiptDetailDrawerContext();
@@ -14,17 +19,17 @@ export function ReceiptDetailFooter() {
}
- value={receipt.amount}
+ value={}
className={ReceiptDrawerCls.total_line_subtotal}
/>
}
- value={receipt.amount}
+ value={receipt.formatted_amount}
className={ReceiptDrawerCls.total_line_total}
/>
}
- value={receipt.amount}
+ value={receipt.formatted_amount}
className={ReceiptDrawerCls.total_line_payment}
/>
React.useMemo(() => [
{
@@ -18,22 +19,25 @@ export const useReceiptReadonlyEntriesTableColumns = () => React.useMemo(() => [
{
Header: intl.get('quantity'),
accessor: 'quantity',
+ Cell: FormatNumberCell,
width: 100,
- className: 'quantity',
+ align: 'right',
disableSortBy: true
},
{
Header: intl.get('rate'),
accessor: 'rate',
+ Cell: FormatNumberCell,
width: 100,
- className: 'rate',
+ align: 'right',
disableSortBy: true
},
{
Header: intl.get('amount'),
accessor: 'amount',
+ Cell: FormatNumberCell,
width: 100,
- className: 'amount',
+ align: 'right',
disableSortBy: true
},
], []);
diff --git a/client/src/containers/Expenses/ExpensesLanding/components.js b/client/src/containers/Expenses/ExpensesLanding/components.js
index b1dcb4215..90380f78e 100644
--- a/client/src/containers/Expenses/ExpensesLanding/components.js
+++ b/client/src/containers/Expenses/ExpensesLanding/components.js
@@ -12,9 +12,9 @@ import {
MenuDivider,
} from '@blueprintjs/core';
import moment from 'moment';
-import { FormattedMessage as T } from 'components';
-import { Money, Icon, If } from 'components';
import intl from 'react-intl-universal';
+
+import { FormattedMessage as T, Money, Icon, If } from 'components';
import { safeCallback } from 'utils';
/**
@@ -138,6 +138,7 @@ export function useExpensesTableColumns() {
Header: intl.get('full_amount'),
accessor: TotalAmountAccessor,
className: 'amount',
+ align: 'right',
width: 150,
clickable: true,
},
diff --git a/client/src/containers/FinancialStatements/APAgingSummary/components.js b/client/src/containers/FinancialStatements/APAgingSummary/components.js
index fca3ab6a6..8b2f6c299 100644
--- a/client/src/containers/FinancialStatements/APAgingSummary/components.js
+++ b/client/src/containers/FinancialStatements/APAgingSummary/components.js
@@ -37,23 +37,17 @@ export const useAPAgingSummaryColumns = () => {
Header: ,
accessor: 'current',
className: 'current',
- width: getColumnWidth(tableRows, `current`, {
- minWidth: 120,
- }),
+ width: getColumnWidth(tableRows, `current`, { minWidth: 120 }),
},
...agingColumns.map((agingColumn, index) => ({
Header: agingColumn,
accessor: `aging-${index}`,
- width: getColumnWidth(tableRows, `aging-${index}`, {
- minWidth: 120,
- }),
+ width: getColumnWidth(tableRows, `aging-${index}`, { minWidth: 120 }),
})),
{
Header: ,
accessor: 'total',
- width: getColumnWidth(tableRows, 'total', {
- minWidth: 120,
- }),
+ width: getColumnWidth(tableRows, 'total', { minWidth: 120 }),
},
],
[tableRows, agingColumns],
diff --git a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js
index fd8ee3f5e..539b735c7 100644
--- a/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js
+++ b/client/src/containers/FinancialStatements/GeneralLedger/GeneralLedgerTable.js
@@ -15,8 +15,6 @@ import { useGeneralLedgerTableColumns } from './components';
* General ledger table.
*/
export default function GeneralLedgerTable({ companyName }) {
-
-
// General ledger context.
const {
generalLedger: { tableRows, query },
diff --git a/client/src/containers/FinancialStatements/GeneralLedger/components.js b/client/src/containers/FinancialStatements/GeneralLedger/components.js
index e8a307da9..9ccb69a7f 100644
--- a/client/src/containers/FinancialStatements/GeneralLedger/components.js
+++ b/client/src/containers/FinancialStatements/GeneralLedger/components.js
@@ -12,8 +12,6 @@ import FinancialLoadingBar from '../FinancialLoadingBar';
* Retrieve the general ledger table columns.
*/
export function useGeneralLedgerTableColumns() {
-
-
// General ledger context.
const {
generalLedger: { tableRows },
@@ -37,6 +35,7 @@ export function useGeneralLedgerTableColumns() {
return row.date;
},
className: 'date',
+ textOverview: true,
width: 120,
},
{
@@ -44,7 +43,6 @@ export function useGeneralLedgerTableColumns() {
accessor: 'name',
className: 'name',
textOverview: true,
- // width: 200,
},
{
Header: intl.get('transaction_type'),
@@ -58,12 +56,13 @@ export function useGeneralLedgerTableColumns() {
accessor: 'reference_id',
className: 'transaction_number',
width: 100,
+ textOverview: true,
},
{
Header: intl.get('description'),
accessor: 'note',
className: 'description',
- // width: 145,
+ textOverview: true,
},
{
Header: intl.get('credit'),
@@ -73,6 +72,7 @@ export function useGeneralLedgerTableColumns() {
minWidth: 100,
magicSpacing: 10,
}),
+ textOverview: true,
},
{
Header: intl.get('debit'),
@@ -82,6 +82,7 @@ export function useGeneralLedgerTableColumns() {
minWidth: 100,
magicSpacing: 10,
}),
+ textOverview: true,
},
{
Header: intl.get('amount'),
@@ -91,6 +92,7 @@ export function useGeneralLedgerTableColumns() {
minWidth: 100,
magicSpacing: 10,
}),
+ textOverview: true,
},
{
Header: intl.get('running_balance'),
@@ -100,6 +102,7 @@ export function useGeneralLedgerTableColumns() {
minWidth: 100,
magicSpacing: 10,
}),
+ textOverview: true,
},
],
[tableRows],
diff --git a/client/src/containers/Items/components.js b/client/src/containers/Items/components.js
index a228fb27d..d573f4aaf 100644
--- a/client/src/containers/Items/components.js
+++ b/client/src/containers/Items/components.js
@@ -10,9 +10,9 @@ import {
Popover,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
-import { FormattedMessage as T } from 'components';
import { isNumber } from 'lodash';
-import { Icon, Money, If } from 'components';
+
+import { FormattedMessage as T, Icon, Money, If } from 'components';
import { isBlank, safeCallback } from 'utils';
/**
@@ -187,7 +187,7 @@ export const useItemsTableColumns = () => {
id: 'sell_price',
Header: intl.get('sell_price'),
accessor: 'sell_price_formatted',
- className: 'sell-price',
+ align: 'right',
width: 150,
clickable: true,
},
@@ -195,7 +195,7 @@ export const useItemsTableColumns = () => {
id: 'cost_price',
Header: intl.get('cost_price'),
accessor: 'cost_price_formatted',
- className: 'cost-price',
+ align: 'right',
width: 150,
clickable: true,
},
@@ -204,6 +204,7 @@ export const useItemsTableColumns = () => {
Header: intl.get('quantity_on_hand'),
accessor: 'quantity_on_hand',
Cell: QuantityOnHandCell,
+ align: 'right',
width: 140,
clickable: true,
},
diff --git a/client/src/containers/Purchases/Bills/BillsLanding/components.js b/client/src/containers/Purchases/Bills/BillsLanding/components.js
index 32a9972ec..327a1cc56 100644
--- a/client/src/containers/Purchases/Bills/BillsLanding/components.js
+++ b/client/src/containers/Purchases/Bills/BillsLanding/components.js
@@ -11,11 +11,11 @@ import {
ProgressBar,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
-import { FormattedMessage as T } from 'components';
-import { Icon, If, Choose, Money } from 'components';
-import { formattedAmount, safeCallback, isBlank, calculateStatus } from 'utils';
import moment from 'moment';
+import { FormattedMessage as T, Icon, If, Choose, Money } from 'components';
+import { formattedAmount, safeCallback, isBlank, calculateStatus } from 'utils';
+
/**
* Actions menu.
*/
@@ -183,6 +183,7 @@ export function useBillsTableColumns() {
accessor: AmountAccessor,
width: 120,
className: 'amount',
+ align: 'right',
clickable: true,
},
{
diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
index 48ac5e0fd..ab238045d 100644
--- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
+++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/PaymentMadeList.js
@@ -2,7 +2,7 @@ import React from 'react';
import 'style/pages/PaymentMade/List.scss';
-import { DashboardContentTable, DashboardPageContent } from 'components';
+import { DashboardPageContent } from 'components';
import PaymentMadeActionsBar from './PaymentMadeActionsBar';
import PaymentMadesAlerts from '../PaymentMadesAlerts';
import PaymentMadesTable from './PaymentMadesTable';
diff --git a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js
index bef7be79e..29e521b80 100644
--- a/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js
+++ b/client/src/containers/Purchases/PaymentMades/PaymentsLanding/components.js
@@ -10,6 +10,7 @@ import {
Position,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
+
import { Icon, Money } from 'components';
import { safeCallback } from 'utils';
@@ -111,6 +112,7 @@ export function usePaymentMadesTableColumns() {
accessor: AmountAccessor,
width: 140,
className: 'amount',
+ align: 'right',
clickable: true,
},
{
diff --git a/client/src/containers/Sales/Estimates/EstimatesLanding/components.js b/client/src/containers/Sales/Estimates/EstimatesLanding/components.js
index 130dc1c64..1a63a86fa 100644
--- a/client/src/containers/Sales/Estimates/EstimatesLanding/components.js
+++ b/client/src/containers/Sales/Estimates/EstimatesLanding/components.js
@@ -9,12 +9,12 @@ import {
MenuDivider,
Position,
} from '@blueprintjs/core';
-import { Money, Choose, Icon, If } from 'components';
-import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
-import { safeCallback } from 'utils';
import moment from 'moment';
+import { FormattedMessage as T, Money, Choose, Icon, If } from 'components';
+import { safeCallback } from 'utils';
+
/**
* Status accessor.
*/
@@ -196,7 +196,7 @@ export function useEstiamtesTableColumns() {
Header: intl.get('amount'),
accessor: AmountAccessor,
width: 140,
- className: 'amount',
+ align: 'right',
clickable: true,
},
{
diff --git a/client/src/containers/Sales/Invoices/InvoicesLanding/components.js b/client/src/containers/Sales/Invoices/InvoicesLanding/components.js
index fff48382d..4ee13d098 100644
--- a/client/src/containers/Sales/Invoices/InvoicesLanding/components.js
+++ b/client/src/containers/Sales/Invoices/InvoicesLanding/components.js
@@ -11,11 +11,9 @@ import {
Button,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
-
-import { FormattedMessage as T } from 'components';
import moment from 'moment';
-import { Choose, If, Icon } from 'components';
-import { Money, AppToaster } from 'components';
+
+import { FormattedMessage as T, AppToaster, Choose, If, Icon } from 'components';
import { formattedAmount, safeCallback, calculateStatus } from 'utils';
export const statusAccessor = (row) => {
@@ -146,17 +144,6 @@ export function ActionsMenu({
);
}
-function ActionsCell(props) {
- return (
- }
- position={Position.RIGHT_BOTTOM}
- >
- } />
-
- );
-}
-
/**
* Retrieve invoices table columns.
*/
@@ -196,7 +183,7 @@ export function useInvoicesTableColumns() {
Header: intl.get('balance'),
accessor: 'formatted_amount',
width: 120,
- className: 'balance',
+ align: 'right',
clickable: true,
textOverview: true,
},
diff --git a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js
index 24bac9ecd..4611db50d 100644
--- a/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js
+++ b/client/src/containers/Sales/PaymentReceives/PaymentsLanding/components.js
@@ -10,6 +10,7 @@ import {
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
import moment from 'moment';
+
import { Money, Icon } from 'components';
import { safeCallback } from 'utils';
@@ -105,7 +106,7 @@ export function usePaymentReceivesColumns() {
Header: intl.get('amount'),
accessor: AmountAccessor,
width: 120,
- className: 'amount',
+ align: 'right',
clickable: true,
textOverview: true,
},
diff --git a/client/src/containers/Sales/Receipts/ReceiptsLanding/components.js b/client/src/containers/Sales/Receipts/ReceiptsLanding/components.js
index 14a1623ef..4eee826f4 100644
--- a/client/src/containers/Sales/Receipts/ReceiptsLanding/components.js
+++ b/client/src/containers/Sales/Receipts/ReceiptsLanding/components.js
@@ -11,9 +11,10 @@ import {
Tag,
Button,
} from '@blueprintjs/core';
+import moment from 'moment';
+
import { safeCallback } from 'utils';
import { Choose, Money, Icon, If } from 'components';
-import moment from 'moment';
export function ActionsMenu({
payload: { onEdit, onDelete, onClose, onDrawer, onViewDetails, onPrint },
@@ -136,7 +137,7 @@ export function useReceiptsTableColumns() {
Header: intl.get('amount'),
accessor: (r) => ,
width: 140,
- className: 'amount',
+ align: 'right',
clickable: true,
textOverview: true,
},
diff --git a/client/src/containers/Vendors/VendorsLanding/components.js b/client/src/containers/Vendors/VendorsLanding/components.js
index 355effbf3..35d653930 100644
--- a/client/src/containers/Vendors/VendorsLanding/components.js
+++ b/client/src/containers/Vendors/VendorsLanding/components.js
@@ -9,6 +9,7 @@ import {
Intent,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
+
import { Icon, Money, If } from 'components';
import { safeCallback, firstLettersArgs } from 'utils';
@@ -147,7 +148,7 @@ export function useVendorsTableColumns() {
id: 'balance',
Header: intl.get('receivable_balance'),
accessor: BalanceAccessor,
- className: 'receivable_balance',
+ align: 'right',
width: 100,
clickable: true,
},
diff --git a/client/src/style/App.scss b/client/src/style/App.scss
index 0a9c5fb04..a5af32cce 100644
--- a/client/src/style/App.scss
+++ b/client/src/style/App.scss
@@ -256,14 +256,12 @@ html[lang^="ar"] {
}
}
}
-
}
.bp3-drawer{
border-left: 1px solid #00115e;
}
-
.drawer-portal{
.bp3-overlay-backdrop{
@@ -279,3 +277,8 @@ html[lang^="ar"] {
font-weight: 600;
margin-bottom: 0;
}
+
+
+.align-right{
+ text-align: right;
+}
\ No newline at end of file
diff --git a/client/src/style/components/Drawers/ExpenseDrawer.scss b/client/src/style/components/Drawers/ExpenseDrawer.scss
index 1a2de8a4b..3a00b10ad 100644
--- a/client/src/style/components/Drawers/ExpenseDrawer.scss
+++ b/client/src/style/components/Drawers/ExpenseDrawer.scss
@@ -1,103 +1,107 @@
.expense-drawer {
- .card {
- margin: 15px;
- padding: 25px 15px 35px;
+ .card {
+ margin: 15px;
+ padding: 25px 15px 35px;
- .amount {
-
- }
+ .amount {}
+ }
+
+ &__content-header {
+ margin-bottom: 30px;
+
+ .detail-item {
+ flex-grow: 1;
+
+ &--amount {
+ width: 20%;
+ }
+
+ .big-number {
+ font-size: 28px;
+ color: #c06361;
+ margin: 6px 0;
+ font-weight: 600;
+ }
}
- &__content-header {
- margin-bottom: 30px;
-
- .detail-item {
- flex-grow: 1;
-
- &--amount {
- width: 20%;
- }
- .big-number{
- font-size: 28px;
- color: #c06361;
- margin: 6px 0;
- font-weight: 600;
- }
- }
-
- .details-menu + .details-menu{
- margin-top: 14px;
- }
-
- .details-menu--horizantal{
-
- .detail-item{
-
- &__label{
- min-width: 120px;
- }
- }
- }
+ .details-menu+.details-menu {
+ margin-top: 14px;
}
- &__content-footer{
- display: flex;
+ .details-menu--horizantal {
- .total-lines{
- margin-left: auto;
- }
- }
-
-
- .table {
- .thead .th {
- background: transparent;
- color: #222222;
- border-bottom: 1px solid #000000;
- border-top: 1px solid #000000;
- padding: 0.5rem;
- }
-
- .tbody .tr .td {
- background: transparent;
- padding: 0.5rem 0.5rem;
- border-bottom: 0;
- }
-
- .tbody .tr:last-child .td {
- border-bottom: 1px solid #d2dce2;
+ .detail-item {
+
+ &__label {
+ min-width: 120px;
}
+ }
}
+ }
+ &__content-footer {
+ display: flex;
.total-lines {
+ margin-left: auto;
+ }
+ }
- &__line {
- display: flex;
-
- >div {
- padding: 7px 8px;
- }
-
- .title {
- width: 220px;
- font-weight: 600;
- }
-
- .amount {
- font-weight: 600;
- width: 260px;
- }
-
- &--subtotal {
- border-bottom: 1px solid #000;
- }
-
- &--total {
- border-bottom: 3px double #000;
- }
- }
+ .table {
+ .thead .th {
+ background: transparent;
+ color: #222222;
+ border-bottom: 1px solid #000000;
+ border-top: 1px solid #000000;
+ padding: 0.5rem;
}
+ .tbody .tr .td {
+ background: transparent;
+ padding: 0.5rem 0.5rem;
+ border-bottom: 0;
+ }
+
+ .tbody .tr:last-child .td {
+ border-bottom: 1px solid #d2dce2;
+ }
+ }
+
+
+ .total-lines {
+
+ &__line {
+ display: flex;
+
+ >div {
+ padding: 7px 8px;
+ }
+
+ .title {
+ width: 220px;
+ font-weight: 600;
+ }
+
+ .amount {
+ font-weight: 600;
+ width: 260px;
+ }
+
+ &--subtotal,
+ &--total {
+ text-align: right;
+ }
+
+ &--subtotal {
+ border-bottom: 1px solid #000;
+ }
+
+ &--total {
+ border-bottom: 3px double #000;
+ }
+ }
+
+ }
+
}
\ No newline at end of file
diff --git a/client/src/style/components/Drawers/ManualJournalDrawer.scss b/client/src/style/components/Drawers/ManualJournalDrawer.scss
new file mode 100644
index 000000000..9b65dca40
--- /dev/null
+++ b/client/src/style/components/Drawers/ManualJournalDrawer.scss
@@ -0,0 +1,113 @@
+.journal-drawer {
+
+ .card {
+ margin: 15px;
+ padding: 25px 15px 35px;
+ }
+
+ .card {
+
+ .amount {
+ font-size: 28px;
+ color: #c06361;
+ margin: 6px 0;
+ font-weight: 600;
+ }
+ }
+
+ .table {
+ .thead .th {
+ background: transparent;
+ color: #222222;
+ border-bottom: 1px solid #000000;
+ border-top: 1px solid #000000;
+ padding: 0.5rem;
+ }
+
+ .tbody .tr .td {
+ background: transparent;
+ padding: 0.5rem 0.5rem;
+ border-bottom: 0;
+ }
+
+ .tbody .tr:last-child .td {
+ border-bottom: 1px solid #d2dce2;
+ }
+
+ .thead,
+ .tbody{
+ .tr .td,
+ .tr .th{
+ &.credit,
+ &.debit{
+ text-align: right;
+ }
+ }
+ }
+ }
+
+ &__content {
+
+ &-header {
+ margin-bottom: 35px;
+
+ .detail-item {
+ flex-grow: 1;
+
+ &--amount {
+ width: 20%;
+ }
+ }
+ }
+
+ &-footer {
+ display: flex;
+
+ .total-lines {
+ margin-left: auto;
+ }
+ }
+
+ &-description {
+ margin-top: 20px;
+
+ .title {
+ color: #727983;
+ }
+ }
+ }
+
+
+ .total-lines {
+
+ &__line {
+ display: flex;
+
+ >div {
+ padding: 7px 8px;
+ }
+
+ .title {
+ width: 220px;
+ font-weight: 600;
+ }
+
+ .credit,
+ .debit {
+ font-weight: 600;
+ width: 155px;
+ }
+
+ &--subtotal {
+ border-bottom: 1px solid #000;
+ }
+ &--total {
+ border-bottom: 3px double #000;
+ }
+ &--subtotal,
+ &--total{
+ text-align: right;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/client/src/style/components/Drawers/ViewDetails.scss b/client/src/style/components/Drawers/ViewDetails.scss
deleted file mode 100644
index d3ac4d6b0..000000000
--- a/client/src/style/components/Drawers/ViewDetails.scss
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-.journal-drawer{
-
- .card{
- margin: 15px;
- padding: 25px 15px 35px;
- }
- .card{
-
- .amount{
- font-size: 28px;
- color: #c06361;
- margin: 6px 0;
- font-weight: 600;
- }
- }
-
- .table{
- .thead .th {
- background: transparent;
- color: #222222;
- border-bottom: 1px solid #000000;
- border-top: 1px solid #000000;
- padding: 0.5rem;
- }
- .tbody .tr .td {
- background: transparent;
- padding: 0.5rem 0.5rem;
- border-bottom: 0;
- }
-
- .tbody .tr:last-child .td{
- border-bottom: 1px solid #d2dce2;
- }
- }
-
- &__content{
-
- &-header{
- margin-bottom: 35px;
-
- .detail-item{
- flex-grow: 1;
-
- &--amount{
- width: 20%;
- }
- }
- }
-
- &-footer{
- display: flex;
-
- .total-lines{
- margin-left: auto;
- }
- }
-
- &-description{
- margin-top: 20px;
- .title{
- color: #727983;
- }
- }
- }
-
-
- .total-lines{
-
- &__line{
- display: flex;
-
- > div{
- padding: 7px 8px;
- }
-
- .title{
- width: 220px;
- font-weight: 600;
- }
-
- .credit,
- .debit{
- font-weight: 600;
- width: 155px;
- }
-
- &--subtotal{
- border-bottom: 1px solid #000;
- }
-
- &--total{
- border-bottom: 3px double #000;
- }
- }
-
- }
-
-}
-
-// .expense-drawer {
-
-// &__content {
-// display: flex;
-// flex-direction: column;
-
-// border: 1px solid #d2dce2;
-// box-shadow: 1px 1px #fbf8f8;
-// background-color: #ffffff;
-// min-height: 508px;
-
-// &--header {
-// display: flex;
-// flex-wrap: wrap;
-// justify-content: flex-start;
-// margin: 15px 0 20px;
-// font-size: 14px;
-// color: #666666;
-
-// > div {
-// flex-grow: 1;
-// span {
-// display: block;
-// color: #666666;
-// font-weight: 500;
-// margin: 10px 0;
-// }
-// }
-// .info {
-// flex: 0 1 25%;
-// padding-left: 2%;
-// margin: 10px 0;
-// }
-// .balance {
-// font-size: 26px;
-// font-weight: 500;
-// color: #0f1118;
-// }
-// }
-
-// &--table {
-// flex-grow: 1;
-// flex-shrink: 0;
-
-
-// .desc {
-// margin: 20px 0 60px;
-
-// > b {
-// color: #2f2f2f;
-// }
-// }
-// }
-
-// &--footer {
-// display: flex;
-// flex-direction: column;
-// align-items: flex-end;
-// color: #666666;
-// .wrapper > div {
-// display: flex;
-// border-top: 1px solid #000000;
-// border-bottom: 1px solid #000000;
-// padding: 0.2rem;
-// span,
-// p {
-// margin: 10px 50px 5px 0px;
-// }
-// span {
-// color: #333333;
-// flex-grow: 1;
-// font-weight: 500;
-// }
-// }
-// }
-// }
-// }
diff --git a/client/src/utils.js b/client/src/utils.js
index dd144d1a7..d4cc5b45a 100644
--- a/client/src/utils.js
+++ b/client/src/utils.js
@@ -13,16 +13,16 @@ import { isEqual } from 'lodash';
import jsCookie from 'js-cookie';
-export const getCookie = (name, defaultValue) => _.defaultTo(jsCookie.get(name), defaultValue);
+export const getCookie = (name, defaultValue) =>
+ _.defaultTo(jsCookie.get(name), defaultValue);
export const setCookie = (name, value, expiry = 365, secure = false) => {
jsCookie.set(name, value, { expires: expiry, path: '/', secure });
};
export const removeCookie = (name) => {
- return jsCookie.remove(name, { path: '/' });
-}
-
+ return jsCookie.remove(name, { path: '/' });
+};
export function removeEmptyFromObject(obj) {
obj = Object.assign({}, obj);
@@ -137,7 +137,7 @@ export const parseDateRangeQuery = (keyword) => {
},
this_quarter: {
range: 'quarter',
- }
+ },
};
if (typeof queries[keyword] === 'undefined') {
@@ -168,16 +168,21 @@ export const defaultExpanderReducer = (tableRows, level) => {
return expended;
};
-export function formattedAmount(cents, currency, props) {
- const { symbol, decimal_digits: precision } = Currency[currency];
+export function formattedAmount(cents, currencyCode = '', props) {
+ const currency = Currency[currencyCode];
+ const parsedCurrency = {
+ symbol: '',
+ decimal_digits: 0,
+ ...currency
+ };
const parsedProps = {
noZero: false,
...props,
};
const formatOptions = {
- symbol,
- precision: 0,
+ symbol: parsedCurrency.symbol,
+ precision: parsedCurrency.decimal_digits,
format: {
pos: '%s%v',
neg: '%s-%v',
@@ -188,6 +193,24 @@ export function formattedAmount(cents, currency, props) {
return accounting.formatMoney(cents, formatOptions);
}
+export function formattedNumber(amount, props) {
+ const parsedProps = {
+ noZero: false,
+ ...props,
+ };
+ const formatOptions = {
+ symbol: '',
+ precision: 0,
+ format: {
+ pos: '%s%v',
+ neg: '%s-%v',
+ zero: parsedProps.noZero ? '' : '%s%v',
+ },
+ ...props,
+ };
+ return accounting.formatMoney(amount, formatOptions);
+}
+
export function formattedExchangeRate(amount, currency) {
const options = {
style: 'currency',
@@ -243,7 +266,6 @@ export const firstLettersArgs = (...args) => {
return letters.join('').toUpperCase();
};
-
export const uniqueMultiProps = (items, props) => {
return _.uniqBy(items, (item) => {
return JSON.stringify(_.pick(item, props));
@@ -780,8 +802,7 @@ export function getFilterableFieldsFromFields(fields) {
export const RESORUCE_TYPE = {
ACCOUNTS: 'account',
ITEMS: 'items',
-
-}
+};
function escapeRegExpChars(text) {
return text.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
@@ -816,4 +837,4 @@ export function highlightText(text, query) {
tokens.push(rest);
}
return tokens;
-}
\ No newline at end of file
+}
diff --git a/server/src/services/Sales/SaleInvoiceTransformer.ts b/server/src/services/Sales/SaleInvoiceTransformer.ts
index 42d24384e..5d8e177ca 100644
--- a/server/src/services/Sales/SaleInvoiceTransformer.ts
+++ b/server/src/services/Sales/SaleInvoiceTransformer.ts
@@ -1,4 +1,4 @@
-import { Service } from 'typedi';;
+import { Service } from 'typedi';
import { Transformer } from 'lib/Transformer/Transformer';
import { formatNumber } from 'utils';
@@ -13,6 +13,7 @@ export default class SaleInvoiceTransformer extends Transformer {
'formattedDueDate',
'formattedAmount',
'formattedDueAmount',
+ 'formattedPaymentAmount',
];
};
@@ -50,9 +51,20 @@ export default class SaleInvoiceTransformer extends Transformer {
* @param {ISaleInvoice} invoice
* @returns {string}
*/
- protected formattedDueAmount(invoice) {
+ protected formattedDueAmount = (invoice): string => {
return formatNumber(invoice.dueAmount, {
currencyCode: invoice.currencyCode,
});
- }
+ };
+
+ /**
+ * Retrieve formatted payment amount.
+ * @param {ISaleInvoice} invoice
+ * @returns {string}
+ */
+ protected formattedPaymentAmount = (invoice): string => {
+ return formatNumber(invoice.paymentAmount, {
+ currencyCode: invoice.currencyCode,
+ });
+ };
}