Print button while creating a new document - ID: 2858657
This commit is contained in:
parent
1f90a47bc0
commit
93144b9d16
|
@ -16,10 +16,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.print;
|
package org.compiere.print;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.adempiere.webui.window.FDialog;
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
import org.compiere.apps.ADialog;
|
import org.compiere.apps.ADialog;
|
||||||
import org.compiere.apps.ProcessCtl;
|
import org.compiere.apps.ProcessCtl;
|
||||||
import org.compiere.model.MPaySelectionCheck;
|
import org.compiere.model.MPaySelectionCheck;
|
||||||
|
@ -32,7 +33,6 @@ import org.compiere.util.ASyncProcess;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Ini;
|
import org.compiere.util.Ini;
|
||||||
import org.zkoss.zk.ui.Component;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report Controller.
|
* Report Controller.
|
||||||
|
@ -256,8 +256,24 @@ public class ReportCtl
|
||||||
{
|
{
|
||||||
ReportEngine re = ReportEngine.get (Env.getCtx(), type, Record_ID);
|
ReportEngine re = ReportEngine.get (Env.getCtx(), type, Record_ID);
|
||||||
if (re == null)
|
if (re == null)
|
||||||
|
{
|
||||||
|
if (Ini.isClient())
|
||||||
{
|
{
|
||||||
ADialog.error(0, null, "NoDocPrintFormat");
|
ADialog.error(0, null, "NoDocPrintFormat");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ClassLoader loader = ReportCtl.class.getClassLoader();
|
||||||
|
Class<?> clazz = loader.loadClass("org.adempiere.webui.window.FDialog");
|
||||||
|
Method m = clazz.getMethod("error", Integer.TYPE, String.class);
|
||||||
|
m.invoke(null, 0, "NoDocPrintFormat");
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new AdempiereException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue