Index: src/stock-physical-inventory-draft/physical-inventory-draft.controller.js =================================================================== diff -u -N -r71a56909f72a67c2658497b0de966d117794f9b5 -r9cc26f358f5a08617ba5f8915e8f85f053632e6b --- src/stock-physical-inventory-draft/physical-inventory-draft.controller.js (.../physical-inventory-draft.controller.js) (revision 71a56909f72a67c2658497b0de966d117794f9b5) +++ src/stock-physical-inventory-draft/physical-inventory-draft.controller.js (.../physical-inventory-draft.controller.js) (revision 9cc26f358f5a08617ba5f8915e8f85f053632e6b) @@ -33,14 +33,14 @@ 'confirmDiscardService', 'chooseDateModalService', 'program', 'facility', 'draft', 'displayLineItemsGroup', 'confirmService', 'physicalInventoryService', 'MAX_INTEGER_VALUE', 'VVM_STATUS', 'reasons', 'stockReasonsCalculations', 'loadingModalService', '$window', - 'stockmanagementUrlFactory', 'accessTokenFactory', 'orderableGroupService']; + 'stockmanagementUrlFactory', 'accessTokenFactory', 'orderableGroupService', '$filter']; function controller($scope, $state, $stateParams, addProductsModalService, messageService, physicalInventoryFactory, notificationService, alertService, confirmDiscardService, chooseDateModalService, program, facility, draft, displayLineItemsGroup, confirmService, physicalInventoryService, MAX_INTEGER_VALUE, VVM_STATUS, reasons, stockReasonsCalculations, loadingModalService, $window, - stockmanagementUrlFactory, accessTokenFactory, orderableGroupService) { + stockmanagementUrlFactory, accessTokenFactory, orderableGroupService, $filter) { var vm = this; vm.$onInit = onInit; @@ -114,6 +114,17 @@ /** * @ngdoc property * @propertyOf stock-physical-inventory-draft.controller:PhysicalInventoryDraftController + * @name groupedCategories + * @type {Object} + * + * @description + * Holds line items grouped by category. + */ + vm.groupedCategories = false; + + /** + * @ngdoc property + * @propertyOf stock-physical-inventory-draft.controller:PhysicalInventoryDraftController * @name showVVMStatusColumn * @type {boolean} * @@ -381,6 +392,12 @@ var orderableGroups = orderableGroupService.groupByOrderableId(draft.lineItems); vm.showVVMStatusColumn = orderableGroupService.areOrderablesUseVvm(orderableGroups); + + $scope.$watchCollection(function() { + return vm.pagedLineItems; + }, function(newList) { + vm.groupedCategories = $filter('groupByProgramProductCategory')(newList, vm.program.id); + }, true); } /** Index: src/stock-physical-inventory-draft/physical-inventory-draft.html =================================================================== diff -u -N -ra8be4a11e5824f788f6390fabf4528443397da57 -r9cc26f358f5a08617ba5f8915e8f85f053632e6b --- src/stock-physical-inventory-draft/physical-inventory-draft.html (.../physical-inventory-draft.html) (revision a8be4a11e5824f788f6390fabf4528443397da57) +++ src/stock-physical-inventory-draft/physical-inventory-draft.html (.../physical-inventory-draft.html) (revision 9cc26f358f5a08617ba5f8915e8f85f053632e6b) @@ -38,7 +38,7 @@