@barchart/portfolio-api-common 1.0.181 → 1.0.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,7 +78,7 @@ module.exports = (() => {
|
|
|
78
78
|
this._dataActual.quantity = null;
|
|
79
79
|
this._dataActual.basisPrice = null;
|
|
80
80
|
|
|
81
|
-
if (this._single) {
|
|
81
|
+
if (this._single && items.length === 1) {
|
|
82
82
|
const item = items[0];
|
|
83
83
|
|
|
84
84
|
this._dataFormat.portfolio = item.portfolio.portfolio;
|
|
@@ -564,7 +564,7 @@ module.exports = (() => {
|
|
|
564
564
|
|
|
565
565
|
calculateUnrealizedPercent(group);
|
|
566
566
|
|
|
567
|
-
if (group.single) {
|
|
567
|
+
if (group.single && group._items.length === 1) {
|
|
568
568
|
const item = group._items[0];
|
|
569
569
|
|
|
570
570
|
actual.quantity = item.position.snapshot.open;
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1604,7 +1604,7 @@ module.exports = (() => {
|
|
|
1604
1604
|
this._dataActual.quantity = null;
|
|
1605
1605
|
this._dataActual.basisPrice = null;
|
|
1606
1606
|
|
|
1607
|
-
if (this._single) {
|
|
1607
|
+
if (this._single && items.length === 1) {
|
|
1608
1608
|
const item = items[0];
|
|
1609
1609
|
|
|
1610
1610
|
this._dataFormat.portfolio = item.portfolio.portfolio;
|
|
@@ -2090,7 +2090,7 @@ module.exports = (() => {
|
|
|
2090
2090
|
|
|
2091
2091
|
calculateUnrealizedPercent(group);
|
|
2092
2092
|
|
|
2093
|
-
if (group.single) {
|
|
2093
|
+
if (group.single && group._items.length === 1) {
|
|
2094
2094
|
const item = group._items[0];
|
|
2095
2095
|
|
|
2096
2096
|
actual.quantity = item.position.snapshot.open;
|