Billing List Form

This commit is contained in:
animfalahuddin 2018-08-16 18:16:09 +07:00
parent 34c2f9db0a
commit 5530f346f1
2 changed files with 48 additions and 1 deletions

View File

@ -1,5 +1,48 @@
package andromedia.midsuit.factory;
public class MID_FormFactory {
import java.util.logging.Level;
import org.adempiere.webui.factory.IFormFactory;
import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.IFormController;
import org.compiere.util.CLogger;
public class MID_FormFactory implements IFormFactory {
protected transient CLogger log = CLogger.getCLogger(getClass());
@Override
public ADForm newFormInstance(String formName) {
// TODO Auto-generated method stub
if (formName.startsWith("andromedia.midsuit.form")) {
Object form = null;
Class<?> clazz = null;
ClassLoader loader = getClass().getClassLoader();
try {
clazz = loader.loadClass(formName);
} catch (Exception e) {
log.log(Level.SEVERE, "Load Form Class Failed");
}
if (clazz != null) {
try {
form = clazz.newInstance();
} catch (Exception e) {
log.log(Level.SEVERE, "Class initialized error");
}
}
if (form != null) {
if (form instanceof ADForm) {
return (ADForm) form;
} else if (form instanceof IFormController) {
IFormController controller = (IFormController) form;
ADForm adform = controller.getForm();
adform.setICustomForm(controller);
return adform;
}
}
}
return null;
}
}

View File

@ -10,6 +10,8 @@ import org.compiere.model.PO;
import org.compiere.util.Env;
import andromedia.midsuit.model.MID_Aging;
import andromedia.midsuit.model.MID_MBillingList;
import andromedia.midsuit.model.MID_MBillingListLine;
import andromedia.midsuit.model.MID_MRequisitionTrx;
import andromedia.midsuit.model.MID_MRequisitionTrxLine;
import andromedia.midsuit.model.X_zpos_Cashier;
@ -22,6 +24,8 @@ public class MID_ModelFactory implements IModelFactory{
mapTableModels.put(MID_MRequisitionTrxLine.Table_Name, "andromedia.midsuit.model.MID_MRequisitionTrxLine");
mapTableModels.put(X_zpos_Cashier.Table_Name, "andromedia.midsuit.model.X_zpos_Cashier");
mapTableModels.put(MID_Aging.Table_Name, "andromedia.midsuit.model.MID_Aging");
mapTableModels.put(MID_MBillingList.Table_Name, "andromedia.midsuit.model.MID_MBillingList");
mapTableModels.put(MID_MBillingListLine.Table_Name, "andromedia.midsuit.model.MID_MBillingListLine");
}
@Override