Fixed the setSalesRep and getLine Method

This commit is contained in:
vpj-cd 2008-08-29 00:51:57 +00:00
parent 26ae3aaccb
commit 6695c5a99e
1 changed files with 8 additions and 4 deletions

View File

@ -316,8 +316,12 @@ public class MDDOrder extends X_DD_Order implements DocAction
// Default Invoice/Payment Rule // Default Invoice/Payment Rule
ss = bp.getInvoiceRule(); ss = bp.getInvoiceRule();
if (ii != 0) if (getSalesRep_ID() == 0)
setSalesRep_ID(ii); {
ii = Env.getContextAsInt(getCtx(), "#AD_User_ID");
if (ii != 0)
setSalesRep_ID (ii);
}
// Set Locations // Set Locations
@ -474,7 +478,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
if (m_lines != null && !requery) if (m_lines != null && !requery)
return m_lines; return m_lines;
// //
String orderClause = "ORDER BY "; String orderClause = "";
if (orderBy != null && orderBy.length() > 0) if (orderBy != null && orderBy.length() > 0)
orderClause += orderBy; orderClause += orderBy;
else else
@ -661,7 +665,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
// Default Sales Rep // Default Sales Rep
if (getSalesRep_ID() == 0) if (getSalesRep_ID() == 0)
{ {
int ii = Env.getContextAsInt(getCtx(), "#SalesRep_ID"); int ii = Env.getContextAsInt(getCtx(), "#AD_User_ID");
if (ii != 0) if (ii != 0)
setSalesRep_ID (ii); setSalesRep_ID (ii);
} }