diff --git a/packages/webapp/src/containers/FinancialStatements/AgingSummary/dynamicColumns.ts b/packages/webapp/src/containers/FinancialStatements/AgingSummary/dynamicColumns.ts index 971bdadb72..7d04a67ca6 100644 --- a/packages/webapp/src/containers/FinancialStatements/AgingSummary/dynamicColumns.ts +++ b/packages/webapp/src/containers/FinancialStatements/AgingSummary/dynamicColumns.ts @@ -1,5 +1,4 @@ // @ts-nocheck -import React, { useMemo } from 'react'; import * as R from 'ramda'; import { getColumnWidth } from '@/utils'; import { Align } from '@/constants'; @@ -25,6 +24,7 @@ const currentAccessor = R.curry((data, column) => { className: column.id, width: getColumnWidth(data, accessor, { minWidth: 120 }), align: Align.Right, + money: true, }; }); @@ -38,6 +38,7 @@ const totalAccessor = R.curry((data, column) => { className: column.key, width: getColumnWidth(data, accessor, { minWidth: 120 }), align: Align.Right, + money: true, }; }); @@ -51,6 +52,7 @@ const agingPeriodAccessor = R.curry((data, column) => { className: column.key, width: getColumnWidth(data, accessor, { minWidth: 120 }), align: Align.Right, + money: true, }; }); diff --git a/packages/webapp/src/containers/FinancialStatements/BalanceSheet/dynamicColumns.tsx b/packages/webapp/src/containers/FinancialStatements/BalanceSheet/dynamicColumns.tsx index bb49f7b969..326c69ea9b 100644 --- a/packages/webapp/src/containers/FinancialStatements/BalanceSheet/dynamicColumns.tsx +++ b/packages/webapp/src/containers/FinancialStatements/BalanceSheet/dynamicColumns.tsx @@ -3,7 +3,6 @@ import * as R from 'ramda'; import { isEmpty } from 'lodash'; import { Align } from '@/constants'; -import { CellTextSpan } from '@/components/Datatable/Cells'; import { getColumnWidth } from '@/utils'; const getTableCellValueAccessor = (index) => `cells[${index}].value`; @@ -12,12 +11,11 @@ const getReportColWidth = (data, accessor, headerText) => { return getColumnWidth( data, accessor, - { magicSpacing: 10, minWidth: 100 }, + { magicSpacing: 12, minWidth: 100 }, headerText, ); }; - /** * Account name column mapper. */ @@ -77,6 +75,7 @@ const dateRangeMapper = R.curry((data, column) => { key: column.key, disableSortBy: true, textOverview: true, + money: true, align: isDateColumnHasColumns ? Align.Center : Align.Right, }; return R.compose( @@ -104,9 +103,9 @@ const totalMapper = R.curry((data, column) => { Header: column.label, accessor, textOverview: true, - Cell: CellTextSpan, width, disableSortBy: true, + money: true, align: hasChildren ? Align.Center : Align.Right, }; return R.compose( @@ -129,6 +128,7 @@ const percentageOfColumnAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -147,6 +147,7 @@ const percentageOfRowAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -165,6 +166,7 @@ const previousYearAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -183,6 +185,7 @@ const previousYearChangeAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -201,6 +204,7 @@ const previousYearPercentageAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -219,6 +223,7 @@ const previousPeriodAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -237,6 +242,7 @@ const previousPeriodChangeAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); @@ -255,6 +261,7 @@ const previousPeriodPercentageAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true, }; }); diff --git a/packages/webapp/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.tsx b/packages/webapp/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.tsx index cde12d3388..cdb4b7fb85 100644 --- a/packages/webapp/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.tsx +++ b/packages/webapp/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.tsx @@ -30,13 +30,14 @@ const dateRangeMapper = (data, index, column) => ({ key: column.key, accessor: `cells[${index}].value`, width: getColumnWidth(data, `cells.${index}.value`, { - magicSpacing: 10, + magicSpacing: 12, minWidth: 100, }), className: `date-period ${column.key}`, disableSortBy: true, textOverview: true, align: Align.Right, + money: true }); /** @@ -50,11 +51,12 @@ const totalMapper = (data, index, column) => ({ textOverview: true, Cell: CellTextSpan, width: getColumnWidth(data, `cells[${index}].value`, { - magicSpacing: 10, + magicSpacing: 12, minWidth: 100, }), disableSortBy: true, align: Align.Right, + money: true }); /** diff --git a/packages/webapp/src/containers/FinancialStatements/CustomersTransactions/components.tsx b/packages/webapp/src/containers/FinancialStatements/CustomersTransactions/components.tsx index 5bf73e1c14..ac30d3c25e 100644 --- a/packages/webapp/src/containers/FinancialStatements/CustomersTransactions/components.tsx +++ b/packages/webapp/src/containers/FinancialStatements/CustomersTransactions/components.tsx @@ -61,9 +61,10 @@ export const useCustomersTransactionsColumns = () => { textOverview: true, width: getColumnWidth(tableRows, 'cells[5].value', { minWidth: 100, - magicSpacing: 10, + magicSpacing: 12, }), align: Align.Right, + money: true, }, { Header: intl.get('debit'), @@ -72,9 +73,10 @@ export const useCustomersTransactionsColumns = () => { textOverview: true, width: getColumnWidth(tableRows, 'cells[6].value', { minWidth: 100, - magicSpacing: 10, + magicSpacing: 12, }), align: Align.Right, + money: true, }, { Header: intl.get('running_balance'), @@ -83,9 +85,10 @@ export const useCustomersTransactionsColumns = () => { textOverview: true, width: getColumnWidth(tableRows, 'cells[7].value', { minWidth: 120, - magicSpacing: 10, + magicSpacing: 12, }), align: Align.Right, + money: true, }, ], [tableRows], diff --git a/packages/webapp/src/containers/FinancialStatements/InventoryItemDetails/utils.tsx b/packages/webapp/src/containers/FinancialStatements/InventoryItemDetails/utils.tsx index 1ca58cfe64..d1fc6c7c44 100644 --- a/packages/webapp/src/containers/FinancialStatements/InventoryItemDetails/utils.tsx +++ b/packages/webapp/src/containers/FinancialStatements/InventoryItemDetails/utils.tsx @@ -29,6 +29,7 @@ const numericColumn = R.curry((data, index, column) => ({ }), disableSortBy: true, align: Align.Right, + money: true, })); const columnsMapper = R.curry((data, index, column) => ({ diff --git a/packages/webapp/src/containers/FinancialStatements/InventoryValuation/dynamicColumns.ts b/packages/webapp/src/containers/FinancialStatements/InventoryValuation/dynamicColumns.ts index f0bf677ee4..2a05407e57 100644 --- a/packages/webapp/src/containers/FinancialStatements/InventoryValuation/dynamicColumns.ts +++ b/packages/webapp/src/containers/FinancialStatements/InventoryValuation/dynamicColumns.ts @@ -41,6 +41,7 @@ const numericColumnAccessor = R.curry((data, column) => { return { ...column, align: Align.Right, + money: true, width, }; }); diff --git a/packages/webapp/src/containers/FinancialStatements/ProfitLossSheet/dynamicColumns.tsx b/packages/webapp/src/containers/FinancialStatements/ProfitLossSheet/dynamicColumns.tsx index 0c33d05f50..05e8ec2cb0 100644 --- a/packages/webapp/src/containers/FinancialStatements/ProfitLossSheet/dynamicColumns.tsx +++ b/packages/webapp/src/containers/FinancialStatements/ProfitLossSheet/dynamicColumns.tsx @@ -3,7 +3,6 @@ import * as R from 'ramda'; import { isEmpty } from 'lodash'; import { Align } from '@/constants'; -import { CellTextSpan } from '@/components/Datatable/Cells'; import { getColumnWidth } from '@/utils'; const getTableCellValueAccessor = (index) => `cells[${index}].value`; @@ -34,6 +33,7 @@ const percentageOfIncomeAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -52,6 +52,7 @@ const percentageOfExpenseAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -70,6 +71,7 @@ const percentageOfColumnAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -88,6 +90,7 @@ const percentageOfRowAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -106,6 +109,7 @@ const previousYearAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -124,6 +128,7 @@ const previousYearChangeAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -142,6 +147,7 @@ const previousYearPercentageAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -160,6 +166,7 @@ const previousPeriodAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -178,6 +185,7 @@ const previousPeriodChangeAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -196,6 +204,7 @@ const previousPeriodPercentageAccessor = R.curry((data, column) => { align: Align.Right, disableSortBy: true, textOverview: true, + money: true }; }); @@ -274,10 +283,10 @@ const totalColumn = R.curry((data, column) => { Header: column.label, accessor, textOverview: true, - Cell: CellTextSpan, width, disableSortBy: true, align: hasChildren ? Align.Center : Align.Right, + money: true }; }); @@ -338,6 +347,7 @@ const dateRangeColumn = R.curry((data, column) => { disableSortBy: true, textOverview: true, align: isDateColumnHasColumns ? Align.Center : Align.Right, + money: true }; return R.compose( R.when( diff --git a/packages/webapp/src/containers/FinancialStatements/PurchasesByItems/dynamicColumns.ts b/packages/webapp/src/containers/FinancialStatements/PurchasesByItems/dynamicColumns.ts index 48712e5b7c..8f162cb4f6 100644 --- a/packages/webapp/src/containers/FinancialStatements/PurchasesByItems/dynamicColumns.ts +++ b/packages/webapp/src/containers/FinancialStatements/PurchasesByItems/dynamicColumns.ts @@ -41,6 +41,7 @@ const numericColumnAccessor = R.curry((data, column) => { ...column, align: Align.Right, width, + money: true }; }); diff --git a/packages/webapp/src/containers/FinancialStatements/SalesByItems/dynamicColumns.ts b/packages/webapp/src/containers/FinancialStatements/SalesByItems/dynamicColumns.ts index b71b4f7c54..451c363c7d 100644 --- a/packages/webapp/src/containers/FinancialStatements/SalesByItems/dynamicColumns.ts +++ b/packages/webapp/src/containers/FinancialStatements/SalesByItems/dynamicColumns.ts @@ -41,6 +41,7 @@ const numericColumnAccessor = R.curry((data, column) => { ...column, align: Align.Right, width, + money: true }; }); diff --git a/packages/webapp/src/containers/FinancialStatements/VendorsBalanceSummary/components.tsx b/packages/webapp/src/containers/FinancialStatements/VendorsBalanceSummary/components.tsx index 7bdf3a2042..9530b15b4d 100644 --- a/packages/webapp/src/containers/FinancialStatements/VendorsBalanceSummary/components.tsx +++ b/packages/webapp/src/containers/FinancialStatements/VendorsBalanceSummary/components.tsx @@ -49,6 +49,7 @@ const percentageColumnAccessor = () => ({ width: 140, textOverview: true, align: Align.Right, + money: true }); /** @@ -61,6 +62,7 @@ const totalColumnAccessor = () => ({ width: 140, textOverview: true, align: Align.Right, + money: true }); /** diff --git a/packages/webapp/src/containers/FinancialStatements/VendorsTransactions/components.tsx b/packages/webapp/src/containers/FinancialStatements/VendorsTransactions/components.tsx index 22c09d764d..58c9f81dfd 100644 --- a/packages/webapp/src/containers/FinancialStatements/VendorsTransactions/components.tsx +++ b/packages/webapp/src/containers/FinancialStatements/VendorsTransactions/components.tsx @@ -19,6 +19,7 @@ import { useVendorsTransactionsCsvExport, useVendorsTransactionsXlsxExport, } from '@/hooks/query'; +import { Align } from '@/constants'; /** * Retrieve vendors transactions columns. @@ -63,6 +64,8 @@ export const useVendorsTransactionsColumns = () => { minWidth: 100, magicSpacing: 10, }), + money: true, + align: Align.Right, }, { Header: intl.get('debit'), @@ -73,6 +76,8 @@ export const useVendorsTransactionsColumns = () => { minWidth: 100, magicSpacing: 10, }), + money: true, + align: Align.Right, }, { Header: intl.get('running_balance'), @@ -83,6 +88,8 @@ export const useVendorsTransactionsColumns = () => { minWidth: 120, magicSpacing: 10, }), + money: true, + align: Align.Right, }, ], [table], diff --git a/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/components.tsx b/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/components.tsx index 69f7a482c8..e3204b62f8 100644 --- a/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/components.tsx +++ b/packages/webapp/src/containers/Purchases/CreditNotes/CreditNotesLanding/components.tsx @@ -154,6 +154,7 @@ export function useVendorsCreditNoteTableColumns() { clickable: true, textOverview: true, disableSortBy: true, + money: true, className: clsx(CLASSES.FONT_BOLD), }, { diff --git a/packages/webapp/src/containers/Purchases/PaymentsMade/PaymentsLanding/components.tsx b/packages/webapp/src/containers/Purchases/PaymentsMade/PaymentsLanding/components.tsx index c7291d2224..0949545057 100644 --- a/packages/webapp/src/containers/Purchases/PaymentsMade/PaymentsLanding/components.tsx +++ b/packages/webapp/src/containers/Purchases/PaymentsMade/PaymentsLanding/components.tsx @@ -117,6 +117,7 @@ export function usePaymentMadesTableColumns() { className: 'amount', align: 'right', clickable: true, + money: true, }, { id: 'reference_no', diff --git a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentsLanding/components.tsx b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentsLanding/components.tsx index ac03aad54f..4c844863be 100644 --- a/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentsLanding/components.tsx +++ b/packages/webapp/src/containers/Sales/PaymentsReceived/PaymentsLanding/components.tsx @@ -113,6 +113,7 @@ export function usePaymentReceivesColumns() { align: 'right', clickable: true, textOverview: true, + money: true, className: clsx(CLASSES.FONT_BOLD), }, { diff --git a/packages/webapp/src/containers/Sales/Receipts/ReceiptsLanding/components.tsx b/packages/webapp/src/containers/Sales/Receipts/ReceiptsLanding/components.tsx index f26e18ac90..cf32e18451 100644 --- a/packages/webapp/src/containers/Sales/Receipts/ReceiptsLanding/components.tsx +++ b/packages/webapp/src/containers/Sales/Receipts/ReceiptsLanding/components.tsx @@ -160,6 +160,7 @@ export function useReceiptsTableColumns() { align: 'right', clickable: true, textOverview: true, + money: true, className: clsx(CLASSES.FONT_BOLD), }, {