Openbravo Issue Tracking System - Modules
View Issue Details
0052296ModulesDiscounts Engine for Backendpublic2023-04-28 21:552023-05-22 09:56
sofidossant 
radhakrishnan 
highmajoralways
closedfixed 
5
 
 
approved
63268
OBPS
0052296: The api always returns the same result without checking if the filters are disabled.
The api always returns the same result without checking if the filters are disabled.
When I use the Free Products per Total Amount discount and I deactivate one of the Free products, the api applies it anyway.
Use the json
{
  "ticket": {
    "id":"79797C77BD274CEBBC4BE58037AB147B",
    "organization": {
 "id": "D270A5AC50874F8BA67A88EE977F8E3B",
                      "_identifier": "Vall Blanca Store"
                          },
    "businessPartner": {
                      "id": "ABD91C9D3BC94175B876FBBE9CACA008",
                      "_identifier": "VBS Customer"
    },
    "orderDate": "2023-03-20T11:54:21",
    "priceIncludesTax": true,
    "discountsFromUser": {},
    "lines": [
      {
        "id": "1",
        "product": {
                      "id": "DEC20EABF33944BA967E24EFF8C244B3",
                      "_identifier": "Torch CB1"
                              },
        "qty": 2,
        "baseGrossUnitPrice": 100
      }
    ]
  }
}

And then use
this discount https://livebuilds.openbravo.com/retail_modules_pgsql_pi/?tabId=800079&recordId=C055AAEEDE764B9B8B597BD45C59F03C [^]

Add the product, test and you can see the discount
Then you desactive the product, and see the discount equals
No tags attached.
related to defect 0052142 closed radhakrishnan When a Combo discount is used, it is not filtered if the family is active. 
Issue History
2023-04-28 21:55sofidossantNew Issue
2023-04-28 21:55sofidossantAssigned To => Triage Omni OMS
2023-04-28 21:55sofidossantSupport ticket => 63268
2023-04-28 21:55sofidossantOBNetwork customer => OBPS
2023-05-08 17:04aferrazAssigned ToTriage Omni OMS => radhakrishnan
2023-05-16 09:28aferrazRelationship addedrelated to 0052142
2023-05-18 07:48hgbotMerge Request Status => open
2023-05-18 07:48hgbotNote Added: 0149913
2023-05-22 09:56hgbotMerge Request Statusopen => approved
2023-05-22 09:56hgbotResolutionopen => fixed
2023-05-22 09:56hgbotStatusnew => closed
2023-05-22 09:56hgbotFixed in Version => RR23Q3
2023-05-22 09:56hgbotNote Added: 0150045
2023-05-22 09:56hgbotNote Added: 0150046

Notes
(0149913)
hgbot   
2023-05-18 07:48   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/104 [^]
(0150045)
hgbot   
2023-05-22 09:56   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: aa4b98613e3d964f4ca4ea79313006241142aba1
Author: Radhakrishnan Seeman <radhakrishnan@qualiantech.com>
Date: 22-05-2023 07:56:50
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/aa4b98613e3d964f4ca4ea79313006241142aba1 [^]

Fixed ISSUE-52296: Free products should not be applied in when it is in inactive

---
M src-test/org/openbravo/retail/discounts/test/base/model/definition/ByTotalAmountScaled.java
M src-test/org/openbravo/retail/discounts/test/base/model/definition/ByTotalFreeItems.java
M src-test/org/openbravo/retail/discounts/test/base/model/definition/ByTotalPercentageScaled.java
M src/org/openbravo/retail/discounts/ByTotalDataHook.java
---
(0150046)
hgbot   
2023-05-22 09:56   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/104 [^]