Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013163Openbravo ERP07. Sales managementpublic2010-04-30 09:452010-05-18 21:43
psarobe 
dalsasua 
immediatemajoralways
closedfixed 
5
2.50MP13 
2.50MP17 
Core
No
0013163: Cannot complete a sales/purchase invoice under some circumstances
Under some circumstances an invoice cannot be completed. This happens when:
1. The business partner has discounts configured
2. The result of the discount (amount) has more than 2 decimals
3. Only happens in Oracle database

The reason is:
1. Trigger C_INVOICELINE_TRG4 is executed before C_INVLINE_CHK_RESTRICTIONS_TRG so the amount is not rounded based on the precision.
2. There is another issue that needs to be fixed. How can the error is coded like "RAISE_APPLICATION_ERROR(-20501,'Line Amount Is Not Correct');". That's a big mistake. That number has nothing to do with the real error so it misleads the end user and developers when trying to figure out what was wrong
1. Login in PI or Main
2. Openbravo/openbravo
3. Go to Sales management-> Transactions->Sales invoice
4. Click new and select Sailor as bpartner
5. Move to lines and select hammer
6. Qty=1
7. Go back to the header and complete

Expected result: Process complete successfully

Current result and error: Document already posted/processed
Trigger C_INVOICELINE_TRG4 should be merged with C_INVLINE_CHK_RESTRICTIONS_TRG and do the check once the amount (line net amount) is rounded
Regression
Issue History
2010-04-30 09:45psarobeNew Issue
2010-04-30 09:45psarobeAssigned To => dalsasua
2010-04-30 09:46psarobeTag Attached: Regression
2010-04-30 09:46psarobeStatusnew => scheduled
2010-04-30 09:46psarobefix_in_branch => pi
2010-04-30 12:28hgbotCheckin
2010-04-30 12:28hgbotNote Added: 0026809
2010-04-30 12:28hgbotStatusscheduled => resolved
2010-04-30 12:28hgbotResolutionopen => fixed
2010-04-30 12:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b9e8574569f75fb2a408ff09233f02050e356bae [^]
2010-05-03 16:08sureshbabuNote Added: 0026873
2010-05-03 16:08sureshbabuStatusresolved => closed
2010-05-04 00:00anonymoussf_bug_id0 => 2996197
2010-05-04 15:55psarobeversion2.50MP14 => 2.50MP13
2010-05-04 15:55psarobefix_in_branchpi =>
2010-05-04 15:56psarobeNote Added: 0026918
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17
2010-05-18 21:43hudsonbotCheckin
2010-05-18 21:43hudsonbotNote Added: 0027459

Notes
(0026809)
hgbot   
2010-04-30 12:28   
Repository: erp/devel/pi
Changeset: b9e8574569f75fb2a408ff09233f02050e356bae
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Fri Apr 30 12:27:53 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b9e8574569f75fb2a408ff09233f02050e356bae [^]

Fixes issue 13163: Cannot complete a sales/purchase invoice

---
M src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
R src-db/database/model/triggers/C_INVOICELINE_TRG4.xml
---
(0026873)
sureshbabu   
2010-05-03 16:08   
Tested with 3 decimal places for euro relation, euro edition, price relation, price edition in format.xml file.
working fine, able to complete sales & purchase invoice
(0026918)
psarobe   
2010-05-04 15:56   
Regression introduced by 12366
(0027459)
hudsonbot   
2010-05-18 21:43   
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/b9e8574569f7 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/aa11838d5f80 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17380.obx [^]