MMovementLine:
* organized imports * fixed identation * fixed javadoc * db fix
This commit is contained in:
parent
3b98a76541
commit
63a5c4c2a6
|
@ -16,12 +16,16 @@
|
|||
*****************************************************************************/
|
||||
package org.compiere.model;
|
||||
|
||||
import java.math.*;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import org.compiere.util.*;
|
||||
import org.eevolution.model.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.eevolution.model.MDDOrderLine;
|
||||
|
||||
/**
|
||||
* Inventory Move Line Model
|
||||
|
@ -204,6 +208,7 @@ public class MMovementLine extends X_M_MovementLine
|
|||
|
||||
return true;
|
||||
} // beforeSave
|
||||
|
||||
/**
|
||||
* Set Distribution Order Line.
|
||||
* Does not set Quantity!
|
||||
|
@ -284,39 +289,15 @@ public class MMovementLine extends X_M_MovementLine
|
|||
public static MMovementLine[] getOfOrderLine (Properties ctx,
|
||||
int DD_OrderLine_ID, String where, String trxName)
|
||||
{
|
||||
ArrayList<MMovementLine> list = new ArrayList<MMovementLine>();
|
||||
String sql = "SELECT * FROM M_MovementLine WHERE DD_OrderLine_ID=?";
|
||||
String whereClause = "DD_OrderLine_ID=?";
|
||||
if (where != null && where.length() > 0)
|
||||
sql += " AND " + where;
|
||||
PreparedStatement pstmt = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, trxName);
|
||||
pstmt.setInt (1, DD_OrderLine_ID);
|
||||
ResultSet rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
list.add(new MMovementLine(ctx, rs, trxName));
|
||||
rs.close ();
|
||||
pstmt.close ();
|
||||
pstmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
s_log.log(Level.SEVERE, sql, e);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (pstmt != null)
|
||||
pstmt.close ();
|
||||
pstmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
pstmt = null;
|
||||
}
|
||||
MMovementLine[] retValue = new MMovementLine[list.size ()];
|
||||
list.toArray (retValue);
|
||||
return retValue;
|
||||
whereClause += " AND " + where;
|
||||
//
|
||||
Query query = MTable.get(ctx, Table_ID).createQuery(whereClause, trxName);
|
||||
query.setParameters(new Object[]{DD_OrderLine_ID});
|
||||
List<MMovementLine> list = query.list();
|
||||
return list.toArray(new MMovementLine[list.size()]);
|
||||
} // getOfOrderLine
|
||||
|
||||
|
||||
} // MMovementLine
|
||||
|
|
Loading…
Reference in New Issue