Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015120Openbravo ERP07. Sales managementpublic2010-11-05 14:532010-12-09 16:07
jonalegriaesarte 
sivaraman 
normalmajorhave not tried
closedfixed 
5
2.50MP23 
2.50MP252.50MP24 
Core
No
0015120: Wrong message when creating a debt payment
A wrong message appears when you create a debt payment in a sales order.
1- Create a new sales order:
Document type: standard order
Invoice terms: immediate

2- Create one line:
Product: hat
Quantity: 1

3- Create one line:
Product: beer
Quantity: -1

4- In debt payment tab, create a new debt payment

5- Save. The error OrderCompletelyInvoiced, appears, but it does not exist an invoice.
The problem is in C_DEBT_PAYMENT_TRG.
No tags attached.
Issue History
2010-11-05 14:53jonalegriaesarteNew Issue
2010-11-05 14:53jonalegriaesarteAssigned To => adrianromero
2010-11-05 14:54jonalegriaesarteIssue Monitored: networkb
2010-11-05 14:54jonalegriaesarteversionpi => 2.50MP23
2010-11-08 16:50adrianromeroNote Added: 0032471
2010-11-17 11:23sivaramanAssigned Toadrianromero => sivaraman
2010-11-17 11:39hgbotCheckin
2010-11-17 11:39hgbotNote Added: 0032657
2010-11-17 11:39hgbotStatusnew => resolved
2010-11-17 11:39hgbotResolutionopen => fixed
2010-11-17 11:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/08569dbf2199b6456807a77ff8600d1970826716 [^]
2010-11-17 11:57sivaramanNote Added: 0032658
2010-11-17 19:41hudsonbotCheckin
2010-11-17 19:41hudsonbotNote Added: 0032687
2010-11-18 11:45psarobeNote Added: 0032700
2010-11-18 11:45psarobeStatusresolved => closed
2010-11-18 11:45psarobeFixed in Version => 2.50MP23
2010-11-18 11:45psarobeFixed in Version2.50MP23 => 2.50MP24
2010-12-09 16:07anonymoussf_bug_id0 => 3133547

Notes
(0032471)
adrianromero   
2010-11-08 16:50   
I guess that the C_DEBT_PAYMENT_TRIGGER is not checking properly the condition when an order has been invoiced or not. It has to be reviewed that the trigger and review this condition.
(0032657)
hgbot   
2010-11-17 11:39   
Repository: erp/devel/pi
Changeset: 08569dbf2199b6456807a77ff8600d1970826716
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Wed Nov 17 16:07:39 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/08569dbf2199b6456807a77ff8600d1970826716 [^]

Fixes issue 15120: Wrong message when creating a debt payment

Root-cause:
C_DEBT_PAYMENT_TRG is calculating the un-invoiced order quantity by adding up all together. Since we 1 and -1, the summation results 0 which means no order is pending to be invoiced. Hence, 'OrderCompletelyInvoiced' error message is displayed.

Solution:
It seems negative quantity needs to be carefully handled. When the difference between ordered quantity and invoiced quantity is calculated, we have to consider the absolute value of quantities irrespective of its sign.

Impacts:
None

---
M src-db/database/model/triggers/C_DEBT_PAYMENT_TRG.xml
---
(0032658)
sivaraman   
2010-11-17 11:57   
Steps to test:

1. Create new Sales Order
2. Add the following lines
   Product : hat
   Quantity: 1

   Product : beer
   Quantity: -1
3. Create new Payment and verify if it can be successfully saved.

*Also verify if error message is shown when we create Payment for invoiced order with above lines
(0032687)
hudsonbot   
2010-11-17 19:41   
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/08569dbf2199 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/b7bb18bb9d40 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18908.obx [^]
(0032700)
psarobe   
2010-11-18 11:45   
Works fine