Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013685Openbravo ERP07. Sales managementpublic2010-06-17 14:532010-08-06 00:00
sureshbabu 
adrianromero 
urgentmajoralways
closedfixed 
5
main 
2.50MP20 
Core
No
0013685: volume discount wrongly calculated even for products which is not included while defining volume discount.
volume discount wrongly calculated even for products which is not included while defining volume discount.
Volume Discount parameters setup

1) Navigate to Master Data Management || Business Partner Setup || Volume Discount || Volume Discounts and click new

 Then enter the below details
 Name: Volume discount testing, Include Product : All selected , Include Product Categories: Not Selected

2) Navigate to product tab
Click new, and select product: Hat
Again click new and select product: Shirt

3) Navigate to volume discount parameters
and click new and enter Discount %: 10, Min Amount :0.00

4) Navigate to BP tab
Click new and enter the below details
select BP: Red Bunny
Sales Transaction: checked
Valid From Date: 01/01/2010
Valid To: 31/12/2010

Again click new and enter the below details
Select BP: McGivers
Sales transaction: Unchecked
Valid from Date: 01/01/2010
Valid To: 31/12/2010

2) Create and complete a sales invoice with the below details
BP: Mc givers
Products: Hat, Qty:10 unit: 35.00 Tax: Exempt Total line amount 350

Include one more product which is not included while defining volume discount
Products: Hammer, Qty:5 unit: 5.80 Tax: Exempt Total line amount: 5.80

So total gross amount: 355.80

3) Try to create invoice by navigate to Business partner window and then move to Volume discount tab(Master Data Management || Business Partner || Business Partner >> Volume Discount )
Then click "Create Invoice", "Process completed successfully" message appears along with Invoice id details

4) Navigate back to Invoice window and select the above generated invoice in step 3 in form view

Error: One can see that, Discount is calculated wrongly for the entire invoice amount instead of only for the product Hat for euros 350.00

No tags attached.
Issue History
2010-06-17 14:53sureshbabuNew Issue
2010-06-17 14:53sureshbabuAssigned To => adrianromero
2010-06-17 16:35psarobePriorityhigh => urgent
2010-06-17 16:35psarobeStatusnew => scheduled
2010-06-17 16:35psarobeTarget Version => 2.50MP20
2010-08-05 08:14hgbotCheckin
2010-08-05 08:14hgbotNote Added: 0029791
2010-08-05 08:14hgbotStatusscheduled => resolved
2010-08-05 08:14hgbotResolutionopen => fixed
2010-08-05 08:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f90ffc74fb0a422130cbe3f9117a3d97aa3701e5 [^]
2010-08-05 08:17harikrishnanNote Added: 0029792
2010-08-05 11:43sureshbabuNote Added: 0029819
2010-08-05 11:43sureshbabuStatusresolved => closed
2010-08-05 15:05hudsonbotCheckin
2010-08-05 15:05hudsonbotNote Added: 0029830
2010-08-06 00:00anonymoussf_bug_id0 => 3040292

Notes
(0029791)
hgbot   
2010-08-05 08:14   
Repository: erp/devel/pi
Changeset: f90ffc74fb0a422130cbe3f9117a3d97aa3701e5
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Thu Aug 05 11:42:54 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f90ffc74fb0a422130cbe3f9117a3d97aa3701e5 [^]

Fixes issue 13685: volume discount wrongly calculated even for products which is not included while defining volume discount.

---
M src-db/database/model/functions/M_RAPPEL_INVOICE_CREATE.xml
---
(0029792)
harikrishnan   
2010-08-05 08:17   
Steps to Reproduce:

*Follow the steps given in the issue.Check for both sales invoice and purchase invoice.

Root Cause:

*In the where clause for product category they have used both for INCLUDE_PRODUCT_CATEGORY =N and INCLUDE_PRODUCT_CATEGORY =Y which is not needed.

Impact:

*I have tested in Volume discount for Sales Invoice and Purchase invoice
(0029819)
sureshbabu   
2010-08-05 11:43   
verified
(0029830)
hudsonbot   
2010-08-05 15:05   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/f90ffc74fb0a [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/7afc506f5f93 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18021.obx [^]