Openbravo Issue Tracking System - Modules
View Issue Details
0046394ModulesOMSpublic2021-04-28 13:372021-05-27 12:02
vmromanos 
Triage Omni OMS 
normalmajoralways
newopen 
5
 
 
0046394: Order Confirmation and discounts wrongly applied
The order confirmation process is applying discounts where it shouldn't.

Imagine an order has been registered and paid for a product, with a grand total amount of $100. It is registered with status "Not Confirmed", and the store decides to reject it.

The Order Confirmation process is run and another store is selected. In this store the product has a discount. Right now the system does:

1. It cancels & replace the order in the first store for $100 [OK]
2. It generates a new order in the store, but it includes a discount so the grand total amount < $100 [WRONG: the price should be the same as the original sales order]
In WhiteValley client:
0. Login with Openbravo user, change to role "The White Valley Group Admin" and Set it as Default.

1. Go to Role window, search for "The White Valley Group Admin" and set "Is Web Service Enabled" yes

2. Go to Physical Inventory window and create a new record for "Orhi Store - Warehouse". In Lines, enter 100 units of product "GPS handheld" and process the document.

Go to Organization window, select Posets Stores and set "White Valley Spain S.A" as Cross Store Organization

3. Call the external order loader with the following json. This will create an order in Posets Store in status "Not Confirmed", and without any discount:

{
  "messageId": "MessageId005",
  "posTerminal": "PS-1",
  "channel": "External",
  "data": [
    {
      "currency": "EUR",
      "payment": 135,
      "step": "create",
      "grossAmount": 135,
      "netAmount": 111.57,
      "documentStatus": "NC",
      "businessPartner": "WVG/C0002",
      "completeTicket": true,
      "lines": [
        {
          "product": "WVG/L0014",
          "qty": 1,
          "grossAmount": 135,
          "netAmount": 111.57,
          "taxAmount": 23.43,
          "taxLines": {
            "Entregas IVA 21%": {
              "rate": 21,
              "netAmount": 111.57,
              "taxAmount": 23.43
            }
          }
        },
      ],
      "taxes": {
        "Entregas IVA 21%": {
          "rate": 21,
          "grossAmount": 135,
          "netAmount": 111.57,
          "taxAmount": 23.43
        }
      }
    }
  ]
}

4. Go to Sales Order window and press Close button in this sales order. Select Reject so the status is changed to "Automatic Evaluation".

5. Now press "Run Order Confirmation" and select this order. The process is completed successfully

6. Check that the order has been closed and another order has been created for Posets Store for -135€ [OK]

7. Check a new order in "Not confirmed" status has been created for Orhi Store [OK], but the grand total is 121.5€ because a promotion has been applied. This is wrong and the new order(s) grand total amount should be equal to the original order.
DemoImprovementProgram
Issue History
2021-04-28 13:37vmromanosNew Issue
2021-04-28 13:37vmromanosAssigned To => Triage Finance
2021-04-28 14:08vmromanosSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22382#r22382
2021-05-27 12:02xplacescTag Attached: DemoImprovementProgram

There are no notes attached to this issue.