IDEMPIERE-5061 Inconsistency in getLines Order By code (#1013)

This commit is contained in:
hengsin 2021-12-02 21:50:39 +08:00 committed by GitHub
parent c9b563f408
commit 935007d58a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 24 additions and 22 deletions

View File

@ -133,7 +133,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
final String whereClause = I_C_BankStatementLine.COLUMNNAME_C_BankStatement_ID+"=?";
List<MBankStatementLine> list = new Query(getCtx(),I_C_BankStatementLine.Table_Name,whereClause,get_TrxName())
.setParameters(getC_BankStatement_ID())
.setOrderBy("Line")
.setOrderBy("Line,C_BankStatementLine_ID")
.list();
MBankStatementLine[] retValue = new MBankStatementLine[list.size()];
list.toArray(retValue);

View File

@ -221,7 +221,7 @@ public class MCash extends X_C_Cash implements DocAction
final String whereClause =MCashLine.COLUMNNAME_C_Cash_ID+"=?";
List<MCashLine> list = new Query(getCtx(),I_C_CashLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_Cash_ID())
.setOrderBy(I_C_CashLine.COLUMNNAME_Line)
.setOrderBy(I_C_CashLine.COLUMNNAME_Line+","+I_C_CashLine.COLUMNNAME_C_CashLine_ID)
.setOnlyActiveRecords(true)
.list();

View File

@ -81,7 +81,7 @@ public class MCashPlan extends X_C_CashPlan
public MCashPlanLine[] getLines ()
{
ArrayList<MCashPlanLine> list = new ArrayList<MCashPlanLine>();
String sql = "SELECT * FROM C_CashPlanLine WHERE C_CashPlan_ID=? ORDER BY Line";
String sql = "SELECT * FROM C_CashPlanLine WHERE C_CashPlan_ID=? ORDER BY Line,C_CashPlanLine_ID";
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -79,7 +79,7 @@ public class MCommission extends X_C_Commission
final String whereClause = "IsActive='Y' AND C_Commission_ID=?";
List<MCommissionLine> list = new Query(getCtx(), I_C_CommissionLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_Commission_ID())
.setOrderBy("Line")
.setOrderBy("Line,C_CommissionLine_ID")
.list();
// Convert
MCommissionLine[] retValue = new MCommissionLine[list.size()];

View File

@ -279,7 +279,7 @@ public class MDepositBatch extends X_C_DepositBatch
public MDepositBatchLine[] getLines()
{
ArrayList<MDepositBatchLine> list = new ArrayList<MDepositBatchLine>();
String sql = "SELECT * FROM C_DepositBatchLine WHERE C_DepositBatch_ID=? ORDER BY Line";
String sql = "SELECT * FROM C_DepositBatchLine WHERE C_DepositBatch_ID=? ORDER BY Line,C_DepositBatchLine_ID";
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -202,7 +202,7 @@ public class MDiscountSchema extends X_M_DiscountSchema implements ImmutablePOSu
return m_lines;
}
String sql = "SELECT * FROM M_DiscountSchemaLine WHERE M_DiscountSchema_ID=? ORDER BY SeqNo";
String sql = "SELECT * FROM M_DiscountSchemaLine WHERE M_DiscountSchema_ID=? ORDER BY SeqNo,M_DiscountSchemaLine_ID";
ArrayList<MDiscountSchemaLine> list = new ArrayList<MDiscountSchemaLine>();
PreparedStatement pstmt = null;
ResultSet rs = null;

View File

@ -348,7 +348,7 @@ public class MDistribution extends X_GL_Distribution
final String whereClause = I_GL_DistributionLine.COLUMNNAME_GL_Distribution_ID+"=?";
List<MDistributionLine> list = new Query(getCtx(),I_GL_DistributionLine.Table_Name,whereClause,get_TrxName())
.setParameters(getGL_Distribution_ID())
.setOrderBy("Line")
.setOrderBy("Line,GL_DistributionLine_ID")
.list();
//red1 Query -end-
boolean hasNullRemainder = false;

View File

@ -76,7 +76,7 @@ public class MDistributionRun extends X_M_DistributionRun
}
//
String sql = "SELECT * FROM M_DistributionRunLine "
+ "WHERE M_DistributionRun_ID=? AND IsActive='Y' AND TotalQty IS NOT NULL AND TotalQty<> 0 ORDER BY Line";
+ "WHERE M_DistributionRun_ID=? AND IsActive='Y' AND TotalQty IS NOT NULL AND TotalQty<> 0 ORDER BY Line,M_DistributionRunLine_ID";
ArrayList<MDistributionRunLine> list = new ArrayList<MDistributionRunLine>();
PreparedStatement pstmt = null;
ResultSet rs = null;

View File

@ -658,7 +658,7 @@ public class MInOut extends X_M_InOut implements DocAction
}
List<MInOutLine> list = new Query(getCtx(), I_M_InOutLine.Table_Name, "M_InOut_ID=?", get_TrxName())
.setParameters(getM_InOut_ID())
.setOrderBy(MInOutLine.COLUMNNAME_Line)
.setOrderBy(MInOutLine.COLUMNNAME_Line+","+MInOutLine.COLUMNNAME_M_InOutLine_ID)
.list();
//
m_lines = new MInOutLine[list.size()];

View File

@ -187,7 +187,7 @@ public class MInventory extends X_M_Inventory implements DocAction
//
List<MInventoryLine> list = new Query(getCtx(), I_M_InventoryLine.Table_Name, "M_Inventory_ID=?", get_TrxName())
.setParameters(get_ID())
.setOrderBy(MInventoryLine.COLUMNNAME_Line)
.setOrderBy(MInventoryLine.COLUMNNAME_Line+","+MInventoryLine.COLUMNNAME_M_InventoryLine_ID)
.list();
m_lines = list.toArray(new MInventoryLine[list.size()]);
return m_lines;

View File

@ -207,7 +207,7 @@ public class MJournal extends X_GL_Journal implements DocAction
final String whereClause = "GL_Journal_ID=?";
List <MJournalLine> list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause, get_TrxName())
.setParameters(getGL_Journal_ID())
.setOrderBy("Line")
.setOrderBy("Line,GL_JournalLine_ID")
.list();
//
MJournalLine[] retValue = new MJournalLine[list.size()];

View File

@ -110,7 +110,7 @@ public class MMovement extends X_M_Movement implements DocAction
final String whereClause = "M_Movement_ID=?";
List<MMovementLine> list = new Query(getCtx(), I_M_MovementLine.Table_Name, whereClause, get_TrxName())
.setParameters(getM_Movement_ID())
.setOrderBy(MMovementLine.COLUMNNAME_Line)
.setOrderBy(MMovementLine.COLUMNNAME_Line+","+MMovementLine.COLUMNNAME_M_MovementLine_ID)
.list();
m_lines = new MMovementLine[list.size ()];
list.toArray (m_lines);

View File

@ -713,7 +713,7 @@ public class MOrder extends X_C_Order implements DocAction
if (orderBy != null && orderBy.length() > 0)
orderClause += orderBy;
else
orderClause += "Line";
orderClause += "Line,C_OrderLine_ID";
m_lines = getLines(null, orderClause);
return m_lines;
} // getLines

View File

@ -184,7 +184,8 @@ public class MProduction extends X_M_Production implements DocAction {
String sql = "SELECT pl.M_ProductionLine_ID "
+ "FROM M_ProductionLine pl "
+ "WHERE pl.M_Production_ID = ?";
+ "WHERE pl.M_Production_ID = ? "
+ "ORDER BY pl.Line, pl.M_ProductionLine_ID ";
PreparedStatement pstmt = null;
ResultSet rs = null;

View File

@ -50,7 +50,8 @@ public class MProductionPlan extends X_M_ProductionPlan {
String sql = "SELECT pl.M_ProductionLine_ID "
+ "FROM M_ProductionLine pl "
+ "WHERE pl.M_ProductionPlan_ID = ?";
+ "WHERE pl.M_ProductionPlan_ID = ? "
+ "ORDER BY pl.Line, pl.M_ProductionLine_ID ";
PreparedStatement pstmt = null;
ResultSet rs = null;

View File

@ -179,7 +179,7 @@ public class MProject extends X_C_Project
final String whereClause = "C_Project_ID=?";
List <MProjectLine> list = new Query(getCtx(), I_C_ProjectLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_Project_ID())
.setOrderBy("Line")
.setOrderBy("Line,C_ProjectLine_ID")
.list();
//
MProjectLine[] retValue = new MProjectLine[list.size()];

View File

@ -251,7 +251,7 @@ public class MProjectPhase extends X_C_ProjectPhase
final String whereClause = "C_Project_ID=? and C_ProjectPhase_ID=?";
List <MProjectLine> list = new Query(getCtx(), I_C_ProjectLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_Project_ID(), getC_ProjectPhase_ID())
.setOrderBy("Line")
.setOrderBy("Line,C_ProjectLine_ID")
.list();
//
MProjectLine[] retValue = new MProjectLine[list.size()];

View File

@ -101,7 +101,7 @@ public class MProjectTask extends X_C_ProjectTask
final String whereClause = "C_ProjectPhase_ID=? and C_ProjectTask_ID=? ";
List <MProjectLine> list = new Query(getCtx(), I_C_ProjectLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_ProjectPhase_ID(), getC_ProjectTask_ID())
.setOrderBy("Line")
.setOrderBy("Line,C_ProjectLine_ID")
.list();
//
MProjectLine[] retValue = new MProjectLine[list.size()];

View File

@ -99,7 +99,7 @@ public class MRMA extends X_M_RMA implements DocAction
}
List<MRMALine> list = new Query(getCtx(), I_M_RMALine.Table_Name, "M_RMA_ID=?", get_TrxName())
.setParameters(getM_RMA_ID())
.setOrderBy(MRMALine.COLUMNNAME_Line)
.setOrderBy(MRMALine.COLUMNNAME_Line+","+MRMALine.COLUMNNAME_M_RMALine_ID)
.list();
m_lines = new MRMALine[list.size ()];

View File

@ -104,7 +104,7 @@ public class MRequisition extends X_M_Requisition implements DocAction
final String whereClause = I_M_RequisitionLine.COLUMNNAME_M_Requisition_ID+"=?";
List <MRequisitionLine> list = new Query(getCtx(), I_M_RequisitionLine.Table_Name, whereClause, get_TrxName())
.setParameters(get_ID())
.setOrderBy(I_M_RequisitionLine.COLUMNNAME_Line)
.setOrderBy(I_M_RequisitionLine.COLUMNNAME_Line+","+I_M_RequisitionLine.COLUMNNAME_M_RequisitionLine_ID)
.list();
// red1 - end -

View File

@ -152,7 +152,7 @@ public class MRfQ extends X_C_RfQ
ArrayList<MRfQLine> list = new ArrayList<MRfQLine>();
String sql = "SELECT * FROM C_RfQLine "
+ "WHERE C_RfQ_ID=? AND IsActive='Y' "
+ "ORDER BY Line";
+ "ORDER BY Line,C_RfQLine_ID ";
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -111,7 +111,7 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
int C_Currency_ID = getC_Currency_ID();
ArrayList<MTimeExpenseLine> list = new ArrayList<MTimeExpenseLine>();
//
String sql = "SELECT * FROM S_TimeExpenseLine WHERE S_TimeExpense_ID=? ORDER BY Line";
String sql = "SELECT * FROM S_TimeExpenseLine WHERE S_TimeExpense_ID=? ORDER BY Line,S_TimeExpenseLine_ID";
PreparedStatement pstmt = null;
ResultSet rs = null;
try