Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed Shipment Method Orders in Netsuite Feeds #9

Open
Shinde-nutan opened this issue Jan 7, 2025 · 1 comment · May be fixed by #21
Open

Mixed Shipment Method Orders in Netsuite Feeds #9

Shinde-nutan opened this issue Jan 7, 2025 · 1 comment · May be fixed by #21
Assignees

Comments

@Shinde-nutan
Copy link
Contributor

We are encountering an issue in the generate#CreateOrderFeed service where orders containing mixed shipment methods are being included in both "include" and "exclude" feeds during the generation of order feeds for NetSuite.

Context:

  1. The service uses the EligibleOrdersForNetSuiteView to fetch eligible orders based on conditions such as:
    • orderId
    • fromOrderDate and thruOrderDate
    • includeShipmentMethod (e.g., POS_COMPLETED)
    • excludeShipmentMethod (e.g., POS_COMPLETED)
  2. Orders are scheduled for processing in two scenarios:
    • Include Feed: Includes orders with POS_COMPLETED shipment methods.
    • Exclude Feed: Excludes orders with POS_COMPLETED shipment methods.

Problem:

For orders with mixed shipment methods (e.g., one order item has POS_COMPLETED, and another has STANDARD), the order satisfies the conditions for both scenarios:

  • It gets included in the Include Feed because it has an item with the POS_COMPLETED shipment method.
  • It gets included in the Exclude Feed because it also contains an item with a different shipment method.

This leads to making this order eligible in both feeds.

Root Cause:

  • The current logic in the EligibleOrdersForNetSuiteView operates at the OrderHeader level and does not differentiate orders based on their item-level shipment methods.
  • The conditions applied (IN or NOT IN for shipment methods) are evaluated at the order level, causing mixed shipment method orders to match both include and exclude criteria.
@Shinde-nutan Shinde-nutan self-assigned this Jan 9, 2025
@dt2patel
Copy link
Contributor

For this situation of mixed cart orders, where an order can have POS Completed items and Standard items we'd want that order to only be included in the Sales Order feed, not in the Cash Sale feed. To achieve this, I think in the EligibleOrdersForNetSuiteView entity we should include the count of distinct shipping methods. If there are more than 1 then the order is not eligible for POS completed feed.

@Shinde-nutan Shinde-nutan linked a pull request Jan 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants