mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-27 18:19:48 +00:00
fix(financial-statements): use stored date format settings in all reports
- Replace hardcoded date formats ('YYYY/MM/DD') in all Meta classes with meta.dateFormat
- Add IFinancialReportMeta interface with baseCurrency and dateFormat fields
- Add DEFAULT_REPORT_META constant with default date format 'YYYY MMM DD'
- Update all sheet classes to accept IFinancialReportMeta parameter
- Update all services to pass dateFormat from meta to sheet constructors
- Fix customer/vendor transactions date formatting in table rows
- Add TenancyModule to SalesTaxLiabilityModule for dependency injection
- Make dateFormat optional in JournalSheet and GeneralLedger query types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import { ARAgingSummaryRepository } from './ARAgingSummaryRepository';
|
||||
import { Customer } from '@/modules/Customers/models/Customer';
|
||||
import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
||||
import { ARAgingSummaryQueryDto } from './ARAgingSummaryQuery.dto';
|
||||
import { IFinancialReportMeta, DEFAULT_REPORT_META } from '../../types/Report.types';
|
||||
|
||||
export class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
readonly query: ARAgingSummaryQueryDto;
|
||||
@@ -32,16 +33,19 @@ export class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
* Constructor method.
|
||||
* @param {ARAgingSummaryQueryDto} query - Query
|
||||
* @param {ARAgingSummaryRepository} repository - Repository.
|
||||
* @param {IFinancialReportMeta} meta - Report meta.
|
||||
*/
|
||||
constructor(
|
||||
query: ARAgingSummaryQueryDto,
|
||||
repository: ARAgingSummaryRepository,
|
||||
meta: IFinancialReportMeta,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.query = query;
|
||||
this.repository = repository;
|
||||
this.numberFormat = this.query.numberFormat;
|
||||
this.dateFormat = meta.dateFormat || DEFAULT_REPORT_META.dateFormat;
|
||||
|
||||
this.overdueInvoicesByContactId =
|
||||
this.repository.overdueInvoicesByContactId;
|
||||
|
||||
Reference in New Issue
Block a user