Skip to content

Commit

Permalink
Merge pull request #596 from bigcapitalhq/transaction-type-descriptio…
Browse files Browse the repository at this point in the history
…n-general-ledger

fix: Transaction type and description do not show in general ledger.
  • Loading branch information
abouolia authored Aug 12, 2024
2 parents 79cc09f + ff94d8d commit 3097d05
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
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

0 comments on commit 3097d05

Please sign in to comment.