fix: transactions by customers/vendors report localization.

This commit is contained in:
a.bouhuolia
2021-08-07 08:14:10 +02:00
parent c21236c4ae
commit 37bbd66249
15 changed files with 175 additions and 109 deletions

View File

@@ -83,8 +83,8 @@ export default class TransactionsByCustomersService
*/
private async getCustomersPeriodsEntries(
tenantId: number,
fromDate: Date|string,
toDate: Date|string,
fromDate: Date | string,
toDate: Date | string
): Promise<ILedgerEntry[]> {
const transactions =
await this.reportRepository.getCustomersPeriodTransactions(
@@ -115,6 +115,8 @@ export default class TransactionsByCustomersService
// Settings tenant service.
const settings = this.tenancy.settings(tenantId);
const i18n = this.tenancy.i18n(tenantId);
const baseCurrency = settings.get({
group: 'organization',
key: 'base_currency',
@@ -127,7 +129,10 @@ export default class TransactionsByCustomersService
const accountsGraph = await accountRepository.getDependencyGraph();
// Retrieve the report customers.
const customers = await this.reportRepository.getCustomers(tenantId, filter.customersIds);
const customers = await this.reportRepository.getCustomers(
tenantId,
filter.customersIds
);
const openingBalanceDate = moment(filter.fromDate)
.subtract(1, 'days')
@@ -157,7 +162,8 @@ export default class TransactionsByCustomersService
accountsGraph,
journal,
filter,
baseCurrency
baseCurrency,
i18n
);
return {