Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037395Openbravo ERP07. Sales managementpublic2017-11-27 14:222018-01-03 12:39
malsasua 
collazoandy4 
normalmajoralways
closedfixed 
5
 
3.0PR18Q1 
vmromanos
Core
No
0037395: Deactivated discounts are applied
With the discoiunt type "Price Adjustment", the discount is applied although the record is deactivate in the "product" tab
Define a new discount of type Price Adjustment:
. Include products: Only Those Defined
. Disc percentage: 10%
product tab:
 . product: Zumo Pera
 . active: N
(see attachment1)

create a new Sales Order:
. bp: Hoteles Buenas Noches
 new line:
  . product Zumo Pera
discount is not applied, total receipt 1.37-> it is OK
. process the previous sales order:
  . discount is applied, total receipt 1.23 -> it is wrong
(see attachment2)
No tags attached.
png discConfig.png (151,249) 2017-11-27 14:22
https://issues.openbravo.com/file_download.php?file_id=11328&type=bug
png

png so.png (170,509) 2017-11-27 14:23
https://issues.openbravo.com/file_download.php?file_id=11329&type=bug
png
Issue History
2017-11-27 14:22malsasuaNew Issue
2017-11-27 14:22malsasuaAssigned To => Triage Finance
2017-11-27 14:22malsasuaFile Added: discConfig.png
2017-11-27 14:22malsasuaModules => Core
2017-11-27 14:22malsasuaResolution time => 1513551600
2017-11-27 14:22malsasuaTriggers an Emergency Pack => No
2017-11-27 14:23malsasuaFile Added: so.png
2017-11-28 16:39dmiguelezAssigned ToTriage Finance => collazoandy4
2017-11-29 22:54collazoandy4Statusnew => scheduled
2017-12-01 18:06collazoandy4Note Added: 0100900
2017-12-01 18:07collazoandy4Note Added: 0100901
2017-12-12 17:45hgbotCheckin
2017-12-12 17:45hgbotNote Added: 0101003
2017-12-12 17:45hgbotStatusscheduled => resolved
2017-12-12 17:45hgbotResolutionopen => fixed
2017-12-12 17:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d2410d0bfe18deab7cfce90fe9739fa0348e1b9b [^]
2017-12-12 17:45hgbotCheckin
2017-12-12 17:45hgbotNote Added: 0101004
2017-12-12 17:46vmromanosReview Assigned To => vmromanos
2017-12-12 17:46vmromanosNote Added: 0101005
2017-12-12 17:46vmromanosStatusresolved => closed
2017-12-12 17:46vmromanosFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101520
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101521

Notes
(0100900)
collazoandy4   
2017-12-01 18:06   
Test Plan I - Product Promotion
  Go to Discount and Promotion window and create a new record:
    Name: Product-Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Products: Only those defined
    Create a new record in Products tab:
      Product: Zumo de Pera 0,5L
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Zumo de Pera 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 0.69
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Zumo de Pera 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 0.69
  Go to Discount and Promotion window and edit the previous line created in Product tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Zumo de Pera 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.37
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Zumo de Pera 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.37

Test Plan II - Business Partner Category Promotion
  Go to Discount and Promotion window and create a new record:
    Name: PartnerCategory-Promotion
    Starting Date: First Month date
    Discount %: 50
    Included BP Categories: Only those defined
    Create a new record in Business Partner Category tab:
      Business Partner Category: Customer - Tier 3
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 0.51
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 0.51
  Go to Discount and Promotion window and edit the previous line created in Business Partner Category tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.00
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.00

  Test Plan III - Business Partner Promotion
  Go to Discount and Promotion window and create a new record:
    Name: Partner-Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Business Partner: Only those defined
    Create a new record in Business Partner tab:
      Business Partner: Bebidas Alegres, S.L.
      Active: Y
  Go to Purchase Order window and create a new record for Bebidas Alegres, S.L. business partner
    Create a new record in Lines tab:
      Product: Vino Tinto 0,75L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 2.09
  Go to Purchase Invoice window and create a new record for Bebidas Alegres, S.L. business partner
    Create a new record in Lines tab:
      Product: Vino Tinto 0,75L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 2.09
  Go to Discount and Promotion window and edit the previous line created in Business Partner tab:
    Active: N
  Go to Purchase Order window and create a new record for Bebidas Alegres, S.L. business partner
    Create a new record in Lines tab:
      Product: Vino Tinto 0,75L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 4.17
  Go to Purchase Invoice window and create a new record for Bebidas Alegres, S.L. business partner
    Create a new record in Lines tab:
      Product: Vino Tinto 0,75L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 4.17

Test Plan IV - Product Category Promotion
  Go to Discount and Promotion window and create a new record:
    Name: ProductCategory Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Product Categories: Only those defined
    Create a new record in Product Category tab:
      Product Category: Alcoholic
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Cerveza Ale 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.23
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Cerveza Ale 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.23
  Go to Discount and Promotion window and edit the previous line created in Product Category tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 2.47
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Limonada 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 2.47

Test Plan V - Price List Promotion
  Go to Discount and Promotion window and create a new record:
    Name: PriceList Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Price Lists: Only those defined
    Create a new record in Price Lists tab:
      Price List: Tarifa de ventas
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Agua sin Gas 1L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 0.93
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Agua sin Gas 1L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 0.93
  Go to Discount and Promotion window and edit the previous line created in Price Lists tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Agua sin Gas 1L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.85
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Agua sin Gas 1L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.85

Test Plan VI - Organization Promotion
  Go to Discount and Promotion window and create a new record:
    Name: Organization Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Organizations: Only those defined
    Create a new record in Organization tab:
      Organization: F&B España - Región Norte
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner and F&B España - Región Norte organization
    Create a new record in Lines tab:
      Product: Bebida Energética 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 0.93
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner and F&B España - Región Norte organization
    Create a new record in Lines tab:
      Product: Bebida Energética 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 0.93
  Go to Discount and Promotion window and edit the previous line created in Organization tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner and F&B España - Región Norte organization
    Create a new record in Lines tab:
      Product: Bebida Energética 0,5L
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.80
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner and F&B España - Región Norte organization
    Create a new record in Lines tab:
      Product: Bebida Energética 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.80

Test Plan VII - Characteristics Promotion
  Go to Characteristics window and create a new record:
    Name: Color
    Create a new record in Value tab with Black as name
  Go to Product window and create a new record:
    Search Key/Name: T-Shirt
    Product Category: Others
    Is Generic: Y
    Create a new record in Characteristics tab:
      Characteristic: Color
      Variant: Y
    Clic on Manage Variant and create all product variants
  Go to the new product variant created and create a new record in Price Tab:
    Price List Version: Tarifa de ventas
    Unit Price: 1.50
  Go to Discount and Promotion window and create a new record:
    Name: Characteristics Promotion
    Starting Date: First Month date
    Discount %: 50
    Included Characteristics: Only those defined
    Create a new record in Characteristics tab:
      Characteristics: Color
      Characteristic Value: Black
      Active: Y
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: T-Shirt
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 0.91
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: T-Shirt
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 0.91
  Go to Discount and Promotion window and edit the previous line created in Characteristics tab:
    Active: N
  Go to Sales Order window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: T-Shirt
      Ordered Quantity: 1
    Complete the order and check Total Gross Amount: 1.82
  Go to Sales Invoice window and create a new record for Hoteles Buenas Noches, S.A. business partner
    Create a new record in Lines tab:
      Product: Bebida Energética 0,5L
      Invoiced Quantity: 1
    Complete the invoice and check Total Gross Amount: 1.82
(0100901)
collazoandy4   
2017-12-01 18:07   
Repeat all previous tests plan for purchase flow
(0101003)
hgbot   
2017-12-12 17:45   
Repository: erp/devel/pi
Changeset: d2410d0bfe18deab7cfce90fe9739fa0348e1b9b
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Wed Nov 29 16:53:46 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/d2410d0bfe18deab7cfce90fe9739fa0348e1b9b [^]

Fixes issue 37395: Deactivated discounts are applied

When a Discount and Promotions have a Product define the discount was always
applied even if the product offer is deactivated.

An ISACTIVE clause was added to take into account only active product's offers

---
M src-db/database/model/functions/M_PROMOTION_CALCULATE.xml
---
(0101004)
hgbot   
2017-12-12 17:45   
Repository: erp/devel/pi
Changeset: 11175c26317d78da97f60e4c60227669a1d9dae4
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Thu Nov 30 16:56:51 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/11175c26317d78da97f60e4c60227669a1d9dae4 [^]

Related to issue 37395: Taking into account the is active status in other offers

The is active status now is take into account in all the offers to properly get
the promotion

---
M src-db/database/model/functions/M_PROMOTION_CALCULATE.xml
---
(0101005)
vmromanos   
2017-12-12 17:46   
Code review + testing OK
(0101520)
hudsonbot   
2018-01-03 12:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c81e0d3cbab5 [^]
Maturity status: Test
(0101521)
hudsonbot   
2018-01-03 12:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c81e0d3cbab5 [^]
Maturity status: Test