From 8de99bb8f55f5403887ddb29d7458b6cd6a02f95 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 24 May 2024 18:24:53 +0530 Subject: [PATCH 1/2] Implemented: support to unselect the action type for inventory rule --- src/locales/en.json | 1 + src/views/BrokeringQuery.vue | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 22b9cda..93c711f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -97,6 +97,7 @@ "No run history": "No run history", "No runs scheduled": "No runs scheduled", "No time zone found": "No time zone found", + "None": "None", "OMS": "OMS", "OMS instance": "OMS instance", "Order batches": "Order batches", diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 53a55bb..d32b9ea 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -259,6 +259,9 @@ {{ translate("Queue") }} + + {{ translate("None") }} + @@ -688,11 +691,13 @@ function updateOrderRouting(value: string) { function updateUnfillableActionType(value: string) { const actionType = ruleActionType.value ruleActionType.value = value - - inventoryRuleActions.value[ruleActionType.value] = { - actionTypeEnumId: value, - actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function - createdDate: DateTime.now().toMillis() + // Create the new action type only when we have not selected none option, otherwise just delete the previous selected action type + if(value) { + inventoryRuleActions.value[ruleActionType.value] = { + actionTypeEnumId: value, + actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function + createdDate: DateTime.now().toMillis() + } } // deleting previous action type, but using the data of previous action delete inventoryRuleActions.value[actionType] From 9ee109e6a2a12a94322d2d64c5468543a41288b5 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 24 May 2024 18:59:25 +0530 Subject: [PATCH 2/2] Implemented: support to make the rule action type to next rule by default --- src/locales/en.json | 1 - src/views/BrokeringQuery.vue | 25 +++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 93c711f..22b9cda 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -97,7 +97,6 @@ "No run history": "No run history", "No runs scheduled": "No runs scheduled", "No time zone found": "No time zone found", - "None": "None", "OMS": "OMS", "OMS instance": "OMS instance", "Order batches": "Order batches", diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index d32b9ea..0f3de0f 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -259,9 +259,6 @@ {{ translate("Queue") }} - - {{ translate("None") }} - @@ -666,6 +663,16 @@ async function addInventoryRule() { const routingRuleId = await store.dispatch("orderRouting/createRoutingRule", payload) if(routingRuleId) { + // Updating the rule action to NEXT_RULE by default after creation + await store.dispatch("orderRouting/updateRule", { + routingRuleId, + orderRoutingId: props.orderRoutingId, + actions: [{ + actionTypeEnumId: "ORA_NEXT_RULE", + actionValue: "", + createdDate: DateTime.now().toMillis() + }] + }) // TODO: Fix warning of duplicate keys when creating a new rule inventoryRules.value = sortSequence(JSON.parse(JSON.stringify(currentRouting.value["rules"]))) fetchRuleInformation(routingRuleId) @@ -691,13 +698,11 @@ function updateOrderRouting(value: string) { function updateUnfillableActionType(value: string) { const actionType = ruleActionType.value ruleActionType.value = value - // Create the new action type only when we have not selected none option, otherwise just delete the previous selected action type - if(value) { - inventoryRuleActions.value[ruleActionType.value] = { - actionTypeEnumId: value, - actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function - createdDate: DateTime.now().toMillis() - } + + inventoryRuleActions.value[ruleActionType.value] = { + actionTypeEnumId: value, + actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function + createdDate: DateTime.now().toMillis() } // deleting previous action type, but using the data of previous action delete inventoryRuleActions.value[actionType]