Order voucher discounts are removed while fetching the OrderData - sap-commerce-cloud

I have below line of code to populate the order details page. For orders enjoying voucher discounts on executing the below line I notice the order, orderentry are modified. Also I notice the order entries discounts are removed thereby entry's discount is lost.
final OrderData orderData = b2bOrderFacade.getOrderDetailsForCode(orderCode);
Whats wrong with the above code? Why order is modified?
Hybris version: 5.3.0.6

Related

Netsuite System Notes for Contract Items

In NetSuite, I am trying to create a Saved Search report that shows field changes to individual contract line items. I will be using this report to reconstruct historical data, including pricing and quantities.
I have a Transaction Saved Search that shows me each contract and every contract line item. I have tried to include System Notes fields to pull in the field history, but it is only able to show me System Notes for the overall contract record (not the individual line items).
I also tried creating a System Notes Saved Search, which pulled the details I was looking for, but does not show me the Internal ID of the record (it shows me the "Record", which appears as a string - ex: "Contract #12345"). It also does not show me the ID of the contract line item, so even if I am able to join based on the Contract ID, I don't know which line items were affected.
If I navigate to the contract in NetSuite and look at the Items list, I am able to click the "History" button to see a list of changes - this is the information I am trying to pull. Is there any way to do this through a Saved Search?
Transaction item sublist history, is not yet exposed on the saved search/suitescript.
There might be an enhancement request for this use case.

Changing Qty of SOLine from a Different Page

I have a customization in which the user can adjust the quantity of an SO Line from a different page. This works perfectly, except when the user goes to execute the action "Create Shipment" for that SO. When "Create Shipment" executes, the shipment record created reflects the original values the user put in for the line's quantity instead of the adjusted quantity. Here is an example:
I created an order with original SO quantities of 10 and one respectively. I then changed the quantities to 8 and 5 respectively through my customization page:
This is the shipment I get when I select Actions -> Create Shipment:
I have looked through and adjusted any numbers misrepresenting the values I desired in the SQL tables SOOrder, SOLine, and SOLineSplit, but I still get the incorrect values when creating a shipment. Is there a table I am missing?
Sounds like the issue could be the PlanQty found on the related INItemPlan record which the Create Shipment process uses to create the shipment.
Might be worth looking into getting the SOLine updated via the SOOrderEntry graph or make sure the INItemPlan values are getting updated correctly. Maybe a missing view in your custom page. I think the values are updated from the attribute on PlanID of SOLineSplit if that helps.

Duplicate Entries Saved Search NetSuities

When doing a search I am getting duplicate invoices. So invoices can have both drop shipment and ship from factory. So I want to create a report that only shows the invoice for drop shipment and all other invoices if not drop shipped. So if one part is dropped ship show only that invoice and not the other invoice with the same invoice number. End result, the dropship invoice, and all other not dropped shipped, invoice can not be duplicate keep in mind a invoice can be both dropshipped and shipped from factory thus leading to double entries for these results. How do I go about ride of this duplication what must I add?
On the Criteria tab, select the filter named "Mainline". Set it to Yes if you only want one result for the transaction, or set it to No if you want one result for each line item on the transaction. Read the comments in the duplicate question for a more detailed explanation of how mainline works. It works the same in the UI and in SuiteScript.

Kentico - Adding multiple discounts

I'm using Kentico version 8.2, and am trying to allow a user to enter multiple coupons. In the ECommerceContext.CurrentShoppingCart object you have a ShoppingCartCouponCode that you can set. This then adds this coupon to the Discounts collection on that object.
If I change the ShoppingCartCouponCode to something else, then the Discount collection gets recreated with a single item of the new discount again, and loses the old discount.
If I store a copy of the discount collection, then apply the new coupon entered, and then append the copied collection to the new generated Discount collection then that works for only a couple of discounts. I am concerned that doing it this way will cause issues elsewhere.
So has anyone implemented this functionality before and how did/would you go about it?
EDIT: Although it seems like Product Coupons should allow you to do this, they don't work quite the way you would think. When a Product Coupon is applied to the cart, the ShoppingCartDiscountCouponID field for that cart's record in COM_ShoppingCart is updated to include a foreign key reference to the ID of discount coupon in COM_DiscountCoupon. So there can definitely be only one Product Coupon applied to the cart at any one time.
So instead of being a discount on a particular product, they seem to be more like flags that allow you to apply discounts to the entire cart if a particular product is in the cart and the correct coupon code is entered.
However, that doesn't mean we can't do some customization to achieve this affect ourselves. Our first step will be to change the ShoppingCartContent control in CMSModules > Ecommerce > Controls > ShoppingCart to allow multiple coupon codes to be entered. That's the easy part.
The second part is to change how discounts and carts are associated. This could require modifying Kentico's system tables, so do so at your own risk. You'll basically want to decouple foreign key reference from the COM_ShoppignCart table and create a many-to-many relationship between carts and discounts. Personally, I would leave the system tables and API alone and just create another custom table that mapped CartIDs to DiscountIDs (you will probably have to do the same with Orders, too since cart data is applied to order data when an order is created).
The last part is changing how discounts are actually calculated.
Earlier I suggested creating a custom DiscountCouponInfoProvider. Turns out, what you actually want to do is create a custom ShoppingCartInfoProvider and override one of the following methods:
CalculateOrderDiscount()
CalculateItemsDiscount()
I apologize if this isn't descriptive enough, but this will be a significant modification to how Kentico handles Product Coupons, so I don't have a lot of time to get into specifics. However, I would estimate that it would take a least a few weeks to accomplish.
old answer
Hmm, you could create discounts that represent combinations of two or more discounts and apply those if a user selects the right combination.
Or, what I would prefer if I had the time to build it, would be to create a custom DiscountCouponInfoProvider that changes how discounts are applied.M

Should the QOH in Stock Items (IN202500) decrease after shipment in Acumatica?

I have recently noticed that the field "Qty On Hand" in stock items (IN202500) under the Warehouse Details tab only decreased when the order has been invoiced. I am guessing this have something to do with the fact that the stock is being moved to the location. But isn't this incorrect since the stock would have been moved out of the warehouse from the shipment phase - hence why wait for the invoice part to occur? Does anybody have an explanation as to why it works this way? or whether it is a bug?
Thanks,
G
The quantity on hand will be updated only when the shipment has been confirmed, and the inventory issue document (IN Issue) has been released. Until then, the quantities will be held in a special bucket called SO Shipped.
Posting of the IN Issue occurs automatically when you release the invoice, but you can also force it to open by going to the shipment and doing Actions->Update IN
I don't know what do u want but here is hint you can do pre-invoice (quote invoice) and when move out of warehouse complete invoice and decrease QOH.

Resources