Port swing client's docAction parameter enhancement to zk client
This commit is contained in:
parent
4e59c43464
commit
1f0d78aba4
|
@ -65,6 +65,7 @@ import org.compiere.model.MPInstancePara;
|
||||||
import org.compiere.model.MPrivateAccess;
|
import org.compiere.model.MPrivateAccess;
|
||||||
import org.compiere.model.MRMA;
|
import org.compiere.model.MRMA;
|
||||||
import org.compiere.print.ReportEngine;
|
import org.compiere.print.ReportEngine;
|
||||||
|
import org.compiere.process.DocAction;
|
||||||
import org.compiere.process.ProcessInfo;
|
import org.compiere.process.ProcessInfo;
|
||||||
import org.compiere.process.ProcessInfoUtil;
|
import org.compiere.process.ProcessInfoUtil;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
|
@ -97,6 +98,8 @@ import org.zkoss.zul.Space;
|
||||||
*/
|
*/
|
||||||
public class WInOutGen extends ADForm implements EventListener, ValueChangeListener, WTableModelListener
|
public class WInOutGen extends ADForm implements EventListener, ValueChangeListener, WTableModelListener
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initForm()
|
protected void initForm()
|
||||||
{
|
{
|
||||||
|
@ -155,6 +158,8 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
|
|
||||||
private Label lDocType = new Label();
|
private Label lDocType = new Label();
|
||||||
private Listbox cmbDocType = ListboxFactory.newDropdownListbox();
|
private Listbox cmbDocType = ListboxFactory.newDropdownListbox();
|
||||||
|
private Label lDocAction = new Label();
|
||||||
|
private WTableDirEditor docAction;
|
||||||
|
|
||||||
/** User selection */
|
/** User selection */
|
||||||
private ArrayList<Integer> selection = null;
|
private ArrayList<Integer> selection = null;
|
||||||
|
@ -234,6 +239,10 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
selNorthPanel.getRows().appendChild(row);
|
selNorthPanel.getRows().appendChild(row);
|
||||||
row.appendChild(lDocType.rightAlign());
|
row.appendChild(lDocType.rightAlign());
|
||||||
row.appendChild(cmbDocType);
|
row.appendChild(cmbDocType);
|
||||||
|
row.appendChild(new Space());
|
||||||
|
row.appendChild(lDocAction.rightAlign());
|
||||||
|
row.appendChild(docAction.getComponent());
|
||||||
|
row.appendChild(new Space());
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -250,6 +259,14 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
fWarehouse.addValueChangeListener(this);
|
fWarehouse.addValueChangeListener(this);
|
||||||
fWarehouse.setValue(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
|
fWarehouse.setValue(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
|
||||||
m_M_Warehouse_ID = fWarehouse.getValue();
|
m_M_Warehouse_ID = fWarehouse.getValue();
|
||||||
|
// Document Action Prepared/ Completed
|
||||||
|
lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
|
||||||
|
MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 4324 /* M_InOut.DocStatus */,
|
||||||
|
DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */,
|
||||||
|
false, "AD_Ref_List.Value IN ('CO','PR')");
|
||||||
|
docAction = new WTableDirEditor("DocAction", true, false, true,docActionL);
|
||||||
|
docAction.setValue(DocAction.ACTION_Complete);
|
||||||
|
docAction.addValueChangeListener(this);
|
||||||
// C_Order.C_BPartner_ID
|
// C_Order.C_BPartner_ID
|
||||||
MLookup bpL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
|
MLookup bpL = MLookupFactory.get (Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
|
||||||
fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
|
fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
|
||||||
|
@ -653,8 +670,19 @@ public class WInOutGen extends ADForm implements EventListener, ValueChangeListe
|
||||||
log.log(Level.SEVERE, msg);
|
log.log(Level.SEVERE, msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Add Parameter - M_Warehouse_ID=x
|
//Add Document action parameter
|
||||||
ip = new MPInstancePara(instance, 20);
|
ip = new MPInstancePara(instance, 20);
|
||||||
|
String docActionSelected = (String)docAction.getValue();
|
||||||
|
ip.setParameter("DocAction", docActionSelected);
|
||||||
|
if(!ip.save())
|
||||||
|
{
|
||||||
|
String msg = "No DocAction Parameter added";
|
||||||
|
info.setContent(msg);
|
||||||
|
log.log(Level.SEVERE, msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Add Parameter - M_Warehouse_ID=x
|
||||||
|
ip = new MPInstancePara(instance, 30);
|
||||||
ip.setParameter("M_Warehouse_ID", Integer.parseInt(m_M_Warehouse_ID.toString()));
|
ip.setParameter("M_Warehouse_ID", Integer.parseInt(m_M_Warehouse_ID.toString()));
|
||||||
if (!ip.save())
|
if (!ip.save())
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,6 +64,7 @@ import org.compiere.model.MPInstancePara;
|
||||||
import org.compiere.model.MPrivateAccess;
|
import org.compiere.model.MPrivateAccess;
|
||||||
import org.compiere.model.MRMA;
|
import org.compiere.model.MRMA;
|
||||||
import org.compiere.print.ReportEngine;
|
import org.compiere.print.ReportEngine;
|
||||||
|
import org.compiere.process.DocAction;
|
||||||
import org.compiere.process.ProcessInfo;
|
import org.compiere.process.ProcessInfo;
|
||||||
import org.compiere.process.ProcessInfoUtil;
|
import org.compiere.process.ProcessInfoUtil;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
|
@ -98,6 +99,8 @@ import org.zkoss.zul.Space;
|
||||||
public class WInvoiceGen extends ADForm
|
public class WInvoiceGen extends ADForm
|
||||||
implements EventListener, ValueChangeListener, WTableModelListener
|
implements EventListener, ValueChangeListener, WTableModelListener
|
||||||
{
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize Panel
|
* Initialize Panel
|
||||||
*/
|
*/
|
||||||
|
@ -155,6 +158,8 @@ public class WInvoiceGen extends ADForm
|
||||||
|
|
||||||
private Label lDocType = new Label();
|
private Label lDocType = new Label();
|
||||||
private Listbox cmbDocType = ListboxFactory.newDropdownListbox();
|
private Listbox cmbDocType = ListboxFactory.newDropdownListbox();
|
||||||
|
private Label lDocAction = new Label();
|
||||||
|
private WTableDirEditor docAction;
|
||||||
private ProcessInfo m_pi;
|
private ProcessInfo m_pi;
|
||||||
private int[] m_ids;
|
private int[] m_ids;
|
||||||
|
|
||||||
|
@ -193,6 +198,7 @@ public class WInvoiceGen extends ADForm
|
||||||
Row row = selNorthPanel.newRows().newRow();
|
Row row = selNorthPanel.newRows().newRow();
|
||||||
row.appendChild(lOrg.rightAlign());
|
row.appendChild(lOrg.rightAlign());
|
||||||
row.appendChild(fOrg.getComponent());
|
row.appendChild(fOrg.getComponent());
|
||||||
|
row.appendChild(new Space());
|
||||||
row.appendChild(lBPartner.rightAlign());
|
row.appendChild(lBPartner.rightAlign());
|
||||||
row.appendChild(fBPartner.getComponent());
|
row.appendChild(fBPartner.getComponent());
|
||||||
row.appendChild(new Space());
|
row.appendChild(new Space());
|
||||||
|
@ -231,6 +237,10 @@ public class WInvoiceGen extends ADForm
|
||||||
selNorthPanel.getRows().appendChild(row);
|
selNorthPanel.getRows().appendChild(row);
|
||||||
row.appendChild(lDocType.rightAlign());
|
row.appendChild(lDocType.rightAlign());
|
||||||
row.appendChild(cmbDocType);
|
row.appendChild(cmbDocType);
|
||||||
|
row.appendChild(new Space());
|
||||||
|
row.appendChild(lDocAction.rightAlign());
|
||||||
|
row.appendChild(docAction.getComponent());
|
||||||
|
row.appendChild(new Space());
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -249,6 +259,14 @@ public class WInvoiceGen extends ADForm
|
||||||
fBPartner = new WSearchEditor ("C_BPartner_ID", false, false, true, bpL);
|
fBPartner = new WSearchEditor ("C_BPartner_ID", false, false, true, bpL);
|
||||||
// lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
// lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
|
||||||
fBPartner.addValueChangeListener(this);
|
fBPartner.addValueChangeListener(this);
|
||||||
|
// Document Action Prepared/ Completed
|
||||||
|
lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
|
||||||
|
MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 4324 /* M_InOut.DocStatus */,
|
||||||
|
DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135 /* _Document Action */,
|
||||||
|
false, "AD_Ref_List.Value IN ('CO','PR')");
|
||||||
|
docAction = new WTableDirEditor("DocAction", true, false, true,docActionL);
|
||||||
|
docAction.setValue(DocAction.ACTION_Complete);
|
||||||
|
docAction.addValueChangeListener(this);
|
||||||
|
|
||||||
// Document Type Sales Order/Vendor RMA
|
// Document Type Sales Order/Vendor RMA
|
||||||
lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
|
lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
|
||||||
|
@ -626,8 +644,10 @@ public class WInvoiceGen extends ADForm
|
||||||
log.log(Level.SEVERE, msg);
|
log.log(Level.SEVERE, msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//Add Document action parameter
|
||||||
para = new MPInstancePara(instance, 20);
|
para = new MPInstancePara(instance, 20);
|
||||||
para.setParameter("DocAction", "CO");
|
String docActionSelected = (String)docAction.getValue();
|
||||||
|
para.setParameter("DocAction", docActionSelected);
|
||||||
if (!para.save())
|
if (!para.save())
|
||||||
{
|
{
|
||||||
String msg = "No DocAction Parameter added"; // not translated
|
String msg = "No DocAction Parameter added"; // not translated
|
||||||
|
|
Loading…
Reference in New Issue