|
@ -56,7 +56,7 @@ export class PortfolioCalculator { |
|
|
this.currentRateService = currentRateService; |
|
|
this.currentRateService = currentRateService; |
|
|
this.orders = orders; |
|
|
this.orders = orders; |
|
|
|
|
|
|
|
|
this.orders.sort((a, b) => a.date.localeCompare(b.date)); |
|
|
this.orders.sort((a, b) => a.date?.localeCompare(b.date)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public computeTransactionPoints() { |
|
|
public computeTransactionPoints() { |
|
@ -125,7 +125,7 @@ export class PortfolioCalculator { |
|
|
(transactionPointItem) => transactionPointItem.symbol !== order.symbol |
|
|
(transactionPointItem) => transactionPointItem.symbol !== order.symbol |
|
|
); |
|
|
); |
|
|
newItems.push(currentTransactionPointItem); |
|
|
newItems.push(currentTransactionPointItem); |
|
|
newItems.sort((a, b) => a.symbol.localeCompare(b.symbol)); |
|
|
newItems.sort((a, b) => a.symbol?.localeCompare(b.symbol)); |
|
|
if (lastDate !== currentDate || lastTransactionPoint === null) { |
|
|
if (lastDate !== currentDate || lastTransactionPoint === null) { |
|
|
lastTransactionPoint = { |
|
|
lastTransactionPoint = { |
|
|
date: currentDate, |
|
|
date: currentDate, |
|
|