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: Transaction type and description do not show in general ledger. #596

Merged
merged 1 commit into from
Aug 12, 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
2 changes: 1 addition & 1 deletion packages/server/src/interfaces/GeneralLedgerSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface IGeneralLedgerSheetAccountTransaction {
currencyCode: string;
note?: string;

transactionType?: string;
transactionTypeFormatted: string;
transactionNumber: string;

referenceId?: number;
Expand Down
3 changes: 3 additions & 0 deletions packages/server/src/services/Accounting/Ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export default class Ledger implements ILedger {

transactionId: entry.referenceId,
transactionType: entry.referenceType,
transactionSubType: entry.transactionType,

transactionNumber: entry.transactionNumber,
referenceNumber: entry.referenceNumber,
Expand All @@ -262,6 +263,8 @@ export default class Ledger implements ILedger {

taxRateId: entry.taxRateId,
taxRate: entry.taxRate,

note: entry.note,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { FinancialSheetStructure } from '../FinancialSheetStructure';
import { flatToNestedArray } from '@/utils';
import Ledger from '@/services/Accounting/Ledger';
import { calculateRunningBalance } from './_utils';
import { getTransactionTypeLabel } from '@/utils/transactions-types';

/**
* General ledger sheet.
Expand Down Expand Up @@ -90,11 +91,13 @@ export default class GeneralLedgerSheet extends R.compose(
date: entry.date,
dateFormatted: moment(entry.date).format('YYYY MMM DD'),

transactionNumber: entry.transactionNumber,
referenceType: entry.referenceType,
referenceId: entry.referenceId,
referenceTypeFormatted: this.i18n.__(entry.referenceTypeFormatted),
referenceType: entry.transactionType,
referenceId: entry.transactionId,

transactionNumber: entry.transactionNumber,
transactionTypeFormatted: this.i18n.__(
getTransactionTypeLabel(entry.transactionType, entry.transactionSubType)
),
contactName: get(contact, 'displayName'),
contactType: get(contact, 'contactService'),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class GeneralLedgerTable extends R.compose(
return [
{ key: 'date', accessor: 'dateFormatted' },
{ key: 'account_name', accessor: 'account.name' },
{ key: 'reference_type', accessor: 'referenceTypeFormatted' },
{ key: 'reference_type', accessor: 'transactionTypeFormatted' },
{ key: 'reference_number', accessor: 'transactionNumber' },
{ key: 'description', accessor: 'note' },
{ key: 'credit', accessor: 'formattedCredit' },
Expand Down
Loading