parent
4ac661fb94
commit
8d5f2fd91d
@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Improved the language localization for German (`de`)
|
- Improved the language localization for German (`de`)
|
||||||
- Upgraded `prisma` from version `5.7.1` to `5.8.1`
|
- Upgraded `prisma` from version `5.7.1` to `5.8.1`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in the performance calculation with the currency conversion of fees
|
||||||
|
|
||||||
## 2.41.0 - 2024-01-16
|
## 2.41.0 - 2024-01-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@ -3034,7 +3038,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed an issue with the user currency of the public page
|
- Fixed an issue with the user currency of the public page
|
||||||
- Fixed an issue of the performance calculation with recent activities in the new calculation engine
|
- Fixed an issue in the performance calculation with recent activities in the new calculation engine
|
||||||
|
|
||||||
## 1.127.0 - 16.03.2022
|
## 1.127.0 - 16.03.2022
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ import Big from 'big.js';
|
|||||||
import { PortfolioOrder } from './portfolio-order.interface';
|
import { PortfolioOrder } from './portfolio-order.interface';
|
||||||
|
|
||||||
export interface PortfolioOrderItem extends PortfolioOrder {
|
export interface PortfolioOrderItem extends PortfolioOrder {
|
||||||
|
feeInBaseCurrency?: Big;
|
||||||
|
feeInBaseCurrencyWithCurrencyEffect?: Big;
|
||||||
itemType?: '' | 'start' | 'end';
|
itemType?: '' | 'start' | 'end';
|
||||||
unitPriceInBaseCurrency?: Big;
|
unitPriceInBaseCurrency?: Big;
|
||||||
unitPriceInBaseCurrencyWithCurrencyEffect?: Big;
|
unitPriceInBaseCurrencyWithCurrencyEffect?: Big;
|
||||||
|
@ -1266,6 +1266,7 @@ export class PortfolioCalculator {
|
|||||||
date: format(start, DATE_FORMAT),
|
date: format(start, DATE_FORMAT),
|
||||||
dataSource: null,
|
dataSource: null,
|
||||||
fee: new Big(0),
|
fee: new Big(0),
|
||||||
|
feeInBaseCurrency: new Big(0),
|
||||||
itemType: 'start',
|
itemType: 'start',
|
||||||
name: '',
|
name: '',
|
||||||
quantity: new Big(0),
|
quantity: new Big(0),
|
||||||
@ -1279,6 +1280,7 @@ export class PortfolioCalculator {
|
|||||||
date: format(end, DATE_FORMAT),
|
date: format(end, DATE_FORMAT),
|
||||||
dataSource: null,
|
dataSource: null,
|
||||||
fee: new Big(0),
|
fee: new Big(0),
|
||||||
|
feeInBaseCurrency: new Big(0),
|
||||||
itemType: 'end',
|
itemType: 'end',
|
||||||
name: '',
|
name: '',
|
||||||
quantity: new Big(0),
|
quantity: new Big(0),
|
||||||
@ -1306,6 +1308,7 @@ export class PortfolioCalculator {
|
|||||||
date: format(day, DATE_FORMAT),
|
date: format(day, DATE_FORMAT),
|
||||||
dataSource: null,
|
dataSource: null,
|
||||||
fee: new Big(0),
|
fee: new Big(0),
|
||||||
|
feeInBaseCurrency: new Big(0),
|
||||||
name: '',
|
name: '',
|
||||||
quantity: new Big(0),
|
quantity: new Big(0),
|
||||||
type: TypeOfOrder.BUY,
|
type: TypeOfOrder.BUY,
|
||||||
@ -1369,6 +1372,13 @@ export class PortfolioCalculator {
|
|||||||
: unitPriceAtStartDate;
|
: unitPriceAtStartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (order.fee) {
|
||||||
|
order.feeInBaseCurrency = order.fee.mul(currentExchangeRate ?? 1);
|
||||||
|
order.feeInBaseCurrencyWithCurrencyEffect = order.fee.mul(
|
||||||
|
exchangeRateAtOrderDate ?? 1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (order.unitPrice) {
|
if (order.unitPrice) {
|
||||||
order.unitPriceInBaseCurrency = order.unitPrice.mul(
|
order.unitPriceInBaseCurrency = order.unitPrice.mul(
|
||||||
currentExchangeRate ?? 1
|
currentExchangeRate ?? 1
|
||||||
@ -1468,10 +1478,10 @@ export class PortfolioCalculator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fees = fees.plus(order.fee);
|
fees = fees.plus(order.feeInBaseCurrency ?? 0);
|
||||||
|
|
||||||
feesWithCurrencyEffect = feesWithCurrencyEffect.plus(
|
feesWithCurrencyEffect = feesWithCurrencyEffect.plus(
|
||||||
order.fee.mul(exchangeRateAtOrderDate ?? 1)
|
order.feeInBaseCurrencyWithCurrencyEffect ?? 0
|
||||||
);
|
);
|
||||||
|
|
||||||
totalUnits = totalUnits.plus(
|
totalUnits = totalUnits.plus(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user