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;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.math.*;
|
import java.math.BigDecimal;
|
||||||
import java.sql.*;
|
import java.sql.ResultSet;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.Properties;
|
||||||
import org.compiere.util.*;
|
|
||||||
import org.eevolution.model.*;
|
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
|
* Inventory Move Line Model
|
||||||
|
@ -204,6 +208,7 @@ public class MMovementLine extends X_M_MovementLine
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // beforeSave
|
} // beforeSave
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Distribution Order Line.
|
* Set Distribution Order Line.
|
||||||
* Does not set Quantity!
|
* Does not set Quantity!
|
||||||
|
@ -284,39 +289,15 @@ public class MMovementLine extends X_M_MovementLine
|
||||||
public static MMovementLine[] getOfOrderLine (Properties ctx,
|
public static MMovementLine[] getOfOrderLine (Properties ctx,
|
||||||
int DD_OrderLine_ID, String where, String trxName)
|
int DD_OrderLine_ID, String where, String trxName)
|
||||||
{
|
{
|
||||||
ArrayList<MMovementLine> list = new ArrayList<MMovementLine>();
|
String whereClause = "DD_OrderLine_ID=?";
|
||||||
String sql = "SELECT * FROM M_MovementLine WHERE DD_OrderLine_ID=?";
|
|
||||||
if (where != null && where.length() > 0)
|
if (where != null && where.length() > 0)
|
||||||
sql += " AND " + where;
|
whereClause += " AND " + where;
|
||||||
PreparedStatement pstmt = null;
|
//
|
||||||
try
|
Query query = MTable.get(ctx, Table_ID).createQuery(whereClause, trxName);
|
||||||
{
|
query.setParameters(new Object[]{DD_OrderLine_ID});
|
||||||
pstmt = DB.prepareStatement (sql, trxName);
|
List<MMovementLine> list = query.list();
|
||||||
pstmt.setInt (1, DD_OrderLine_ID);
|
return list.toArray(new MMovementLine[list.size()]);
|
||||||
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;
|
|
||||||
} // getOfOrderLine
|
} // getOfOrderLine
|
||||||
|
|
||||||
|
|
||||||
} // MMovementLine
|
} // MMovementLine
|
||||||
|
|
Loading…
Reference in New Issue