Skip to content

Commit

Permalink
Merge branch 'main' into #248
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Sep 30, 2024
2 parents a090796 + 6ba3594 commit 17e4ca9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VUE_APP_VIEW_SIZE=10
VUE_APP_PERMISSION_ID=
VUE_APP_DEFAULT_LOG_LEVEL="error"
VUE_APP_RULE_ENUMS={"QUEUE":{"id":"OIP_QUEUE","code":"facilityId"},"SHIPPING_METHOD":{"id":"OIP_SHIP_METH_TYPE","code":"shipmentMethodTypeId"},"PRIORITY":{"id":"OIP_PRIORITY","code":"priority"},"PROMISE_DATE":{"id":"OIP_PROMISE_DATE","code":"promiseDaysCutoff"},"SALES_CHANNEL":{"id":"OIP_SALES_CHANNEL","code":"salesChannelEnumId"},"ORIGIN_FACILITY_GROUP":{"id":"OIP_ORIGIN_FAC_GRP","code":"originFacilityGroupId"},"SHIP_BY":{"id":"OSP_SHIP_BY","code":"shipBeforeDate"},"SHIP_AFTER":{"id":"OSP_SHIP_AFTER","code":"shipAfterDate"},"ORDER_DATE":{"id":"OSP_ORDER_DATE","code":"orderDate"},"SHIPPING_METHOD_SORT":{"id":"OSP_SHIP_METH","code":"deliveryDays"},"SORT_PRIORITY":{"id":"OSP_PRIORITY","code":"priority"}}
VUE_APP_RULE_FILTER_ENUMS={"FACILITY_GROUP":{"id":"IIP_FACILITY_GROUP","code":"facilityGroupId"},"FACILITY_GROUP_EXCLUDED":{"id":"IIP_FACILITY_GROUP_EXCLUDED","code":"facilityGroupId_excluded"},"PROXIMITY":{"id":"IIP_PROXIMITY","code":"distance"},"BRK_SAFETY_STOCK":{"id":"IIP_BRK_SFTY_STOCK","code":"brokeringSafetyStock"},"MEASUREMENT_SYSTEM":{"id":"IIP_MSMNT_SYSTEM","code":"measurementSystem"},"SPLIT_ITEM_GROUP":{"id":"IIP_SPLIT_ITEM_GROUP","code":"splitOrderItemGroup"}}
VUE_APP_RULE_FILTER_ENUMS={"FACILITY_GROUP":{"id":"IIP_FACILITY_GROUP","code":"facilityGroupId"},"FACILITY_GROUP_EXCLUDED":{"id":"IIP_FACILITY_GROUP_EXCLUDED","code":"facilityGroupId_excluded"},"PROXIMITY":{"id":"IIP_PROXIMITY","code":"distance"},"BRK_SAFETY_STOCK":{"id":"IIP_BRK_SFTY_STOCK","code":"brokeringSafetyStock"},"MEASUREMENT_SYSTEM":{"id":"IIP_MSMNT_SYSTEM","code":"measurementSystem"},"SPLIT_ITEM_GROUP":{"id":"IIP_SPLIT_ITEM_GROUP","code":"splitOrderItemGroup"}, "FACILITY_ORDER_LIMIT": {"id":"IFP_IGNORE_ORD_FAC_LIMIT", "code":"ignoreFacilityOrderLimit"}}
VUE_APP_RULE_SORT_ENUMS={"PROXIMITY":{"id":"ISP_PROXIMITY","code":"distance"},"INV_BALANCE":{"id":"ISP_INV_BAL","code":"inventoryForAllocation"},"CUSTOMER_SEQ":{"id":"ISP_CUST_SEQ","code":"facilitySequence"}}
VUE_APP_RULE_ACTION_ENUMS={"RM_AUTO_CANCEL_DATE":{"id":"ORA_RM_CANCEL_DATE","code":"RM_AUTO_CANCEL_DATE"},"AUTO_CANCEL_DAYS":{"id":"ORA_AUTO_CANCEL_DAYS","code":"ADD_AUTO_CANCEL_DATE"},"NEXT_RULE":{"id":"ORA_NEXT_RULE","code":"NEXT_RULE"},"MOVE_TO_QUEUE":{"id":"ORA_MV_TO_QUEUE","code":"MOVE_TO_QUEUE"}}
VUE_APP_CRON_EXPRESSIONS={"Every 5 minutes":"0 */5 * ? * *","Every 15 minutes":"0 */15 * ? * *","Every 30 minutes":"0 */30 * ? * *","Hourly":"0 0 * ? * *","Every six hours":"0 0 */6 ? * *","Every day at midnight":"0 0 0 * * ?"}
Expand Down
4 changes: 1 addition & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
"Activate": "Activate",
"Add": "Add",
"Add filters": "Add filters",
"Add inventory lookup filters.": "Add inventory lookup filters.",
"Add inventory rule": "Add inventory rule",
"Add order filters.": "Add order filters.",
"Add sorting": "Add sorting",
"Add sorting rules.": "Add sorting rules.",
"All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.": "All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.",
"All orders in all parkings will be attempted if no filter is applied.": "All orders in all parkings will be attempted if no filter is applied.",
"Allow partial allocation": "Allow partial allocation",
Expand Down Expand Up @@ -177,6 +174,7 @@
"This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.": "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.",
"Timezone": "Timezone",
"Time zone updated successfully": "Time zone updated successfully",
"Turn of the facility order limit check": "Turn of the facility order limit check",
"Unarchive": "Unarchive",
"Unavailable items": "Unavailable items",
"Updated at": "Updated at",
Expand Down
37 changes: 28 additions & 9 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
</ion-button>
</ion-item-divider>
<p class="empty-state" v-if="!orderRoutingFilterOptions || !Object.keys(orderRoutingFilterOptions).length">
{{ translate("Add order filters.") }} <br /><br />
{{ translate("All orders in all parkings will be attempted if no filter is applied.") }}
<ion-button fill="clear" @click="addOrderRouteFilterOptions('ORD_FILTER_PRM_TYPE', 'ENTCT_FILTER', 'Filters')">
{{ translate("Add filters") }}
Expand Down Expand Up @@ -156,7 +155,6 @@
</ion-item-divider>
<!-- Added check for undefined as well as empty object, as on initial load there might be a case in which route sorting options are not available thus it will be undefined but when updating the values from the modal this will always return an object -->
<p class="empty-state" v-if="!orderRoutingSortOptions || !Object.keys(orderRoutingSortOptions).length">
{{ translate("Add sorting rules.") }} <br /><br />
{{ translate("Orders will be brokered based on order date if no sorting is specified.") }}
<ion-button fill="clear" @click="addOrderRouteFilterOptions('ORD_SORT_PARAM_TYPE', 'ENTCT_SORT_BY', 'Sort')">
{{ translate("Add sorting") }}
Expand Down Expand Up @@ -232,14 +230,13 @@
<ion-item>
<ion-icon slot="start" :icon="filterOutline"/>
<h4>{{ translate("Filters") }}</h4>
<ion-button v-if="inventoryRuleFilterOptions && Object.keys(inventoryRuleFilterOptions).length" slot="end" fill="clear" @click="addInventoryFilterOptions('INV_FILTER_PRM_TYPE', 'ENTCT_FILTER', 'Filters')">
<ion-button v-if="isInventoryRuleFiltersApplied()" slot="end" fill="clear" @click="addInventoryFilterOptions('INV_FILTER_PRM_TYPE', 'ENTCT_FILTER', 'Filters')">
<ion-icon slot="icon-only" :icon="optionsOutline"/>
</ion-button>
</ion-item>
<p class="empty-state" v-if="!inventoryRuleFilterOptions || !Object.keys(inventoryRuleFilterOptions).length">
{{ translate("Add inventory lookup filters.") }}<br /><br />
<p class="empty-state" v-if="!isInventoryRuleFiltersApplied()">
{{ translate("All facilities enabled for online fulfillment will be attempted for brokering if no filter is applied.") }}<br /><br />
<a target="_blank" rel="noopener noreferrer" href="https://docs.hotwax.co/documents/v/system-admins/administration/facilities/configure-fulfillment-capacity">{{ translate("Learn more") }}</a>{{ translate(" about enabling a facility for online fulfillment.") }}
<span><a target="_blank" rel="noopener noreferrer" href="https://docs.hotwax.co/documents/v/system-admins/administration/facilities/configure-fulfillment-capacity">{{ translate("Learn more") }}</a>{{ translate(" about enabling a facility for online fulfillment.") }}</span>
<ion-button fill="clear" @click="addInventoryFilterOptions('INV_FILTER_PRM_TYPE', 'ENTCT_FILTER', 'Filters')">
{{ translate("Add filters") }}
<ion-icon slot="end" :icon="optionsOutline"/>
Expand Down Expand Up @@ -285,6 +282,12 @@
<ion-chip outline @click="selectValue('BRK_SAFETY_STOCK', 'Add safety stock')">{{ getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue || getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue == 0 ? getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, "BRK_SAFETY_STOCK").fieldValue : "-" }}</ion-chip>
</div>
</ion-item>

<ion-item v-if="getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, 'FACILITY_ORDER_LIMIT')">
<ion-toggle :checked="getFilterValue(inventoryRuleFilterOptions, conditionFilterEnums, 'FACILITY_ORDER_LIMIT').fieldValue === 'Y'" @ionChange="updateRuleFilterValue($event, 'FACILITY_ORDER_LIMIT')">
{{ translate("Turn of the facility order limit check") }}
</ion-toggle>
</ion-item>
</ion-card>
<ion-card>
<ion-item>
Expand Down Expand Up @@ -322,7 +325,7 @@
{{ translate("Select if partial allocation should be allowed in this inventory rule") }}
</ion-card-content>
<ion-item lines="none">
<ion-toggle :disabled="isPromiseDateFilterApplied()" :checked="selectedRoutingRule.assignmentEnumId === 'ORA_MULTI' || isPromiseDateFilterApplied()" @ionChange="updatePartialAllocation($event.detail.checked)">{{ translate("Allow partial allocation") }}</ion-toggle>
<ion-toggle :disabled="isPromiseDateFilterApplied()" :checked="selectedRoutingRule.assignmentEnumId === 'ORA_MULTI'" @ionChange="updatePartialAllocation($event.detail.checked)">{{ translate("Allow partial allocation") }}</ion-toggle>
</ion-item>
<ion-item v-show="isPromiseDateFilterApplied()" lines="none">
<ion-label class="ion-text-wrap">
Expand Down Expand Up @@ -880,17 +883,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
}
Expand Down Expand Up @@ -950,6 +962,9 @@ async function selectPromiseFilterValue(ev: CustomEvent, type = "included") {
// Making partial allocation value to `MULTI` when applying promise date filter
updatePartialAllocation(true);
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, type === "excluded" ? "PROMISE_DATE_EXCLUDED" : "PROMISE_DATE").operator = "less-equals"
})
Expand Down Expand Up @@ -1013,7 +1028,11 @@ function updateOrderFilterValue(event: CustomEvent, id: string, multi = false) {
}
function updateRuleFilterValue(event: CustomEvent, id: string) {
inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.value
if(id === "FACILITY_ORDER_LIMIT") {
inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.checked ? "Y" : "N"
} else {
inventoryRuleFilterOptions.value[conditionFilterEnums[id].code].fieldValue = event.detail.value
}
updateRule()
}
Expand Down

0 comments on commit 17e4ca9

Please sign in to comment.