IDEMPIERE-4723 - Clean up MIssue*/MJournal*/MLandedC*/MLanguage/MLdapProcessor/Mloc*/MLookip*/Mlot* classes code (#635)
This commit is contained in:
parent
c8fd9a8805
commit
7d1fec61fb
|
|
@ -337,9 +337,6 @@ public class MIssue extends X_AD_Issue
|
||||||
MIssueProject.get(this); // sets also Asset
|
MIssueProject.get(this); // sets also Asset
|
||||||
MIssueSystem.get(this);
|
MIssueSystem.get(this);
|
||||||
MIssueUser.get(this);
|
MIssueUser.get(this);
|
||||||
//
|
|
||||||
// setR_IssueKnown_ID(0);
|
|
||||||
// setR_Request_ID(0);
|
|
||||||
return createAnswer();
|
return createAnswer();
|
||||||
} // process
|
} // process
|
||||||
|
|
||||||
|
|
@ -406,131 +403,9 @@ public class MIssue extends X_AD_Issue
|
||||||
*/
|
*/
|
||||||
public String report()
|
public String report()
|
||||||
{
|
{
|
||||||
//if (true)
|
|
||||||
return null;
|
return null;
|
||||||
/*StringBuilder parameter = new StringBuilder("?");
|
|
||||||
if (getRecord_ID() == 0) // don't report
|
|
||||||
return "ID=0";
|
|
||||||
if (getRecord_ID() == 1) // new
|
|
||||||
{
|
|
||||||
parameter.append("ISSUE=");
|
|
||||||
HashMap<String,String> htOut = get_HashMap();
|
|
||||||
try // deserializing in create
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
|
|
||||||
ObjectOutput oOut = new ObjectOutputStream(bOut);
|
|
||||||
oOut.writeObject(htOut);
|
|
||||||
oOut.flush();
|
|
||||||
String hexString = Secure.convertToHexString(bOut.toByteArray());
|
|
||||||
parameter.append(hexString);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.severe(e.getLocalizedMessage());
|
|
||||||
StringBuilder msgreturn = new StringBuilder("New-").append(e.getLocalizedMessage());
|
|
||||||
return msgreturn.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // existing
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
parameter.append("RECORDID=").append(getRecord_ID());
|
|
||||||
parameter.append("&DBADDRESS=").append(URLEncoder.encode(getDBAddress(), "UTF-8"));
|
|
||||||
parameter.append("&COMMENTS=").append(URLEncoder.encode(getComments(), "UTF-8"));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.severe(e.getLocalizedMessage());
|
|
||||||
StringBuilder msgreturn = new StringBuilder("Update-").append(e.getLocalizedMessage());
|
|
||||||
return msgreturn.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
InputStreamReader in = null;
|
|
||||||
String target = "http://dev1/wstore/issueReportServlet";
|
|
||||||
try // Send GET Request
|
|
||||||
{
|
|
||||||
StringBuilder urlString = new StringBuilder(target)
|
|
||||||
.append(parameter);
|
|
||||||
URL url = new URL (urlString.toString());
|
|
||||||
URLConnection uc = url.openConnection();
|
|
||||||
in = new InputStreamReader(uc.getInputStream());
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
StringBuilder msg = new StringBuilder("Cannot connect to http://").append(target);
|
|
||||||
if (e instanceof FileNotFoundException || e instanceof ConnectException)
|
|
||||||
msg.append("\nServer temporarily down - Please try again later");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
msg.append("\nCheck connection - ").append(e.getLocalizedMessage());
|
|
||||||
log.log(Level.FINE, msg.toString());
|
|
||||||
}
|
|
||||||
return msg.toString();
|
|
||||||
}
|
|
||||||
return readResponse(in);*/
|
|
||||||
} // report
|
} // report
|
||||||
|
|
||||||
/**
|
|
||||||
* Read Response
|
|
||||||
* @param in input stream
|
|
||||||
* @return error message
|
|
||||||
*/
|
|
||||||
/*private String readResponse(InputStreamReader in)
|
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
int Record_ID = 0;
|
|
||||||
String ResponseText = null;
|
|
||||||
String RequestDocumentNo = null;
|
|
||||||
try // Get Answer
|
|
||||||
{
|
|
||||||
int c;
|
|
||||||
while ((c = in.read()) != -1)
|
|
||||||
sb.append((char)c);
|
|
||||||
in.close();
|
|
||||||
log.fine(sb.toString());
|
|
||||||
String clear = URLDecoder.decode(sb.toString(), "UTF-8");
|
|
||||||
log.fine(clear);
|
|
||||||
// Interpret Data
|
|
||||||
StringTokenizer st = new StringTokenizer(clear, DELIMITER);
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
String pair = st.nextToken();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int index = pair.indexOf('=');
|
|
||||||
if (pair.startsWith("RECORDID="))
|
|
||||||
{
|
|
||||||
String info = pair.substring(index+1);
|
|
||||||
Record_ID = Integer.parseInt(info);
|
|
||||||
}
|
|
||||||
else if (pair.startsWith("RESPONSE="))
|
|
||||||
ResponseText = pair.substring(index+1);
|
|
||||||
else if (pair.startsWith("DOCUMENTNO="))
|
|
||||||
RequestDocumentNo = pair.substring(index+1);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.warning(pair + " - " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.log(Level.FINE, "", ex);
|
|
||||||
return "Reading-" + ex.getLocalizedMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Record_ID != 0)
|
|
||||||
setRecord_ID(Record_ID);
|
|
||||||
if (ResponseText != null)
|
|
||||||
setResponseText(ResponseText);
|
|
||||||
if (RequestDocumentNo != null)
|
|
||||||
setRequestDocumentNo(RequestDocumentNo);
|
|
||||||
return null;
|
|
||||||
} // readResponse*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String Representation
|
* String Representation
|
||||||
* @return info
|
* @return info
|
||||||
|
|
|
||||||
|
|
@ -122,17 +122,6 @@ public class MIssueProject extends X_R_IssueProject
|
||||||
public void setA_Asset_ID (MIssue issue)
|
public void setA_Asset_ID (MIssue issue)
|
||||||
{
|
{
|
||||||
int A_Asset_ID = 0;
|
int A_Asset_ID = 0;
|
||||||
/*String sql = "SELECT * FROM A_Asset a "
|
|
||||||
+ "WHERE EXISTS (SELECT * FROM A_Asset_Group ag " // Tracking Assets
|
|
||||||
+ "WHERE a.A_Asset_Group_ID=ag.A_Asset_Group_ID AND ag.IsTrackIssues='Y')"
|
|
||||||
+ " AND EXISTS (SELECT * FROM AD_User u "
|
|
||||||
+ "WHERE (a.C_BPartner_ID=u.C_BPartner_ID OR a.C_BPartnerSR_ID=u.C_BPartner_ID)"
|
|
||||||
+ " AND u.EMail=?)" // #1 EMail
|
|
||||||
+ " AND (SerNo IS NULL OR SerNo=?)"; // #2 Name*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super.setA_Asset_ID (A_Asset_ID);
|
super.setA_Asset_ID (A_Asset_ID);
|
||||||
} // setA_Asset_ID
|
} // setA_Asset_ID
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,21 +69,10 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
super (ctx, GL_Journal_ID, trxName);
|
super (ctx, GL_Journal_ID, trxName);
|
||||||
if (GL_Journal_ID == 0)
|
if (GL_Journal_ID == 0)
|
||||||
{
|
{
|
||||||
// setGL_Journal_ID (0); // PK
|
|
||||||
// setC_AcctSchema_ID (0);
|
|
||||||
// setC_Currency_ID (0);
|
|
||||||
// setC_DocType_ID (0);
|
|
||||||
// setC_Period_ID (0);
|
|
||||||
//
|
|
||||||
setCurrencyRate (Env.ONE);
|
setCurrencyRate (Env.ONE);
|
||||||
// setC_ConversionType_ID(0);
|
|
||||||
// setDateAcct (new Timestamp(System.currentTimeMillis()));
|
|
||||||
setDateDoc (new Timestamp(System.currentTimeMillis()));
|
setDateDoc (new Timestamp(System.currentTimeMillis()));
|
||||||
// setDescription (null);
|
|
||||||
setDocAction (DOCACTION_Complete);
|
setDocAction (DOCACTION_Complete);
|
||||||
setDocStatus (DOCSTATUS_Drafted);
|
setDocStatus (DOCSTATUS_Drafted);
|
||||||
// setDocumentNo (null);
|
|
||||||
// setGL_Category_ID (0);
|
|
||||||
setPostingType (POSTINGTYPE_Actual);
|
setPostingType (POSTINGTYPE_Actual);
|
||||||
setTotalCr (Env.ZERO);
|
setTotalCr (Env.ZERO);
|
||||||
setTotalDr (Env.ZERO);
|
setTotalDr (Env.ZERO);
|
||||||
|
|
@ -145,10 +134,6 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
setC_Currency_ID(original.getC_Currency_ID());
|
setC_Currency_ID(original.getC_Currency_ID());
|
||||||
setC_ConversionType_ID(original.getC_ConversionType_ID());
|
setC_ConversionType_ID(original.getC_ConversionType_ID());
|
||||||
setCurrencyRate(original.getCurrencyRate());
|
setCurrencyRate(original.getCurrencyRate());
|
||||||
|
|
||||||
// setDateDoc(original.getDateDoc());
|
|
||||||
// setDateAcct(original.getDateAcct());
|
|
||||||
// setC_Period_ID(original.getC_Period_ID());
|
|
||||||
} // MJournal
|
} // MJournal
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1011,10 +996,7 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
*/
|
*/
|
||||||
public File createPDF (File file)
|
public File createPDF (File file)
|
||||||
{
|
{
|
||||||
// ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID());
|
return null;
|
||||||
// if (re == null)
|
|
||||||
return null;
|
|
||||||
// return re.getPDF(file);
|
|
||||||
} // createPDF
|
} // createPDF
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,10 +103,6 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
super (ctx, GL_JournalBatch_ID, trxName);
|
super (ctx, GL_JournalBatch_ID, trxName);
|
||||||
if (GL_JournalBatch_ID == 0)
|
if (GL_JournalBatch_ID == 0)
|
||||||
{
|
{
|
||||||
// setGL_JournalBatch_ID (0); PK
|
|
||||||
// setDescription (null);
|
|
||||||
// setDocumentNo (null);
|
|
||||||
// setC_DocType_ID (0);
|
|
||||||
setPostingType (POSTINGTYPE_Actual);
|
setPostingType (POSTINGTYPE_Actual);
|
||||||
setDocAction (DOCACTION_Complete);
|
setDocAction (DOCACTION_Complete);
|
||||||
setDocStatus (DOCSTATUS_Drafted);
|
setDocStatus (DOCSTATUS_Drafted);
|
||||||
|
|
@ -138,9 +134,6 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
{
|
{
|
||||||
this (original.getCtx(), 0, original.get_TrxName());
|
this (original.getCtx(), 0, original.get_TrxName());
|
||||||
setClientOrg(original);
|
setClientOrg(original);
|
||||||
//
|
|
||||||
// setC_AcctSchema_ID(original.getC_AcctSchema_ID());
|
|
||||||
// setGL_Budget_ID(original.getGL_Budget_ID());
|
|
||||||
setGL_Category_ID(original.getGL_Category_ID());
|
setGL_Category_ID(original.getGL_Category_ID());
|
||||||
setPostingType(original.getPostingType());
|
setPostingType(original.getPostingType());
|
||||||
setDescription(original.getDescription());
|
setDescription(original.getDescription());
|
||||||
|
|
@ -148,12 +141,6 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
setControlAmt(original.getControlAmt());
|
setControlAmt(original.getControlAmt());
|
||||||
//
|
//
|
||||||
setC_Currency_ID(original.getC_Currency_ID());
|
setC_Currency_ID(original.getC_Currency_ID());
|
||||||
// setC_ConversionType_ID(original.getC_ConversionType_ID());
|
|
||||||
// setCurrencyRate(original.getCurrencyRate());
|
|
||||||
|
|
||||||
// setDateDoc(original.getDateDoc());
|
|
||||||
// setDateAcct(original.getDateAcct());
|
|
||||||
// setC_Period_ID(original.getC_Period_ID());
|
|
||||||
} // MJournal
|
} // MJournal
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -877,10 +864,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
*/
|
*/
|
||||||
public File createPDF (File file)
|
public File createPDF (File file)
|
||||||
{
|
{
|
||||||
// ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID());
|
return null;
|
||||||
// if (re == null)
|
|
||||||
return null;
|
|
||||||
// return re.getPDF(file);
|
|
||||||
} // createPDF
|
} // createPDF
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,17 +53,12 @@ public class MJournalLine extends X_GL_JournalLine
|
||||||
super (ctx, GL_JournalLine_ID, trxName);
|
super (ctx, GL_JournalLine_ID, trxName);
|
||||||
if (GL_JournalLine_ID == 0)
|
if (GL_JournalLine_ID == 0)
|
||||||
{
|
{
|
||||||
// setGL_JournalLine_ID (0); // PK
|
|
||||||
// setGL_Journal_ID (0); // Parent
|
|
||||||
// setC_Currency_ID (0);
|
|
||||||
// setC_ValidCombination_ID (0);
|
|
||||||
setLine (0);
|
setLine (0);
|
||||||
setAmtAcctCr (Env.ZERO);
|
setAmtAcctCr (Env.ZERO);
|
||||||
setAmtAcctDr (Env.ZERO);
|
setAmtAcctDr (Env.ZERO);
|
||||||
setAmtSourceCr (Env.ZERO);
|
setAmtSourceCr (Env.ZERO);
|
||||||
setAmtSourceDr (Env.ZERO);
|
setAmtSourceDr (Env.ZERO);
|
||||||
setCurrencyRate (Env.ONE);
|
setCurrencyRate (Env.ONE);
|
||||||
// setC_ConversionType_ID (0);
|
|
||||||
setDateAcct (new Timestamp(System.currentTimeMillis()));
|
setDateAcct (new Timestamp(System.currentTimeMillis()));
|
||||||
setIsGenerated (true);
|
setIsGenerated (true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,6 @@ public class MLandedCost extends X_C_LandedCost
|
||||||
super (ctx, C_LandedCost_ID, trxName);
|
super (ctx, C_LandedCost_ID, trxName);
|
||||||
if (C_LandedCost_ID == 0)
|
if (C_LandedCost_ID == 0)
|
||||||
{
|
{
|
||||||
// setC_InvoiceLine_ID (0);
|
|
||||||
// setM_CostElement_ID (0);
|
|
||||||
setLandedCostDistribution (LANDEDCOSTDISTRIBUTION_Quantity); // Q
|
setLandedCostDistribution (LANDEDCOSTDISTRIBUTION_Quantity); // Q
|
||||||
}
|
}
|
||||||
} // MLandedCost
|
} // MLandedCost
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ public class MLandedCostAllocation extends X_C_LandedCostAllocation
|
||||||
super (ctx, C_LandedCostAllocation_ID, trxName);
|
super (ctx, C_LandedCostAllocation_ID, trxName);
|
||||||
if (C_LandedCostAllocation_ID == 0)
|
if (C_LandedCostAllocation_ID == 0)
|
||||||
{
|
{
|
||||||
// setM_CostElement_ID(0);
|
|
||||||
setAmt (Env.ZERO);
|
setAmt (Env.ZERO);
|
||||||
setQty (Env.ZERO);
|
setQty (Env.ZERO);
|
||||||
setBase (Env.ZERO);
|
setBase (Env.ZERO);
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,6 @@ public class MLanguage extends X_AD_Language
|
||||||
}
|
}
|
||||||
} // maintain
|
} // maintain
|
||||||
|
|
||||||
// /** Logger */
|
|
||||||
// private static CLogger s_log = CLogger.getCLogger (MLanguage.class);
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Standard Constructor
|
* Standard Constructor
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
|
@ -466,8 +462,6 @@ public class MLanguage extends X_AD_Language
|
||||||
.append(" WHERE ").append(keyColumn).append(" NOT IN (SELECT ").append(keyColumn)
|
.append(" WHERE ").append(keyColumn).append(" NOT IN (SELECT ").append(keyColumn)
|
||||||
.append(" FROM ").append(tableName)
|
.append(" FROM ").append(tableName)
|
||||||
.append(" WHERE AD_Language='").append(getAD_Language()).append("')");
|
.append(" WHERE AD_Language='").append(getAD_Language()).append("')");
|
||||||
// + " WHERE (" + keyColumn + ",'" + getAD_Language()+ "') NOT IN (SELECT "
|
|
||||||
// + keyColumn + ",AD_Language FROM " + tableName + ")";
|
|
||||||
int no = DB.executeUpdateEx(insert.toString(), null, get_TrxName());
|
int no = DB.executeUpdateEx(insert.toString(), null, get_TrxName());
|
||||||
// IDEMPIERE-99 Language Maintenance does not create UUIDs
|
// IDEMPIERE-99 Language Maintenance does not create UUIDs
|
||||||
MTable table = MTable.get(getCtx(), tableName);
|
MTable table = MTable.get(getCtx(), tableName);
|
||||||
|
|
@ -492,28 +486,6 @@ public class MLanguage extends X_AD_Language
|
||||||
|
|
||||||
System.out.println(MLanguage.get(Env.getCtx(), "de_DE"));
|
System.out.println(MLanguage.get(Env.getCtx(), "de_DE"));
|
||||||
System.out.println(MLanguage.get(Env.getCtx(), "en_US"));
|
System.out.println(MLanguage.get(Env.getCtx(), "en_US"));
|
||||||
|
|
||||||
/**
|
|
||||||
Locale[] locales = Locale.getAvailableLocales();
|
|
||||||
for (int i = 0; i < locales.length; i++)
|
|
||||||
{
|
|
||||||
Locale loc = locales[i];
|
|
||||||
if (loc.getVariant() != null && loc.getVariant().length() != 0)
|
|
||||||
continue;
|
|
||||||
if (loc.getCountry() != null && loc.getCountry().length() != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
System.out.println(loc.toString()
|
|
||||||
+ " - " + loc.getDisplayName()
|
|
||||||
+ " + " + loc.getCountry()
|
|
||||||
+ " + " + loc.getLanguage()
|
|
||||||
);
|
|
||||||
MLanguage lang = new MLanguage (Env.getCtx(), loc.toString(),
|
|
||||||
loc.getDisplayName(), loc.getCountry(), loc.getLanguage());
|
|
||||||
lang.saveEx();
|
|
||||||
System.out.println(lang);
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
} // main
|
} // main
|
||||||
|
|
||||||
} // MLanguage
|
} // MLanguage
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,6 @@ public class MLdapProcessorLog extends X_AD_LdapProcessorLog implements Adempier
|
||||||
super (ctx, AD_LdapProcessorLog_ID, trxName);
|
super (ctx, AD_LdapProcessorLog_ID, trxName);
|
||||||
if (AD_LdapProcessorLog_ID == 0)
|
if (AD_LdapProcessorLog_ID == 0)
|
||||||
{
|
{
|
||||||
// setAD_LdapProcessorLog_ID (0);
|
|
||||||
// setAD_LdapProcessor_ID (0);
|
|
||||||
setIsError (false);
|
setIsError (false);
|
||||||
}
|
}
|
||||||
} // MLdapProcessorLog
|
} // MLdapProcessorLog
|
||||||
|
|
|
||||||
|
|
@ -630,8 +630,6 @@ public class MLocation extends X_C_Location implements Comparator<Object>, Immut
|
||||||
retStr.append(", ").append(getAddress5());
|
retStr.append(", ").append(getAddress5());
|
||||||
// City, Region, Postal
|
// City, Region, Postal
|
||||||
retStr.append(", ").append(parseCRP (getCountry()));
|
retStr.append(", ").append(parseCRP (getCountry()));
|
||||||
// Add Country would come here
|
|
||||||
// retStr.append(", ").append(getCountry());
|
|
||||||
}
|
}
|
||||||
return retStr.toString();
|
return retStr.toString();
|
||||||
} // toString
|
} // toString
|
||||||
|
|
@ -672,7 +670,6 @@ public class MLocation extends X_C_Location implements Comparator<Object>, Immut
|
||||||
retStr.append("\n").append(getAddress5());
|
retStr.append("\n").append(getAddress5());
|
||||||
// City, Region, Postal
|
// City, Region, Postal
|
||||||
retStr.append("\n").append(parseCRP (getCountry()));
|
retStr.append("\n").append(parseCRP (getCountry()));
|
||||||
// Add Country would come here
|
|
||||||
}
|
}
|
||||||
return retStr.toString();
|
return retStr.toString();
|
||||||
} // toStringCR
|
} // toStringCR
|
||||||
|
|
|
||||||
|
|
@ -248,14 +248,8 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport
|
||||||
super (ctx, M_Locator_ID, trxName);
|
super (ctx, M_Locator_ID, trxName);
|
||||||
if (M_Locator_ID == 0)
|
if (M_Locator_ID == 0)
|
||||||
{
|
{
|
||||||
// setM_Locator_ID (0); // PK
|
|
||||||
// setM_Warehouse_ID (0); // Parent
|
|
||||||
setIsDefault (false);
|
setIsDefault (false);
|
||||||
setPriorityNo (50);
|
setPriorityNo (50);
|
||||||
// setValue (null);
|
|
||||||
// setX (null);
|
|
||||||
// setY (null);
|
|
||||||
// setZ (null);
|
|
||||||
}
|
}
|
||||||
} // MLocator
|
} // MLocator
|
||||||
|
|
||||||
|
|
@ -367,66 +361,6 @@ public class MLocator extends X_M_Locator implements ImmutablePOSupport
|
||||||
// This implies that every time you create a new product you must create initial inventory zero for all locators where the product can be stored.
|
// This implies that every time you create a new product you must create initial inventory zero for all locators where the product can be stored.
|
||||||
// A good enhancement could be a new table to indicate when a locator is exclusive for some products, but I consider current approach not working.
|
// A good enhancement could be a new table to indicate when a locator is exclusive for some products, but I consider current approach not working.
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/*
|
|
||||||
// Default Locator
|
|
||||||
if (M_Product_ID == 0 || isDefault())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
PreparedStatement pstmt = null;
|
|
||||||
// Already Stored
|
|
||||||
String sql = "SELECT COUNT(*) FROM M_Storage s WHERE s.M_Locator_ID=? AND s.M_Product_ID=?";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
|
||||||
pstmt.setInt (1, getM_Locator_ID());
|
|
||||||
pstmt.setInt (2, M_Product_ID);
|
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
|
||||||
if (rs.next ())
|
|
||||||
count = rs.getInt(1);
|
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.log (Level.SEVERE, sql, e);
|
|
||||||
}
|
|
||||||
// Default Product Locator
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
sql = "SELECT COUNT(*) FROM M_Product s WHERE s.M_Locator_ID=? AND s.M_Product_ID=?";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
pstmt = DB.prepareStatement (sql, null);
|
|
||||||
pstmt.setInt (1, getM_Locator_ID());
|
|
||||||
pstmt.setInt (2, M_Product_ID);
|
|
||||||
ResultSet rs = pstmt.executeQuery ();
|
|
||||||
if (rs.next ())
|
|
||||||
count = rs.getInt(1);
|
|
||||||
rs.close ();
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.log (Level.SEVERE, sql, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (pstmt != null)
|
|
||||||
pstmt.close ();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count != 0;
|
|
||||||
*/
|
|
||||||
} // isCanStoreProduct
|
} // isCanStoreProduct
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,6 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
||||||
*/
|
*/
|
||||||
public MLocator getMLocator (Object keyValue, String trxName)
|
public MLocator getMLocator (Object keyValue, String trxName)
|
||||||
{
|
{
|
||||||
// log.fine( "MLocatorLookup.getDirect " + keyValue.getClass() + "=" + keyValue);
|
|
||||||
int M_Locator_ID = -1;
|
int M_Locator_ID = -1;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -369,7 +368,6 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
// log.config("MLocatorLookup Loader.run " + m_AD_Column_ID);
|
|
||||||
// Set Info - see VLocator.actionText
|
// Set Info - see VLocator.actionText
|
||||||
int local_only_warehouse_id = getOnly_Warehouse_ID(); // [ 1674891 ] MLocatorLookup - weird error
|
int local_only_warehouse_id = getOnly_Warehouse_ID(); // [ 1674891 ] MLocatorLookup - weird error
|
||||||
int local_only_product_id = getOnly_Product_ID();
|
int local_only_product_id = getOnly_Product_ID();
|
||||||
|
|
@ -495,12 +493,6 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
||||||
list.add(loc);
|
list.add(loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sort Data
|
|
||||||
MLocator l = new MLocator (m_ctx, 0);
|
|
||||||
if (!mandatory)
|
|
||||||
list.add (l);
|
|
||||||
Collections.sort (list, l);
|
|
||||||
**/
|
|
||||||
return list;
|
return list;
|
||||||
} // getArray
|
} // getArray
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,7 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
m_hasInactive = true; // creates focus listener for dynamic loading
|
m_hasInactive = true; // creates focus listener for dynamic loading
|
||||||
return; // required when parent needs to be selected (e.g. price from product)
|
return; // required when parent needs to be selected (e.g. price from product)
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//m_loader = new MLoader();
|
|
||||||
// if (TabNo != 0)
|
|
||||||
// m_loader.setPriority(Thread.NORM_PRIORITY - 1);
|
|
||||||
//m_loader.start();
|
|
||||||
//m_loader.run(); // test sync call
|
|
||||||
} // MLookup
|
} // MLookup
|
||||||
|
|
||||||
/** Inactive Marker Start */
|
/** Inactive Marker Start */
|
||||||
|
|
@ -373,7 +368,6 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
{
|
{
|
||||||
if (m_info == null)
|
if (m_info == null)
|
||||||
return false;
|
return false;
|
||||||
//return m_info.IsValidated;
|
|
||||||
return isValidated(m_info);
|
return isValidated(m_info);
|
||||||
} // isValidated
|
} // isValidated
|
||||||
|
|
||||||
|
|
@ -433,13 +427,10 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
loadData (loadParent);
|
loadData (loadParent);
|
||||||
|
|
||||||
// already validation included
|
// already validation included
|
||||||
//if (m_info.IsValidated)
|
|
||||||
boolean validated = this.isValidated(m_info);
|
boolean validated = this.isValidated(m_info);
|
||||||
if (validated)
|
if (validated)
|
||||||
return new ArrayList<Object>(m_lookup.values());
|
return new ArrayList<Object>(m_lookup.values());
|
||||||
|
|
||||||
|
|
||||||
//if (!m_info.IsValidated && onlyValidated)
|
|
||||||
if (!validated && onlyValidated)
|
if (!validated && onlyValidated)
|
||||||
{
|
{
|
||||||
loadData (loadParent);
|
loadData (loadParent);
|
||||||
|
|
@ -1177,7 +1168,6 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
m_lookup.put(value, p);
|
m_lookup.put(value, p);
|
||||||
vnpCache.add(p);
|
vnpCache.add(p);
|
||||||
}
|
}
|
||||||
// if (log.isLoggable(Level.FINE)) log.fine( m_info.KeyColumn + ": " + name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
|
|
@ -1191,7 +1181,6 @@ public final class MLookup extends Lookup implements Serializable
|
||||||
int size = m_lookup.size();
|
int size = m_lookup.size();
|
||||||
if (log.isLoggable(Level.FINER)) log.finer(m_info.KeyColumn
|
if (log.isLoggable(Level.FINER)) log.finer(m_info.KeyColumn
|
||||||
+ " (" + m_info.Column_ID + "):"
|
+ " (" + m_info.Column_ID + "):"
|
||||||
// + " ID=" + m_info.AD_Column_ID + " " +
|
|
||||||
+ " - Loader complete #" + size + " - all=" + m_allLoaded
|
+ " - Loader complete #" + size + " - all=" + m_allLoaded
|
||||||
+ " - ms=" + String.valueOf(System.currentTimeMillis()-m_startTime)
|
+ " - ms=" + String.valueOf(System.currentTimeMillis()-m_startTime)
|
||||||
+ " (" + String.valueOf(System.currentTimeMillis()-startTime) + ")");
|
+ " (" + String.valueOf(System.currentTimeMillis()-startTime) + ")");
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ public class MLookupCache
|
||||||
//
|
//
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(info.WindowNo).append(":")
|
sb.append(info.WindowNo).append(":")
|
||||||
// .append(info.Column_ID)
|
|
||||||
.append(info.KeyColumn)
|
.append(info.KeyColumn)
|
||||||
.append(info.AD_Reference_Value_ID)
|
.append(info.AD_Reference_Value_ID)
|
||||||
.append(info.Query)
|
.append(info.Query)
|
||||||
|
|
@ -103,9 +102,6 @@ public class MLookupCache
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy Asynchronously to speed things up
|
|
||||||
// if (cache.size() > ?) copyAsync
|
|
||||||
|
|
||||||
// copy cache
|
// copy cache
|
||||||
// we can use iterator, as the lookup loading is complete (i.e. no additional entries)
|
// we can use iterator, as the lookup loading is complete (i.e. no additional entries)
|
||||||
Iterator<Object> iterator = cache.keySet().iterator();
|
Iterator<Object> iterator = cache.keySet().iterator();
|
||||||
|
|
|
||||||
|
|
@ -256,36 +256,14 @@ public class MLookupFactory
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
local_validationCode = Env.parseContext (ctx, WindowNo, info.ValidationCode, true);
|
|
||||||
if (local_validationCode.length() == 0) // returns "" if not all variables were parsed
|
|
||||||
info.IsValidated = false;
|
|
||||||
else
|
|
||||||
info.IsValidated = true;
|
|
||||||
*/
|
|
||||||
info.IsValidated = false;
|
info.IsValidated = false;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Add Local Validation
|
|
||||||
if (local_validationCode.length() != 0)
|
|
||||||
{
|
|
||||||
//jz handle no posOrder case
|
|
||||||
if (posOrder > 0)
|
|
||||||
info.Query = info.Query.substring(0, posOrder)
|
|
||||||
+ (hasWhere ? " AND " : " WHERE ") + local_validationCode
|
|
||||||
+ info.Query.substring(posOrder);
|
|
||||||
else
|
|
||||||
info.Query = info.Query
|
|
||||||
+ (hasWhere ? " AND " : " WHERE ") + local_validationCode;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Add Security
|
// Add Security
|
||||||
if (needToAddSecurity)
|
if (needToAddSecurity)
|
||||||
info.Query = MRole.getDefault(ctx, false).addAccessSQL(info.Query,
|
info.Query = MRole.getDefault(ctx, false).addAccessSQL(info.Query,
|
||||||
info.TableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
info.TableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
|
||||||
//
|
|
||||||
// s_log.finest("Query: " + info.Query);
|
|
||||||
// s_log.finest("Direct: " + info.QueryDirect);
|
|
||||||
return info;
|
return info;
|
||||||
} // getLookupInfo
|
} // getLookupInfo
|
||||||
|
|
||||||
|
|
@ -429,12 +407,11 @@ public class MLookupFactory
|
||||||
String KeyColumn = null, DisplayColumn = null, TableName = null, WhereClause = null, OrderByClause = null;
|
String KeyColumn = null, DisplayColumn = null, TableName = null, WhereClause = null, OrderByClause = null;
|
||||||
String displayColumnSQL = null;
|
String displayColumnSQL = null;
|
||||||
boolean IsTranslated = false, isValueDisplayed = false;
|
boolean IsTranslated = false, isValueDisplayed = false;
|
||||||
//boolean isSOTrx = !"N".equals(Env.getContext(ctx, WindowNo, "IsSOTrx"));
|
|
||||||
int ZoomWindow = 0;
|
int ZoomWindow = 0;
|
||||||
int ZoomWindowPO = 0;
|
int ZoomWindowPO = 0;
|
||||||
int overrideZoomWindow = 0;
|
int overrideZoomWindow = 0;
|
||||||
int infoWindowId = 0;
|
int infoWindowId = 0;
|
||||||
//int AD_Table_ID = 0;
|
|
||||||
boolean loaded = false;
|
boolean loaded = false;
|
||||||
|
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
|
@ -455,7 +432,6 @@ public class MLookupFactory
|
||||||
OrderByClause = rs.getString(7);
|
OrderByClause = rs.getString(7);
|
||||||
ZoomWindow = rs.getInt(8);
|
ZoomWindow = rs.getInt(8);
|
||||||
ZoomWindowPO = rs.getInt(9);
|
ZoomWindowPO = rs.getInt(9);
|
||||||
//AD_Table_ID = rs.getInt(10);
|
|
||||||
displayColumnSQL = rs.getString(11);
|
displayColumnSQL = rs.getString(11);
|
||||||
if (displayColumnSQL != null && displayColumnSQL.length() > 0 && (displayColumnSQL.startsWith("@SQL=") || displayColumnSQL.startsWith("@SQLFIND=")))
|
if (displayColumnSQL != null && displayColumnSQL.length() > 0 && (displayColumnSQL.startsWith("@SQL=") || displayColumnSQL.startsWith("@SQLFIND=")))
|
||||||
displayColumnSQL = "NULL";
|
displayColumnSQL = "NULL";
|
||||||
|
|
@ -777,7 +753,6 @@ public class MLookupFactory
|
||||||
|
|
||||||
String KeyColumn = MQuery.getZoomColumnName(ColumnName);
|
String KeyColumn = MQuery.getZoomColumnName(ColumnName);
|
||||||
String TableName = MQuery.getZoomTableName(ColumnName);
|
String TableName = MQuery.getZoomTableName(ColumnName);
|
||||||
//boolean isSOTrx = !"N".equals(Env.getContext(ctx, WindowNo, "IsSOTrx"));
|
|
||||||
int ZoomWindow = 0;
|
int ZoomWindow = 0;
|
||||||
int ZoomWindowPO = 0;
|
int ZoomWindowPO = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,13 +127,6 @@ public class MLot extends X_M_Lot
|
||||||
public MLot (Properties ctx, int M_Lot_ID, String trxName)
|
public MLot (Properties ctx, int M_Lot_ID, String trxName)
|
||||||
{
|
{
|
||||||
super (ctx, M_Lot_ID, trxName);
|
super (ctx, M_Lot_ID, trxName);
|
||||||
/** if (M_Lot_ID == 0)
|
|
||||||
{
|
|
||||||
setM_Lot_ID (0);
|
|
||||||
setM_Product_ID (0);
|
|
||||||
setName (null);
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
} // MLot
|
} // MLot
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,9 @@ public class MLotCtl extends X_M_LotCtl
|
||||||
super (ctx, M_LotCtl_ID, trxName);
|
super (ctx, M_LotCtl_ID, trxName);
|
||||||
if (M_LotCtl_ID == 0)
|
if (M_LotCtl_ID == 0)
|
||||||
{
|
{
|
||||||
// setM_LotCtl_ID (0);
|
|
||||||
setStartNo (1);
|
setStartNo (1);
|
||||||
setCurrentNext (1);
|
setCurrentNext (1);
|
||||||
setIncrementNo (1);
|
setIncrementNo (1);
|
||||||
// setName (null);
|
|
||||||
}
|
}
|
||||||
} // MLotCtl
|
} // MLotCtl
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue