diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectReportResultGrid.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectReportResultGrid.js index 440448299..62e1b61c4 100644 --- a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectReportResultGrid.js +++ b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Project/ProjectReportResultGrid.js @@ -439,7 +439,7 @@ Ext.define("PartKeepr.Components.Project.ProjectReportResultGrid", { }, processCheapestDistributorForProjectPart: function (projectPart) { - var cheapestDistributor = this.getCheapestDistributor(projectPart.getPart()); + var cheapestDistributor = this.getCheapestDistributor(projectPart.getPart(), projectPart.get("missing")); if (cheapestDistributor !== null) { @@ -450,7 +450,7 @@ Ext.define("PartKeepr.Components.Project.ProjectReportResultGrid", { projectPart.set("itemSum", projectPart.get("quantity") * projectPart.get("itemPrice")); } }, - getCheapestDistributor: function (part) + getCheapestDistributor: function (part, partCount) { var cheapestDistributor = null; var currentPrice; @@ -475,6 +475,11 @@ Ext.define("PartKeepr.Components.Project.ProjectReportResultGrid", { continue; } + if (activeDistributor.get("packagingUnit") > partCount) + { + continue; + } + currentPrice = parseFloat(activeDistributor.get("price")); if (currentPrice !== 0)