Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Don't show items with zero items in a location in the inventory by lo…
Browse files Browse the repository at this point in the history
…cation report.

Resolves #119
  • Loading branch information
jkleinsc committed Jul 20, 2015
1 parent b3a1946 commit ba2b98a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions app/inventory/reports/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,22 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number
currentLocation = parentLocation;
}
for (var id in location.items) {
this._addReportRow({
giftInKind: location.items[id].giftInKind,
inventoryItem: location.items[id].item,
quantity: location.items[id].quantity,
locations: [{
name: location.name
}],
totalCost: location.items[id].totalCost,
unitCost: location.items[id].unitCost
});
parentCount += this._getValidNumber(location.items[id].quantity);
locationCost += this._getValidNumber(location.items[id].totalCost);
this.incrementProperty('grandCost', this._getValidNumber(location.items[id].totalCost));
this.incrementProperty('grandQuantity', this._getValidNumber(location.items[id].quantity));
if (location.items[id].quantity > 0) {
this._addReportRow({
giftInKind: location.items[id].giftInKind,
inventoryItem: location.items[id].item,
quantity: location.items[id].quantity,
locations: [{
name: location.name
}],
totalCost: location.items[id].totalCost,
unitCost: location.items[id].unitCost
});
parentCount += this._getValidNumber(location.items[id].quantity);
locationCost += this._getValidNumber(location.items[id].totalCost);
this.incrementProperty('grandCost', this._getValidNumber(location.items[id].totalCost));
this.incrementProperty('grandQuantity', this._getValidNumber(location.items[id].quantity));
}
}
}.bind(this));
this._addTotalsRow('Total for %@: '.fmt(parentLocation), locationCost, parentCount);
Expand Down

0 comments on commit ba2b98a

Please sign in to comment.