Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020680Openbravo ERP07. Sales managementpublic2012-06-05 15:572012-06-06 11:13
mirurita 
mirurita 
normalmajoralways
closedfixed 
20Community Appliance
pi 
3.0MP12 
Core
No
0020680: Return From Customer/To Vendor (pick&edit): error when returning a line
When there is no tax loaded in the pick&edit the tax is not calculated.
As the c_tax_id is mandatory on c_orderline table the process fails.

The problem is on SRMOPickEditLines.java class.
getString("tax") return the "null" string instead of null value when there is no tax.

// tax
String taxId = selectedLine.getString("tax");
if (taxId == null) {
 ...
}


a3196480 347536 [TP-Processor7] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into C_OrderLine (AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, C_Order_ID, Line, DateOrdered, M_Product_ID, M_Warehouse_ID, DirectShip, C_UOM_ID, QtyOrdered, C_Currency_ID, PriceList, PriceActual, PriceLimit, Discount, ChargeAmt, IsDescription, PriceStd, CANCELPRICEAD, Iseditlinenetamt, M_Inoutline_ID, C_OrderLine_ID) values ('23C59575B9CF467C9620760EB255B389', 'E443A31992CB4635AFCAEABE7183CE85', 'Y', '2012-06-05 15:51:58.489000 +02:00:00', '100', '2012-06-05 15:51:58.489000 +02:00:00', '100', '84CF302B46DE43A28E4D5ED6E75E639F', '10', '2012-06-05 00:00:00.000000 +02:00:00', 'BDE2F1CF46B54EF58D33E20A230DA8D2', 'B2D40D8A5D644DD89E329DC297309055', 'N', '100', '-3', '102', '1.53', '1.53', '0', '0', '0', 'N', '1.53', 'N', 'N', '7CDC29AA7ADE4AB58B66D1C87A826574', 'DCDA26867C6E4F92AF11E9880498458C') was aborted. Call getNextException to see the cause.
a3196480 347567 [TP-Processor7] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: null value in column "c_tax_id" violates not-null constraint
a3196480 347570 [TP-Processor7] ERROR org.openbravo.common.actionhandler.SRMOPickEditLines - Could not execute JDBC batch update
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
1) Create a new Goods Shipment for Hoteles Buenas Noches, S.A.
2) Create a new Return for Customer for Hoteles Buenas Noches, S.A.
3) Click on Pick/Edit
4) Select goods shipment created on step 1)
5) Fully return the shipment.
6) Click on Done button
7) Error:
Could not execute JDBC batch update
Realize that the line is not inserted.
Change the comparation

// tax
String taxId = selectedLine.getString("tax");
if (taxId == null) {
 ...
}

to

if ("null".equals(taxId)) {
No tags attached.
png Return_from_customer_Tax_null.png (70,378) 2012-06-05 15:58
https://issues.openbravo.com/file_download.php?file_id=5279&type=bug
png
Issue History
2012-06-05 15:57miruritaNew Issue
2012-06-05 15:57miruritaAssigned To => mirurita
2012-06-05 15:57miruritaModules => Core
2012-06-05 15:58miruritaFile Added: Return_from_customer_Tax_null.png
2012-06-05 16:03hgbotCheckin
2012-06-05 16:03hgbotNote Added: 0049627
2012-06-05 16:03hgbotStatusnew => resolved
2012-06-05 16:03hgbotResolutionopen => fixed
2012-06-05 16:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b93e89d8bd607fc38596295310df2831a22a3685 [^]
2012-06-06 11:13psarobeNote Added: 0049643
2012-06-06 11:13psarobeStatusresolved => closed
2012-06-06 11:13psarobeFixed in Version => 3.0MP12

Notes
(0049627)
hgbot   
2012-06-05 16:03   
Repository: erp/devel/pi
Changeset: b93e89d8bd607fc38596295310df2831a22a3685
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue Jun 05 16:02:14 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b93e89d8bd607fc38596295310df2831a22a3685 [^]

Fixes issue 20680: RFC/RTV (pick&edit): error when returning a line

---
M src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
---
(0049643)
psarobe   
2012-06-06 11:13   
Works fine