diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 22d7f98..0d96c3e 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -177,11 +177,11 @@

{{ translate("Filters") }}

- +
-

+

{{ translate("All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.") }}

{{ translate("Learn more") }}{{ translate(" about enabling a facility for online fulfillment.") }} @@ -257,8 +257,7 @@ {{ translate("Select if partial allocation should be allowed in this inventory rule") }} - - {{ translate("Allow partial allocation") }} + {{ translate("Allow partial allocation") }} @@ -808,17 +807,26 @@ function updatePartialAllocation(checked: any) { if(inventoryRule.routingRuleId === selectedRoutingRule.value.routingRuleId) { // Updating selected routing rule explicitely as we are using rulesForReorder for fetching selected values inventoryRule.assignmentEnumId = selectedRoutingRule.value.assignmentEnumId = checked ? "ORA_MULTI" : "ORA_SINGLE" + + // When enabling partial allocation, updating the value of partial group item allocation by default, + // as when partial allocation is enabled we are saying to partial allocate all items of orders thus need to make + // group items allocation enabled as well in this case. + updatePartialGroupItemsAllocation(checked) } }) hasUnsavedChanges.value = true } +function isInventoryRuleFiltersApplied() { + const ruleFilters = Object.keys(inventoryRuleFilterOptions.value).filter((rule: string) => rule !== conditionFilterEnums["SPLIT_ITEM_GROUP"].code); + return ruleFilters.length +} + function isPromiseDateFilterApplied() { if(!currentRouting.value["rules"]?.length) { return; } - // When user updates partial allocation and then selects promiseDate filter then we will assume that the user wants to change the value for partialAllocation on server and thus we will not revert any change made in the partial allocation action and update its value on server const filter = getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE") return filter?.fieldValue || filter?.fieldValue == 0 } @@ -876,6 +884,9 @@ async function selectPromiseFilterValue(ev: CustomEvent) { if(result.data?.duration || result.data?.duration == 0) { getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").fieldValue = result.data?.isPastDuration ? `-${result.data?.duration}` : result.data?.duration hasUnsavedChanges.value = true + + // When selecting promiseDate route filter value, we also need to enable partial allocation and make its value change on the server + updatePartialAllocation(true); } getFilterValue(orderRoutingFilterOptions.value, ruleEnums, "PROMISE_DATE").operator = "less-equals" })