From 5e45926896caf9557a758247868e63ff11f2b3d9 Mon Sep 17 00:00:00 2001 From: DominikNoga Date: Fri, 10 May 2024 12:31:16 +0200 Subject: [PATCH] Added requisitionless orders filtering --- src/order-view/messages_en.json | 2 +- src/order-view/order-view.controller.js | 16 ++++++++++++++++ src/order-view/order-view.html | 8 +++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/order-view/messages_en.json b/src/order-view/messages_en.json index f40ec9e..eb98bb4 100644 --- a/src/order-view/messages_en.json +++ b/src/order-view/messages_en.json @@ -1,4 +1,4 @@ { "orderView.view": "View details", - "orderView.isRequisitionless": "Requisitionless" + "orderView.requisitionless": "Requisitionless" } \ No newline at end of file diff --git a/src/order-view/order-view.controller.js b/src/order-view/order-view.controller.js index 3fd4a6b..c34f492 100644 --- a/src/order-view/order-view.controller.js +++ b/src/order-view/order-view.controller.js @@ -150,6 +150,17 @@ */ vm.tableConfig = undefined; + /** + * @ngdoc property + * @propertyOf order-view.controller:OrderViewController + * @name requisitionless + * @type {boolean} + * + * @description + * Sets requisitionless flag + */ + vm.requisitionless = undefined; + /** * @ngdoc method * @methodOf order-view.controller:OrderViewController @@ -195,6 +206,10 @@ vm.periodEndDate = $stateParams.periodEndDate; } + if ($stateParams.requisitionless) { + vm.requisitionless = $stateParams.requisitionless; + } + if ($stateParams.status) { vm.status = vm.orderStatuses.filter(function(status) { return $stateParams.status === status.value; @@ -236,6 +251,7 @@ stateParams.periodStartDate = vm.periodStartDate ? $filter('isoDate')(vm.periodStartDate) : null; stateParams.periodEndDate = vm.periodEndDate ? $filter('isoDate')(vm.periodEndDate) : null; stateParams.sort = 'createdDate,desc'; + stateParams.requisitionless = vm.requisitionless; $state.go('openlmis.orders.view', stateParams, { reload: true diff --git a/src/order-view/order-view.html b/src/order-view/order-view.html index 8ce62dc..9d1c618 100644 --- a/src/order-view/order-view.html +++ b/src/order-view/order-view.html @@ -20,10 +20,12 @@

{{'orderView.viewOrders' | message}}

- - +
+ + +
- + \ No newline at end of file