1
0

fix(server): use correct base currency in financial reports

Reports (Receivable Aging Summary, Payable Aging Summary, Inventory
Valuation, Sales Tax Liability Summary, Vendor Balance Summary) were
not assigning baseCurrency from meta in their constructors, causing
currency formatting to fall back to USD instead of the organization's
base currency.

Closes #1069

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Bouhuolia
2026-04-13 17:52:46 +02:00
parent 5944aa3972
commit a7a0a7fbe7
6 changed files with 6 additions and 2 deletions
@@ -38,6 +38,7 @@ export class APAgingSummarySheet extends AgingSummaryReport {
this.query = query;
this.repository = repository;
this.baseCurrency = meta.baseCurrency;
this.numberFormat = this.query.numberFormat;
this.dateFormat = meta.dateFormat || DEFAULT_REPORT_META.dateFormat;
@@ -44,6 +44,7 @@ export class ARAgingSummarySheet extends AgingSummaryReport {
this.query = query;
this.repository = repository;
this.baseCurrency = meta.baseCurrency;
this.numberFormat = this.query.numberFormat;
this.dateFormat = meta.dateFormat || DEFAULT_REPORT_META.dateFormat;
@@ -18,7 +18,7 @@ import { IARAgingSummaryCustomer } from '../ARAgingSummary/ARAgingSummary.types'
export abstract class AgingSummaryReport extends AgingReport {
readonly contacts: ModelObject<Customer | Vendor>[];
readonly agingPeriods: IAgingPeriod[] = [];
readonly baseCurrency: string;
public baseCurrency: string;
readonly query: IAgingSummaryQuery;
readonly overdueInvoicesByContactId: Record<
number,
@@ -33,6 +33,7 @@ export class InventoryValuationSheet extends FinancialSheet {
this.query = query;
this.repository = repository;
this.baseCurrency = meta.baseCurrency;
this.numberFormat = this.query.numberFormat;
this.dateFormat = meta.dateFormat || DEFAULT_REPORT_META.dateFormat;
}
@@ -31,6 +31,7 @@ export class SalesTaxLiabilitySummary extends FinancialSheet {
this.query = query;
this.repository = repository;
this.baseCurrency = meta.baseCurrency;
this.dateFormat = meta.dateFormat || DEFAULT_REPORT_META.dateFormat;
}
@@ -38,7 +38,7 @@ export class VendorBalanceSummaryService {
const reportInstance = new VendorBalanceSummaryReport(
this.vendorBalanceSummaryRepository,
filter,
{ baseCurrency: this.vendorBalanceSummaryRepository.baseCurrency, dateFormat: meta.dateFormat },
{ baseCurrency: meta.baseCurrency, dateFormat: meta.dateFormat },
);
// Triggers `onVendorBalanceSummaryViewed` event.