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

Create detail screen for pre-order catalog #125

Closed
1 task
Dhiraj1405 opened this issue May 10, 2023 · 5 comments
Closed
1 task

Create detail screen for pre-order catalog #125

Dhiraj1405 opened this issue May 10, 2023 · 5 comments
Assignees

Comments

@Dhiraj1405
Copy link
Contributor

What is the motivation for adding/enhancing this feature?

The current product catalog auditing process for pre-order products is proving to be time-consuming and inefficient. Users are required to switch between multiple views, leading to difficulties in reconciling data accurately. To address this issue, we propose enhancing the auditing process by consolidating all necessary views into a single screen.

What are the acceptance criteria?

  1. Must have pre-sell eligibility view.
  2. Must have product's current product category view.
  3. Must have Shopify listing status view.
  4. Must have pre-order related jobs view.

Can you complete this feature request by yourself?

  • YES
  • NO

Additional information

Link to figma file:
(https://www.figma.com/file/wK5FMs4z2zXQR9VfHV9ycE/Dhiraj's-Ionic-6-Material-UI-Kit-(Community)?type=design&node-id=25387%3A127781&t=xx7jmyPJJrwLVDUD-1)

@adityasharma7
Copy link
Contributor

adityasharma7 commented May 17, 2023

image

Use Shopify API for variants to get the tags and metafields

Update: We will use Solr query on Graph QL files indexed

@adityasharma7
Copy link
Contributor

adityasharma7 commented May 17, 2023

image

Reserve Inventory -> reserveInventory field in ProductStore
Hold Pre-Order Physical Inventory -> ProductStoreSetting with enumId HOLD_PRORD_PHYCL_INV

Online ATP ->

onlineATP = WarehouseHelper.getValidInventoryCount(delegator, productDetails.productId, (prodCatalogCategoryAndProduct.productStoreId)

//validate:
            // if exclude preorder queue items setting enable, deduct the virtual queue from the atp
            // or If preorder/backorder queue exists return 0 as atp


            if (!StoreWorker.holdPreorderPhysicalInv(delegator, productStoreId) ||
                    (CsrOrderHelper.getOrderQueue(delegator, "PRE_ORDER_PARKING", productId) <= 0 &&
                            CsrOrderHelper.getOrderQueue(delegator, "BACKORDER_PARKING", productId) <= 0)) {
            //Get inventory (Total inv - minimumStock - product off at facility - facility off - product threshold - all the virtual facility queues)
            List<EntityExpr> cond = new ArrayList<>(UtilMisc.toList(EntityCondition.makeCondition("productId", productId),
                    EntityCondition.makeCondition("productStoreId", productStoreId),
                    EntityCondition.makeCondition(EntityCondition.makeCondition("allowBrokering", EntityOperator.EQUALS, null), EntityOperator.OR,
                            EntityCondition.makeCondition("allowBrokering", EntityOperator.EQUALS, "Y")),
                    EntityCondition.makeCondition("facilityGroupTypeId", EntityOperator.EQUALS, "SHOPIFY_GROUP_FAC")
            ));

            GenericValue productInventory = EntityQuery.use(delegator).select("atp").from("ProductFacilityAndGroupAtp").filterByDate("psfFromDate", "psfThruDate").where(cond).queryFirst();
            if (productInventory != null && productInventory.getBigDecimal("atp") != null) {
                BigDecimal atp = productInventory.getBigDecimal("atp");
                GenericValue productThreshold = EntityQuery.use(delegator).select("minimumStock").from("FacilityAndProductFacility").where("productId", productId, "facilityTypeId", "CONFIGURATION").queryFirst();
                if (productThreshold != null && UtilValidate.isNotEmpty(productThreshold.getBigDecimal("minimumStock"))) {
                    atp = atp.subtract(productThreshold.getBigDecimal("minimumStock"));
                }

                GenericValue productStore = ProductStoreWorker.getProductStore(productStoreId, delegator);
                //subtract all virtual queue counts from atp if hotwax not doing reservation
                if (productStore != null && !"N".equals(productStore.getString("reserveInventory"))) {
                long virtualQueueCount = CsrOrderHelper.getOrderQueue(delegator, null, productId);
                if (virtualQueueCount > 0) atp = atp.subtract(BigDecimal.valueOf(virtualQueueCount));
                }
                return Math.max(0, (Integer) ObjectType.simpleTypeConvert(atp, "Integer", null, null));




           // StoreWorker.holdPreorderPhysicalInv(delegator, productStoreId) gets the Product Store Setting 
          StoreWorker.getProductStoreSetting(delegator, productStoreId, "HOLD_PRORD_PHYCL_INV", "true")


         // CsrOrderHelper.getOrderQueue(delegator, "PRE_ORDER_PARKING", productId)
         // List<EntityExpr> exprs = new ArrayList<>();
            if (UtilValidate.isNotEmpty(productStoreId)) {
                exprs.add(EntityCondition.makeCondition("productStoreId", productStoreId));
            }
            if (UtilValidate.isNotEmpty(facilityId)) {
                exprs.add(EntityCondition.makeCondition("facilityId", facilityId));
            }
            if (UtilValidate.isNotEmpty(productId)) {
                exprs.add(EntityCondition.makeCondition("productId", productId));
            }
            exprs.add(EntityCondition.makeCondition("orderTypeId", "SALES_ORDER"));
            exprs.add(EntityCondition.makeCondition("itemStatusId", EntityOperator.NOT_IN, UtilMisc.toList("ITEM_CANCELLED", "ITEM_COMPLETED", "ITEM_REJECTED")));
            GenericValue virtualOrder = EntityQuery.use(delegator).from("VirtualFacilityOrderItemCount").select("itemCount").where(exprs).queryFirst();
            if (virtualOrder != null && UtilValidate.isNotEmpty(virtualOrder.get("itemCount"))) {
                count = virtualOrder.getBigDecimal("itemCount").intValue();
            }

Quantity on Hand ->

We could getProductInventoryAvailable service to get quantityOnHandTotal

inventoryAvailable.quantityOnHandTotal

Excluded ATP ->

We could use getProductInventoryAvailable service to get availableToPromiseTotal

excludedATP = (inventoryAvailable.availableToPromiseTotal - onlineATP)

We should have a single API returning this data.

@adityasharma7
Copy link
Contributor

adityasharma7 commented May 17, 2023

image

POID and estimated delivery date - performFind on ProductCategoryDcsnRsn.
Ordered & Available - solr-query solr query with poId, use quantity and availableToPromise field
Corresponding sales orders - solr-query on sales orders with correspondingPoId
Total PO item - solr-query on POs with item having current productid.
Total PO ATP - solr-query on POs with the sum of availableToPromise field.

PO items should be in created and approved status

Update: all the PO related queries will be from PreOrderPOItem entity

@adityasharma7
Copy link
Contributor

adityasharma7 commented May 17, 2023

image

Product has been accepted preorder from against
- fromDate of ProductCategoryMember
- active poId

Shopify - based upon the data received for Shopify listing card

Category - Solr query for variant has this info
Promise date - active purchase order arrival date

Eligible conditions:

  • Active PO

Below not required for this decision:

  • holdPreorderPhysicalInventory
  • reserveInventory 

@dt2patel
Copy link
Contributor

Implemented in #137, closing task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants