fix: Reorder 'debit' and 'credit' columns

This commit is contained in:
Ahmed Bouhuolia
2024-06-24 10:43:34 +02:00
parent 7b4afd3859
commit 8e0911ec85
5 changed files with 39 additions and 39 deletions

View File

@@ -111,16 +111,16 @@ export const useJournalTableEntriesColumns = () => {
fieldProps: { allowCreate: true },
},
{
Header: CreditHeaderCell,
accessor: 'credit',
Header: DebitHeaderCell,
accessor: 'debit',
Cell: MoneyFieldCell,
disableSortBy: true,
width: 100,
align: Align.Right,
},
{
Header: DebitHeaderCell,
accessor: 'debit',
Header: CreditHeaderCell,
accessor: 'credit',
Cell: MoneyFieldCell,
disableSortBy: true,
width: 100,

View File

@@ -26,6 +26,14 @@ export const useAccountReadEntriesColumns = () => {
width: 100,
textOverview: true,
},
{
Header: intl.get('debit'),
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
width: 80,
className: 'debit',
align: 'right',
textOverview: true,
},
{
Header: intl.get('credit'),
accessor: isFCYCurrencyType
@@ -36,14 +44,6 @@ export const useAccountReadEntriesColumns = () => {
align: 'right',
textOverview: true,
},
{
Header: intl.get('debit'),
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
width: 80,
className: 'debit',
align: 'right',
textOverview: true,
},
],
[isFCYCurrencyType],
);

View File

@@ -82,20 +82,6 @@ export const useManualJournalEntriesColumns = () => {
},
]
: []),
{
Header: intl.get('credit'),
accessor: 'credit',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'credit', {
minWidth: 60,
magicSpacing: 5,
}),
disableResizable: true,
disableSortBy: true,
textOverview: true,
formatNumber: { noZero: true },
align: 'right',
},
{
Header: intl.get('debit'),
accessor: 'debit',
@@ -110,6 +96,20 @@ export const useManualJournalEntriesColumns = () => {
formatNumber: { noZero: true },
align: 'right',
},
{
Header: intl.get('credit'),
accessor: 'credit',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'credit', {
minWidth: 60,
magicSpacing: 5,
}),
disableResizable: true,
disableSortBy: true,
textOverview: true,
formatNumber: { noZero: true },
align: 'right',
},
],
[],
);

View File

@@ -25,14 +25,6 @@ export const useGLEntriesTableColumns = () => {
width: 140,
textOverview: true,
},
{
Header: intl.get('credit'),
accessor: ({ credit }) => credit.formatted_amount,
width: 100,
className: 'credit',
align: 'right',
textOverview: true,
},
{
Header: intl.get('debit'),
accessor: ({ debit }) => debit.formatted_amount,
@@ -41,6 +33,14 @@ export const useGLEntriesTableColumns = () => {
textOverview: true,
align: 'right',
},
{
Header: intl.get('credit'),
accessor: ({ credit }) => credit.formatted_amount,
width: 100,
className: 'credit',
align: 'right',
textOverview: true,
},
],
[],
);