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:
+1
@@ -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;
|
||||
|
||||
|
||||
+1
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
+1
@@ -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;
|
||||
}
|
||||
|
||||
+1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user