Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013697Openbravo ERP07. Sales managementpublic2010-06-18 12:332010-10-30 11:24
arunkumar 
sivaraman 
normalmajorhave not tried
closedfixed 
5
pi 
 
Core
No
0013697: Discount is still applied to sales invoice even it it was made as inactive
Create a discount of 20% and apply it to sales invoice. After that make the discount status as inactive.Now complete a newly created invoice.Still you can see the discount is applied to the sales invoice.
Setup
1: Create a product with below details
Name: Discount 20% , product Category: Discounts, UOM:Unit, Product Type: Item, Purchase & Sales: Checked

2) Navigate to Discount tab (Master Data Management || Business Partner Setup || Discount || Discount ) and click new, then enter the below details
Name: Discount 20% for BP:CUSA apply only to invoice , Product: Discount 20%, Discount %: 20.00

3) Navigate to Business partner window (Master Data Management || Business Partner || Business Partner ) and select the customer : Customer A and then navigate to "Discount" tab, then click New and enter the below details

Discount: Discount 20% for BP:CUSA apply only to invoice, Apply in order: unchecked (critical, please make sure you unchecked this checkbox) , Customer:Checked

Precondition:
1) Navigate to Discount tab (Master Data Management || Business Partner Setup || Discount || Discount ) and select the record with Name: Discount 20% for BP:CUSA apply only to invoice
Then uncheck the "Active" checkbox to make the record inactive

steps:
1) Create and complete a sales Invoice with the below details
BP: Customer A
Product: FGA
Qty: 125
and on complete of invoice, verify the 20% of Net Total amount not applied to the invoice

But you can see the 20% discount is still applied here.

No tags attached.
Issue History
2010-06-18 12:33arunkumarNew Issue
2010-06-18 12:33arunkumarAssigned To => adrianromero
2010-10-15 10:29sivaramanAssigned Toadrianromero => sivaraman
2010-10-15 10:32hgbotCheckin
2010-10-15 10:32hgbotNote Added: 0031874
2010-10-15 10:32hgbotStatusnew => resolved
2010-10-15 10:32hgbotResolutionopen => fixed
2010-10-15 10:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1250e8f1c3d9d61c3e932e27e0cefd1b5959ed01 [^]
2010-10-15 10:34sivaramanNote Added: 0031875
2010-10-18 17:39hudsonbotCheckin
2010-10-18 17:39hudsonbotNote Added: 0031932
2010-10-21 07:51sureshbabuNote Added: 0032038
2010-10-21 07:51sureshbabuNote Deleted: 0032038
2010-10-21 07:51sureshbabuNote Added: 0032039
2010-10-21 07:51sureshbabuStatusresolved => closed
2010-10-30 11:24anonymoussf_bug_id0 => 3098724

Notes
(0031874)
hgbot   
2010-10-15 10:32   
Repository: erp/devel/pi
Changeset: 1250e8f1c3d9d61c3e932e27e0cefd1b5959ed01
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Fri Oct 15 14:00:55 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/1250e8f1c3d9d61c3e932e27e0cefd1b5959ed01 [^]

Fixes issue 13697: Discount is still applied to sales invoice even it it was made as inactive

In C_INVOICE_TRG2 Trigger, one more AND clause has been added that will check whether discount is active or not before inserting it into C_INVOICE_DISCOUNT table.

---
M src-db/database/model/triggers/C_INVOICE_TRG2.xml
---
(0031875)
sivaraman   
2010-10-15 10:34   
Steps to test:

Kindly follow the steps as given in 'Steps To Reproduce' section and verify if inactive discount is not applied
(0031932)
hudsonbot   
2010-10-18 17:39   
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/1250e8f1c3d9 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/e1c7df1ae349 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18559.obx [^]
(0032039)
sureshbabu   
2010-10-21 07:51   
The mentioned issue is rightly fixed, but while retesting i found one more issue, that is while reactivating the invoice, discount line in Discount tab not getting deleted. Because of that even when i deactivate the discount, when i try to complete the reactivated the sales invoices discount % still applies to the sales invoice. Tested in postgres context