Skip to content

Commit

Permalink
Improved: logic to exclude tracking required and missing label orders (
Browse files Browse the repository at this point in the history
  • Loading branch information
k2maan committed Oct 17, 2023
1 parent d0f4518 commit 0515ff0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/views/Completed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,13 @@ export default defineComponent({
text: translate("Ship"),
handler: async () => {
let orderList = JSON.parse(JSON.stringify(this.completedOrders.list))
// if there are orders with tracking required and label image present
// orders with tracking required and missing label must be excluded
const trackingRequiredOrders = orderList.filter((order: any) => this.isTrackingRequiredForAnyShipmentPackage(order))
if (trackingRequiredOrders.length) {
const isTrackingCodeRequired = orderList.some((order: any) => order.missingLabelImage)
if (!isTrackingCodeRequired) {
orderList = trackingRequiredOrders
// filtering and excluding orders having missing label image with tracking required
const trackingRequiredAndMissingLabelOrders = trackingRequiredOrders.filter((order: any) => order.missingLabelImage).map((order: any) => order.orderId)
if (trackingRequiredAndMissingLabelOrders.length) {
orderList = orderList.filter((order: any) => !trackingRequiredAndMissingLabelOrders.includes(order.orderId))
}
}
Expand Down

0 comments on commit 0515ff0

Please sign in to comment.