diff --git a/src/openlmis-home-information-panel/_openlmis-home-information-panel.scss b/src/openlmis-home-information-panel/_openlmis-home-information-panel.scss deleted file mode 100644 index 4b9ab1a..0000000 --- a/src/openlmis-home-information-panel/_openlmis-home-information-panel.scss +++ /dev/null @@ -1,137 +0,0 @@ -.information-panel-wrapper { - margin-top: 1rem; - font-size: 14px; - width: 100%; - display: flex; - flex-direction: row; - - .header-section { - font-size: $font-size-large; - } - - .no-items-message { - margin-left: 0; - } - - .left-panel { - min-width: 668px; - - .header-section { - font-size: $font-size-large; - - &:nth-child(3) { - margin-top: 3rem; - } - } - - .stock-items-table { - border: #bebebe 1px solid; - - thead { - display: block; - tr { - th { - width: 325px; - background-color: #f0f0f0 !important; - color: #58585a; - background-image: none !important; - - &:nth-child(2) { - width: 150px; - } - &:nth-child(3) { - width: 150px; - } - } - } - } - - tbody { - overflow-y: scroll; - max-height: 369px; - display: block; - tr { - td { - width: 325px; - &:nth-child(2) { - width: 150px; - } - &:nth-child(3) { - width: 150px; - } - } - } - } - } - - .cce-items-table { - border: #bebebe 1px solid; - - thead { - display: block; - tr { - th { - width: 110px; - background-color: #f0f0f0 !important; - color: #58585a; - background-image: none !important; - &:nth-child(2) { - width: 130px; - } - &:nth-child(3) { - width: 140px; - } - &:nth-child(4) { - width: 100px; - } - &:nth-child(5) { - width: 145px; - } - } - } - } - - tbody { - overflow-y: scroll; - max-height: 369px; - display: block; - tr { - td { - width: 110px; - &:nth-child(2) { - width: 130px; - } - &:nth-child(3) { - width: 140px; - } - &:nth-child(4) { - width: 100px; - } - &:nth-child(5) { - width: 145px; - } - } - } - } - } - } - - .right-panel { - min-width: 668px; - - .information-panel-table { - border: #bebebe 1px solid; - .header-element { - background-color: #f0f0f0; - color: #58585a; - background-image: none; - } - } - } - - .show-number-items { - color: #333333; - font-size: 1em; - margin: 14px 0; - } -} diff --git a/src/openlmis-home-information-panel/messages_en.json b/src/openlmis-home-information-panel/messages_en.json deleted file mode 100644 index e3e7426..0000000 --- a/src/openlmis-home-information-panel/messages_en.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "homeInformationPanel.myPendingActions": "My Pending Actions", - "homeInformationPanel.pendings": "Pendings", - "homeInformationPanel.number": "Number", - "homeInformationPanel.actions": "Action", - "homeInformationPanel.requisitionsToBeApproved": "Requisition to be approved", - "homeInformationPanel.ordersToBeExecuted": "Orders to be executed", - "homeInformationPanel.ordersToBeReceived": "Orders to be received", - "homeInformationPanel.view": "View", - "homeInformationPanel.stockOnHand": "Stock on Hand", - "homeInformationPanel.cceStatus": "CCE Status", - "homeInformationPanel.product": "Product", - "homeInformationPanel.stockDoses": "Stock (Doses)", - "homeInformationPanel.firstExpireDate": "First Expiry Date", - "homeInformationPanel.equipment": "Equipment", - "homeInformationPanel.serialNumber": "Serial N'", - "homeInformationPanel.brand": "Brand", - "homeInformationPanel.capacity": "Capacity", - "homeInformationPanel.status": "Status", - "homeInformationPanel.liters": "liters", - "homeInformationPanel.noCceItemsFound": "No CCE Items found", - "homeInformationPanel.NoStockItemsFound": "No Stock on Hand Items found", - "homeInformationPanel.showingItems": "Showing ${number} item(s)" -} diff --git a/src/openlmis-home-information-panel/openlmis-home-information-panel.component.js b/src/openlmis-home-information-panel/openlmis-home-information-panel.component.js deleted file mode 100644 index 967a8b9..0000000 --- a/src/openlmis-home-information-panel/openlmis-home-information-panel.component.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This program is part of the OpenLMIS logistics management information system platform software. - * Copyright © 2017 VillageReach - * - * This program is free software: you can redistribute it and/or modify it under the terms - * of the GNU Affero General Public License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - *   - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  - * See the GNU Affero General Public License for more details. You should have received a copy of - * the GNU Affero General Public License along with this program. If not, see - * http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org.  - */ - -(function() { - 'use strict'; - - angular - .module('openlmis-home-information-panel') - .component('openlmisHomeInformationPanel', { - bindings: {}, - controller: 'openlmisHomeInformationPanelController', - controllerAs: 'vm', - templateUrl: 'openlmis-home-information-panel/openlmis-home-information-panel.html' - }); -}()); diff --git a/src/openlmis-home-information-panel/openlmis-home-information-panel.controller.js b/src/openlmis-home-information-panel/openlmis-home-information-panel.controller.js deleted file mode 100644 index 9885f60..0000000 --- a/src/openlmis-home-information-panel/openlmis-home-information-panel.controller.js +++ /dev/null @@ -1,140 +0,0 @@ -/* - * This program is part of the OpenLMIS logistics management information system platform software. - * Copyright © 2017 VillageReach - * - * This program is free software: you can redistribute it and/or modify it under the terms - * of the GNU Affero General Public License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - *   - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  - * See the GNU Affero General Public License for more details. You should have received a copy of - * the GNU Affero General Public License along with this program. If not, see - * http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org.  - */ - -(function() { - 'use strict'; - - angular - .module('openlmis-home-information-panel') - .controller('openlmisHomeInformationPanelController', controller); - - controller.$inject = ['$state', 'requisitionService', 'orderCreateService', 'localStorageService', - 'inventoryItemService', 'StockCardSummaryRepository', 'StockCardSummaryRepositoryImpl', - 'loadingModalService', '$scope']; - - function controller($state, requisitionService, orderCreateService, localStorageService, - inventoryItemService, StockCardSummaryRepository, StockCardSummaryRepositoryImpl, - loadingModalService, $scope) { - var vm = this; - - vm.redirectToRequisitionApprove = redirectToRequisitionApprove; - vm.redirectToFulfillOrders = redirectToFulfillOrders; - vm.redirectToPodManage = redirectToPodManage; - - vm.homeFacility = undefined; - vm.numbersForApproval = undefined; - vm.numbersOfOrders = undefined; - vm.stockOnHandItems = []; - vm.stockOnHandItemsLength = undefined; - vm.cceItems = []; - vm.cceItemsLength = undefined; - - vm.$onInit = onInit; - - function onInit() { - loadingModalService.open(); - var numbersApproval; - vm.homeFacility = JSON.parse(localStorageService.get('homeFacility')); - - orderCreateService.numberOfOrdersData().then(function(fetchedData) { - vm.numbersOfOrders = fetchedData; - - }); - - $scope.$applyAsync(function() { - numbersApproval = requisitionService.getNumbersForApproval(); - }); - - numbersApproval = requisitionService.forApproval().then(function(fetchedData) { - vm.numbersForApproval = fetchedData.numberOfElements; - loadingModalService.close(); - }); - - console.log(vm.numbersForApproval, numbersApproval); - - fetchCCEInventory(); - fetchStockOnHand(); - } - - function fetchStockOnHand() { - loadingModalService.open(); - var facilityPrograms = vm.homeFacility.supportedPrograms; - - angular.forEach(facilityPrograms, function(program) { - var params = { - facilityId: vm.homeFacility.id, - programId: program.id - }; - new StockCardSummaryRepository(new StockCardSummaryRepositoryImpl()) - .query(params) - .then(function(stockCardSummary) { - angular.forEach(stockCardSummary.content, function(stockItem) { - var sohItems = stockItem.canFulfillForMe; - if (sohItems.length > 0) { - sohItems.sort(function(a, b) { - return a.lot.expirationDate - b.lot.expirationDate; - }); - var earliestDate = sohItems.length > 0 ? sohItems[0].lot.expirationDate : null; - - vm.stockOnHandItems.push({ - name: stockItem.orderable.fullProductName, - stockOnHand: stockItem.stockOnHand, - firstExpiryDate: earliestDate - }); - vm.stockOnHandItemsLength = vm.stockOnHandItems.length; - } - }); - }); - }); - - return vm.stockOnHandItems; - } - - function fetchCCEInventory() { - var facilityPrograms = vm.homeFacility.supportedPrograms; - - angular.forEach(facilityPrograms, function(program) { - var params = { - facilityId: vm.homeFacility.id, - programId: program.id, - cceItemsSize: 5 - }; - - inventoryItemService.query(params).then(function(items) { - if (items.content.length) { - angular.forEach(items.content, function(item) { - vm.cceItems.push(item); - }); - vm.cceItemsLength = items.content.length; - } - }); - }); - - return vm.cceItems; - } - - function redirectToRequisitionApprove() { - $state.go('openlmis.requisitions.approvalList'); - } - - function redirectToFulfillOrders() { - $state.go('openlmis.orders.fulfillment'); - } - - function redirectToPodManage() { - $state.go('openlmis.orders.podManage'); - } - } -})(); diff --git a/src/openlmis-home-information-panel/openlmis-home-information-panel.html b/src/openlmis-home-information-panel/openlmis-home-information-panel.html deleted file mode 100644 index ca1e04f..0000000 --- a/src/openlmis-home-information-panel/openlmis-home-information-panel.html +++ /dev/null @@ -1,119 +0,0 @@ -
-
-
-

- {{:: 'homeInformationPanel.stockOnHand' | message}} - {{vm.homeFacility.name}} -

-
-
-

- {{'homeInformationPanel.NoStockItemsFound' | message}} -

- - - - - - - - - - - - - - - -
{{:: 'homeInformationPanel.product' | message}}{{:: 'homeInformationPanel.stockDoses' | message}}{{:: 'homeInformationPanel.firstExpireDate' | message}}
{{item.name}}{{item.stockOnHand}}{{item.firstExpiryDate | openlmisDate}}
-
-
- {{:: 'homeInformationPanel.showingItems' | message:({number: vm.stockOnHandItems.length})}} -
-
-

- {{:: 'homeInformationPanel.cceStatus' | message}} - {{vm.homeFacility.name}} -

-
-
-

- {{'homeInformationPanel.noCceItemsFound' | message}} -

- - - - - - - - - - - - - - - - - - - -
{{:: 'homeInformationPanel.equipment' | message}}{{:: 'homeInformationPanel.serialNumber' | message}}{{:: 'homeInformationPanel.brand' | message}}{{:: 'homeInformationPanel.capacity' | message}}{{:: 'homeInformationPanel.status' | message}}
{{item.catalogItem.type}}{{item.equipmentTrackingId}}{{item.catalogItem.manufacturer}} {{item.catalogItem.model}}{{item.catalogItem.netVolume}} {{:: 'homeInformationPanel.liters' | message}}{{item.functionalStatus}}
-
-
- {{:: 'homeInformationPanel.showingItems' | message:({number: vm.cceItemsLength})}} -
-
-
-
-

- {{:: 'homeInformationPanel.myPendingActions' | message}} -

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
{{:: 'homeInformationPanel.pendings' | message}}{{:: 'homeInformationPanel.number' | message}}{{:: 'homeInformationPanel.actions' | message}}
{{:: 'homeInformationPanel.requisitionsToBeApproved' | message}}{{vm.numbersForApproval}} - -
{{:: 'homeInformationPanel.ordersToBeExecuted' | message}}{{vm.numbersOfOrders.ordersToBeExecuted}} - -
{{:: 'homeInformationPanel.ordersToBeReceived' | message}}{{vm.numbersOfOrders.ordersToBeReceived}} - -
-
-
-
diff --git a/src/openlmis-home-information-panel/openlmis-home-information-panel.module.js b/src/openlmis-home-information-panel/openlmis-home-information-panel.module.js deleted file mode 100644 index 7e5cd52..0000000 --- a/src/openlmis-home-information-panel/openlmis-home-information-panel.module.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This program is part of the OpenLMIS logistics management information system platform software. - * Copyright © 2017 VillageReach - * - * This program is free software: you can redistribute it and/or modify it under the terms - * of the GNU Affero General Public License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - *   - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  - * See the GNU Affero General Public License for more details. You should have received a copy of - * the GNU Affero General Public License along with this program. If not, see - * http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org.  - */ - -(function() { - 'use strict'; - - angular.module('openlmis-home-information-panel', [ - 'requisition', - 'requisition-order-create', - 'cce-inventory-item', - 'openlmis-pagination', - 'ui.router', - 'requisition' - ]); -})(); diff --git a/src/openlmis-home/home.html b/src/openlmis-home/home.html index 4874023..d7dd2bc 100644 --- a/src/openlmis-home/home.html +++ b/src/openlmis-home/home.html @@ -19,6 +19,5 @@