|
|
|
@ -282,14 +282,13 @@ export class PortfolioService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
transactionPoints,
|
|
|
|
|
currency: this.request.user.Settings.settings.baseCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
portfolioCalculator.setTransactionPoints(transactionPoints);
|
|
|
|
|
|
|
|
|
|
const { items } = await this.getChart({
|
|
|
|
|
dateRange,
|
|
|
|
|
impersonationId,
|
|
|
|
@ -374,14 +373,13 @@ export class PortfolioService {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
transactionPoints,
|
|
|
|
|
currency: userCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
portfolioCalculator.setTransactionPoints(transactionPoints);
|
|
|
|
|
|
|
|
|
|
const portfolioStart = parseDate(
|
|
|
|
|
transactionPoints[0]?.date ?? format(new Date(), DATE_FORMAT)
|
|
|
|
|
);
|
|
|
|
@ -999,14 +997,13 @@ export class PortfolioService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
transactionPoints,
|
|
|
|
|
currency: this.request.user.Settings.settings.baseCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
portfolioCalculator.setTransactionPoints(transactionPoints);
|
|
|
|
|
|
|
|
|
|
const portfolioStart = parseDate(transactionPoints[0].date);
|
|
|
|
|
const startDate = this.getStartDate(dateRange, portfolioStart);
|
|
|
|
|
const currentPositions =
|
|
|
|
@ -1165,13 +1162,6 @@ export class PortfolioService {
|
|
|
|
|
types: withItems ? ['BUY', 'ITEM', 'SELL'] : ['BUY', 'SELL']
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
currency: userCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (accountBalanceItems?.length <= 0 && transactionPoints?.length <= 0) {
|
|
|
|
|
return {
|
|
|
|
|
chart: [],
|
|
|
|
@ -1193,7 +1183,13 @@ export class PortfolioService {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
portfolioCalculator.setTransactionPoints(transactionPoints);
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
transactionPoints,
|
|
|
|
|
currency: userCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const portfolioStart = min(
|
|
|
|
|
[
|
|
|
|
@ -1318,14 +1314,13 @@ export class PortfolioService {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const portfolioCalculator = new PortfolioCalculator({
|
|
|
|
|
transactionPoints,
|
|
|
|
|
currency: userCurrency,
|
|
|
|
|
currentRateService: this.currentRateService,
|
|
|
|
|
exchangeRateDataService: this.exchangeRateDataService,
|
|
|
|
|
orders: portfolioOrders
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
portfolioCalculator.setTransactionPoints(transactionPoints);
|
|
|
|
|
|
|
|
|
|
const portfolioStart = parseDate(
|
|
|
|
|
transactionPoints[0]?.date ?? format(new Date(), DATE_FORMAT)
|
|
|
|
|
);
|
|
|
|
|