Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reorder 'debit' and 'credit' columns #516

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export class JournalSheetTable extends R.compose(
{ key: 'description', accessor: 'entry.note' },
{ key: 'account_code', accessor: 'entry.accountCode' },
{ key: 'account_name', accessor: 'entry.accountName' },
{ key: 'credit', accessor: 'entry.formattedCredit' },
{ key: 'debit', accessor: 'entry.formattedDebit' },
{ key: 'credit', accessor: 'entry.formattedCredit' },
];
};

Expand All @@ -67,8 +67,8 @@ export class JournalSheetTable extends R.compose(
{ key: 'description', accessor: 'note' },
{ key: 'account_code', accessor: 'accountCode' },
{ key: 'account_name', accessor: 'accountName' },
{ key: 'credit', accessor: 'formattedCredit' },
{ key: 'debit', accessor: 'formattedDebit' },
{ key: 'credit', accessor: 'formattedCredit' },
];
};

Expand All @@ -84,8 +84,8 @@ export class JournalSheetTable extends R.compose(
{ key: 'description', accessor: '_empty_' },
{ key: 'account_code', accessor: '_empty_' },
{ key: 'account_name', accessor: '_empty_' },
{ key: 'credit', accessor: 'formattedCredit' },
{ key: 'debit', accessor: 'formattedDebit' },
{ key: 'credit', accessor: 'formattedCredit' },
];
};

Expand All @@ -101,8 +101,8 @@ export class JournalSheetTable extends R.compose(
{ key: 'description', value: '' },
{ key: 'account_code', value: '' },
{ key: 'account_name', value: '' },
{ key: 'credit', value: '' },
{ key: 'debit', value: '' },
{ key: 'credit', value: '' },
];
};

Expand All @@ -118,8 +118,8 @@ export class JournalSheetTable extends R.compose(
{ key: 'description', label: 'Description' },
{ key: 'account_code', label: 'Acc. Code' },
{ key: 'account_name', label: 'Account' },
{ key: 'credit', label: 'Credit' },
{ key: 'debit', label: 'Debit' },
{ key: 'credit', label: 'Credit' },
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions packages/webapp/src/containers/Drawers/AccountDrawer/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ export const useAccountReadEntriesColumns = () => {
textOverview: true,
},
{
Header: intl.get('credit'),
accessor: isFCYCurrencyType
? 'formatted_fc_credit'
: 'formatted_credit',
Header: intl.get('debit'),
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
width: 80,
className: 'credit',
className: 'debit',
align: 'right',
textOverview: true,
},
{
Header: intl.get('debit'),
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
Header: intl.get('credit'),
accessor: isFCYCurrencyType
? 'formatted_fc_credit'
: 'formatted_credit',
width: 80,
className: 'debit',
className: 'credit',
align: 'right',
textOverview: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,30 @@ export const useManualJournalEntriesColumns = () => {
]
: []),
{
Header: intl.get('credit'),
accessor: 'credit',
Header: intl.get('debit'),
accessor: 'debit',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'credit', {
width: getColumnWidth(entries, 'debit', {
minWidth: 60,
magicSpacing: 5,
}),
disableResizable: true,
disableSortBy: true,
textOverview: true,
disableSortBy: true,
formatNumber: { noZero: true },
align: 'right',
},
{
Header: intl.get('debit'),
accessor: 'debit',
Header: intl.get('credit'),
accessor: 'credit',
Cell: FormatNumberCell,
width: getColumnWidth(entries, 'debit', {
width: getColumnWidth(entries, 'credit', {
minWidth: 60,
magicSpacing: 5,
}),
disableResizable: true,
textOverview: true,
disableSortBy: true,
textOverview: true,
formatNumber: { noZero: true },
align: 'right',
},
Expand Down
16 changes: 8 additions & 8 deletions packages/webapp/src/containers/JournalEntriesTable/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
],
[],
);
Expand Down
Loading