Fixed bug dealing with outputing a printformat for a process when AD_PrintFormat_ID was 0.

This commit is contained in:
wght 2007-06-04 20:27:55 +00:00
parent 5320ff73a8
commit 412aadbb28
1 changed files with 37 additions and 34 deletions

View File

@ -997,42 +997,45 @@ public class PackOut extends SvrProcess
{} {}
pstmtP = null; pstmtP = null;
} }
if(m_Process.getAD_PrintFormat_ID() != 0) {
m_Printformat = new X_AD_PrintFormat (getCtx(), m_Process.getAD_PrintFormat_ID(), null); m_Printformat = new X_AD_PrintFormat (getCtx(), m_Process.getAD_PrintFormat_ID(), null);
atts = createPrintformatBinding(atts,m_Printformat); atts = createPrintformatBinding(atts,m_Printformat);
hd_menu.startElement("","","printformat",atts); hd_menu.startElement("","","printformat",atts);
String sql2 = "SELECT * FROM AD_PrintFormatItem WHERE AD_PrintFormat_ID= " + rs1.getInt("AD_Printformat_ID"); String sql2 = "SELECT * FROM AD_PrintFormatItem WHERE AD_PrintFormat_ID= " + rs1.getInt("AD_Printformat_ID");
PreparedStatement pstmt2 = null; PreparedStatement pstmt2 = null;
pstmt2 = DB.prepareStatement (sql2, get_TrxName()); pstmt2 = DB.prepareStatement (sql2, get_TrxName());
try { try {
ResultSet rs2 = pstmt2.executeQuery(); ResultSet rs2 = pstmt2.executeQuery();
while (rs2.next()) while (rs2.next())
{ {
m_PrintFormatItem = new X_AD_PrintFormatItem (getCtx(), rs2.getInt("AD_PrintFormatItem_ID"), null); m_PrintFormatItem = new X_AD_PrintFormatItem (getCtx(), rs2.getInt("AD_PrintFormatItem_ID"), null);
atts = createPrintformatItemBinding(atts,m_PrintFormatItem); atts = createPrintformatItemBinding(atts,m_PrintFormatItem);
hd_menu.startElement("","","printformatitem",atts); hd_menu.startElement("","","printformatitem",atts);
hd_menu.endElement("","","printformatitem"); hd_menu.endElement("","","printformatitem");
}
rs2.close();
pstmt2.close();
pstmt2 = null;
} }
rs2.close();
pstmt2.close();
pstmt2 = null;
}
catch (Exception e)
{
log.log(Level.SEVERE,"printformatitem", e);
}
finally
{
try
{
if (pstmt2 != null)
pstmt2.close ();
}
catch (Exception e) catch (Exception e)
{} {
pstmt2 = null; log.log(Level.SEVERE,"printformatitem", e);
}
finally
{
try
{
if (pstmt2 != null)
pstmt2.close ();
}
catch (Exception e)
{}
pstmt2 = null;
}
} }
hd_menu.endElement("","","process"); hd_menu.endElement("","","process");