String strCommand = null;
HeaderData[] data=null;
XmlDocument xmlDocument=null;
FieldProvider dataField = vars.getEditionData(tabId);
vars.removeEditionData(tabId);
String strParamDocumentNo = vars.getSessionValue(tabId + "|paramDocumentNo");
String strParamMovementDate = vars.getSessionValue(tabId + "|paramMovementDate");
String strParamC_BPartner_ID = vars.getSessionValue(tabId + "|paramC_BPartner_ID");
String strParamMovementDate_f = vars.getSessionValue(tabId + "|paramMovementDate_f");
boolean hasSearchCondition=false;
if (!(strParamDocumentNo.equals("") && strParamMovementDate.equals("") && strParamC_BPartner_ID.equals("") && strParamMovementDate_f.equals(""))) hasSearchCondition=true;
String strParamSessionDate = vars.getGlobalVariable("inpParamSessionDate", Utility.getTransactionalDate(this, vars, windowId), "");
String buscador = "";
String[] discard = {"", "isNotTest"};
if (vars.getSessionValue("#ShowTest", "N").equals("Y")) discard[1] = new String("isTest");
if (dataField==null) {
if (!boolNew) {
discard[0] = new String("newDiscard");
data = HeaderData.selectEdit(this, vars.getSessionValue("#AD_SqlDateTimeFormat"), vars.getLanguage(), strM_InOut_ID, Utility.getContext(this, vars, "#User_Client", windowId), Utility.getContext(this, vars, "#AccessibleOrgTree", windowId, accesslevel));
if (!strM_InOut_ID.equals("") && (data == null || data.length==0)) {
response.sendRedirect(strDireccion + request.getServletPath() + "?Command=RELATION");
return;
}
refreshSessionEdit(vars, data);
strCommand = "EDIT";
}
if (boolNew || data==null || data.length==0) {
discard[0] = new String ("editDiscard");
strCommand = "NEW";
data = new HeaderData[0];
} else {
discard[0] = new String ("newDiscard");
}
} else {
if (dataField.getField("mInoutId") == null || dataField.getField("mInoutId").equals("")) {
discard[0] = new String ("editDiscard");
strCommand = "NEW";
boolNew = true;
} else {
discard[0] = new String ("newDiscard");
strCommand = "EDIT";
}
}
String strISLOGISTIC = "N";
vars.setSessionValue(windowId + "|ISLOGISTIC", strISLOGISTIC);
if (dataField==null) {
if (boolNew || data==null || data.length==0) {
refreshSessionNew(vars);
data = HeaderData.set(Utility.getDefault(this, vars, "Freight_Currency_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "Description", "", "184", "", dataField), Utility.getDefault(this, vars, "MovementType", "", "184", "", dataField), Utility.getDefault(this, vars, "MovementDate", "@#Date@", "184", "", dataField), Utility.getDefault(this, vars, "Processed", "", "184", "N", dataField), Utility.getDefault(this, vars, "Processing", "", "184", "N", dataField), "", Utility.getDefault(this, vars, "AD_Client_ID", "@AD_CLIENT_ID@", "184", "", dataField), Utility.getDefault(this, vars, "AD_Org_ID", "@#AD_Org_ID@", "184", "", dataField), "Y", Utility.getDefault(this, vars, "CreatedBy", "", "184", "", dataField), HeaderData.selectDef3526_0(this, Utility.getDefault(this, vars, "CreatedBy", "", "184", "", dataField)), Utility.getDefault(this, vars, "UpdatedBy", "", "184", "", dataField), HeaderData.selectDef3528_1(this, Utility.getDefault(this, vars, "UpdatedBy", "", "184", "", dataField)), Utility.getDefault(this, vars, "IsSOTrx", "@IsSOTrx@", "184", "N", dataField), Utility.getDefault(this, vars, "DocumentNo", "", "184", "", dataField), Utility.getDefault(this, vars, "C_DocType_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "IsPrinted", "", "184", "N", dataField), Utility.getDefault(this, vars, "DateAcct", "@#Date@", "184", "", dataField), Utility.getDefault(this, vars, "C_BPartner_ID", "", "184", "", dataField), HeaderData.selectDef3795_2(this, Utility.getDefault(this, vars, "C_BPartner_ID", "", "184", "", dataField)), Utility.getDefault(this, vars, "C_BPartner_Location_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "AD_User_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "M_Warehouse_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "POReference", "", "184", "", dataField), Utility.getDefault(this, vars, "DeliveryRule", "A", "184", "", dataField), Utility.getDefault(this, vars, "FreightCostRule", "I", "184", "", dataField), Utility.getDefault(this, vars, "FreightAmt", "0", "184", "", dataField), Utility.getDefault(this, vars, "DeliveryViaRule", "P", "184", "", dataField), Utility.getDefault(this, vars, "M_Shipper_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "C_Charge_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "ChargeAmt", "0", "184", "", dataField), Utility.getDefault(this, vars, "PriorityRule", "5", "184", "", dataField), Utility.getDefault(this, vars, "DatePrinted", "", "184", "", dataField), Utility.getDefault(this, vars, "C_Order_ID", "", "184", "", dataField), HeaderData.selectDef3809_3(this, Utility.getDefault(this, vars, "C_Order_ID", "", "184", "", dataField)), Utility.getDefault(this, vars, "DateOrdered", "", "184", "", dataField), Utility.getDefault(this, vars, "DocStatus", "DR", "184", "", dataField), Utility.getDefault(this, vars, "DocAction", "CO", "184", "N", dataField), (vars.getLanguage().equals("en_US")?ListData.selectName(this, "135", Utility.getDefault(this, vars, "DocAction", "CO", "184", "N", dataField)):ListData.selectNameTrl(this, vars.getLanguage(), "135", Utility.getDefault(this, vars, "DocAction", "CO", "184", "N", dataField))), Utility.getDefault(this, vars, "CreateFrom", "", "184", "N", dataField), Utility.getDefault(this, vars, "GenerateTo", "", "184", "N", dataField), Utility.getDefault(this, vars, "C_Invoice_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "Posted", "", "184", "N", dataField), (vars.getLanguage().equals("en_US")?ListData.selectName(this, "234", Utility.getDefault(this, vars, "Posted", "", "184", "N", dataField)):ListData.selectNameTrl(this, vars.getLanguage(), "234", Utility.getDefault(this, vars, "Posted", "", "184", "N", dataField))), Utility.getDefault(this, vars, "UpdateLines", "N", "184", "N", dataField), Utility.getDefault(this, vars, "Islogistic", "@ISLOGISTIC@", "184", "N", dataField), Utility.getDefault(this, vars, "GenerateLines", "N", "184", "N", dataField), Utility.getDefault(this, vars, "Delivery_Location_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "M_FreightCategory_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "Calculate_Freight", "", "184", "N", dataField), Utility.getDefault(this, vars, "SalesRep_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "PickDate", "", "184", "", dataField), Utility.getDefault(this, vars, "TrackingNo", "", "184", "", dataField), Utility.getDefault(this, vars, "NoPackages", "", "184", "", dataField), Utility.getDefault(this, vars, "ShipDate", "", "184", "", dataField), Utility.getDefault(this, vars, "User2_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "User1_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "C_Activity_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "C_Campaign_ID", "", "184", "", dataField), Utility.getDefault(this, vars, "C_Project_ID", "", "184", "", dataField), HeaderData.selectDef9585_4(this, Utility.getDefault(this, vars, "C_Project_ID", "", "184", "", dataField)), Utility.getDefault(this, vars, "AD_OrgTrx_ID", "", "184", "", dataField));
data[0].documentno = "<" + Utility.getDocumentNo( this, vars, windowId, "M_InOut", "", data[0].cDoctypeId, false, false) + ">";
}
}
String currentOrg = (boolNew?"":(dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId")));
if (!currentOrg.equals("") && !currentOrg.startsWith("'")) currentOrg = "'"+currentOrg+"'";
String currentClient = (boolNew?"":(dataField!=null?dataField.getField("adClientId"):data[0].getField("adClientId")));
if (!currentClient.equals("") && !currentClient.startsWith("'")) currentClient = "'"+currentClient+"'";
boolean editableTab = (!org.openbravo.erpCommon.utility.WindowAccessData.hasReadOnlyAccess(this, vars.getRole(), tabId) && (currentOrg.equals("") || Utility.isElementInList(Utility.getContext(this, vars, "#User_Org", windowId, accesslevel),currentOrg)) && (currentClient.equals("") || Utility.isElementInList(Utility.getContext(this, vars, "#User_Client", windowId, accesslevel), currentClient)));
if (editableTab)
xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpWindows/GoodsReceipt/Header_Edition",discard).createXmlDocument();
else
xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpWindows/GoodsReceipt/Header_NonEditable",discard).createXmlDocument();
xmlDocument.setParameter("tabId", tabId);
ToolBar toolbar = new ToolBar(this, editableTab, vars.getLanguage(), "Header", (strCommand.equals("NEW") || boolNew || (dataField==null && (data==null || data.length==0))), "document.frmMain.inpmInoutId", "", "../RptM_Inout.pdf", "N".equals("Y"), "GoodsReceipt", strReplaceWith, true, false, false, Utility.hasTabAttachments(this, vars, tabId, strM_InOut_ID));
toolbar.prepareEditionTemplate("N".equals("Y"), hasSearchCondition, vars.getSessionValue("#ShowTest", "N").equals("Y"), "STD", Utility.getContext(this, vars, "ShowAudit", windowId).equals("Y"));
xmlDocument.setParameter("toolbar", toolbar.toString());
try {
WindowTabs tabs = new WindowTabs(this, vars, tabId, windowId, true, (strCommand.equalsIgnoreCase("NEW")));
xmlDocument.setParameter("parentTabContainer", tabs.parentTabs());
xmlDocument.setParameter("mainTabContainer", tabs.mainTabs());
// if (!strM_InOut_ID.equals("")) xmlDocument.setParameter("childTabContainer", tabs.childTabs(false));
// else xmlDocument.setParameter("childTabContainer", tabs.childTabs(true));
xmlDocument.setParameter("childTabContainer", tabs.childTabs(false));
NavigationBar nav = new NavigationBar(this, vars.getLanguage(), "Header_Relation.html", "GoodsReceipt", "W", strReplaceWith, tabs.breadcrumb());
xmlDocument.setParameter("navigationBar", nav.toString());
LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "Header_Relation.html", strReplaceWith);
xmlDocument.setParameter("leftTabs", lBar.editionTemplate(strCommand.equals("NEW")));
} catch (Exception ex) {
throw new ServletException(ex);
}
xmlDocument.setParameter("ISLOGISTIC", strISLOGISTIC);
xmlDocument.setParameter("commandType", strCommand);
xmlDocument.setParameter("buscador",buscador);
xmlDocument.setParameter("windowId", windowId);
xmlDocument.setParameter("changed", "");
xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
xmlDocument.setParameter("theme", vars.getTheme());
final String strMappingName = UtilityData.selectObjectMapping(this, tabId);
xmlDocument.setParameter("mappingName", strMappingName);
xmlDocument.setParameter("confirmOnChanges", Utility.getJSConfirmOnChanges(vars, windowId));
//xmlDocument.setParameter("buttonReference", Utility.messageBD(this, "Reference", vars.getLanguage()));
xmlDocument.setParameter("paramSessionDate", strParamSessionDate);
xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
OBError myMessage = vars.getMessage(tabId);
vars.removeMessage(tabId);
if (myMessage!=null) {
xmlDocument.setParameter("messageType", myMessage.getType());
xmlDocument.setParameter("messageTitle", myMessage.getTitle());
xmlDocument.setParameter("messageMessage", myMessage.getMessage());
}
xmlDocument.setParameter("displayLogic", getDisplayLogicContext(vars, boolNew));
if (dataField==null) {
xmlDocument.setData("structure1",data);
} else {
FieldProvider[] dataAux = new FieldProvider[1];
dataAux[0] = dataField;
xmlDocument.setData("structure1",dataAux);
}
try {
ComboTableData comboTableData = null;
String userClientList = "";
if (editableTab)
userClientList=Utility.getContext(this, vars, "#User_Client", windowId, accesslevel); //editable record
else
userClientList=currentClient;
comboTableData = new ComboTableData(vars, this, "19", "AD_Client_ID", "", "", null, userClientList, 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("adClientId"):dataField.getField("adClientId")));
xmlDocument.setData("reportAD_Client_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
String userOrgList = "";
if (editableTab)
userOrgList=Utility.getContext(this, vars, "#User_Org", windowId, accesslevel); //editable record
else
userOrgList=currentOrg;
comboTableData = new ComboTableData(vars, this, "19", "AD_Org_ID", "", "", userOrgList, Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("adOrgId"):dataField.getField("adOrgId")));
xmlDocument.setData("reportAD_Org_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "C_DocType_ID", "170", "125", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("cDoctypeId"):dataField.getField("cDoctypeId")));
xmlDocument.setData("reportC_DocType_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
xmlDocument.setParameter("MovementDate_Format", vars.getSessionValue("#AD_SqlDateFormat"));
xmlDocument.setParameter("DateAcct_Format", vars.getSessionValue("#AD_SqlDateFormat"));
comboTableData = new ComboTableData(vars, this, "19", "C_BPartner_Location_ID", "", "167", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("cBpartnerLocationId"):dataField.getField("cBpartnerLocationId")));
xmlDocument.setData("reportC_BPartner_Location_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "19", "AD_User_ID", "", "123", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("adUserId"):dataField.getField("adUserId")));
xmlDocument.setData("reportAD_User_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "Delivery_Location_ID", "159", "167", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("deliveryLocationId"):dataField.getField("deliveryLocationId")));
xmlDocument.setData("reportDelivery_Location_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "M_Warehouse_ID", "197", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("mWarehouseId"):dataField.getField("mWarehouseId")));
xmlDocument.setData("reportM_Warehouse_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "PriorityRule", "154", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("priorityrule"):dataField.getField("priorityrule")));
xmlDocument.setData("reportPriorityRule","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "DeliveryViaRule", "152", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("deliveryviarule"):dataField.getField("deliveryviarule")));
xmlDocument.setData("reportDeliveryViaRule","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "19", "M_Shipper_ID", "", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("mShipperId"):dataField.getField("mShipperId")));
xmlDocument.setData("reportM_Shipper_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "SalesRep_ID", "190", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("salesrepId"):dataField.getField("salesrepId")));
xmlDocument.setData("reportSalesRep_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "DeliveryRule", "151", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("deliveryrule"):dataField.getField("deliveryrule")));
xmlDocument.setData("reportDeliveryRule","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "FreightCostRule", "153", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("freightcostrule"):dataField.getField("freightcostrule")));
xmlDocument.setData("reportFreightCostRule","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "19", "M_FreightCategory_ID", "", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("mFreightcategoryId"):dataField.getField("mFreightcategoryId")));
xmlDocument.setData("reportM_FreightCategory_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "Freight_Currency_ID", "112", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("freightCurrencyId"):dataField.getField("freightCurrencyId")));
xmlDocument.setData("reportFreight_Currency_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
xmlDocument.setParameter("Calculate_Freight_BTNname", Utility.getButtonName(this, vars, "803290", "Calculate_Freight_linkBTN", usedButtonShortCuts, reservedButtonShortCuts));
xmlDocument.setParameter("buttonFreightAmt", Utility.messageBD(this, "Calc", vars.getLanguage()));
comboTableData = new ComboTableData(vars, this, "18", "C_Charge_ID", "200", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("cChargeId"):dataField.getField("cChargeId")));
xmlDocument.setData("reportC_Charge_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
xmlDocument.setParameter("buttonChargeAmt", Utility.messageBD(this, "Calc", vars.getLanguage()));
xmlDocument.setParameter("CreateFrom_BTNname", Utility.getButtonName(this, vars, "4248", "CreateFrom_linkBTN", usedButtonShortCuts, reservedButtonShortCuts));
xmlDocument.setParameter("GenerateTo_BTNname", Utility.getButtonName(this, vars, "4249", "GenerateTo_linkBTN", usedButtonShortCuts, reservedButtonShortCuts));
comboTableData = new ComboTableData(vars, this, "19", "C_Activity_ID", "", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("cActivityId"):dataField.getField("cActivityId")));
xmlDocument.setData("reportC_Activity_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "19", "C_Campaign_ID", "", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("cCampaignId"):dataField.getField("cCampaignId")));
xmlDocument.setData("reportC_Campaign_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "18", "AD_OrgTrx_ID", "130", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("adOrgtrxId"):dataField.getField("adOrgtrxId")));
xmlDocument.setData("reportAD_OrgTrx_ID","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "DocStatus", "131", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("docstatus"):dataField.getField("docstatus")));
xmlDocument.setData("reportDocStatus","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
comboTableData = new ComboTableData(vars, this, "17", "MovementType", "189", "", Utility.getReferenceableOrg(vars, (dataField!=null?dataField.getField("adOrgId"):data[0].getField("adOrgId").equals("")?vars.getOrg():data[0].getField("adOrgId"))), Utility.getContext(this, vars, "#User_Client", windowId), 0);
Utility.fillSQLParameters(this, vars, (dataField==null?data[0]:dataField), comboTableData, windowId, (dataField==null?data[0].getField("movementtype"):dataField.getField("movementtype")));
xmlDocument.setData("reportMovementType","liststructure", comboTableData.select(!strCommand.equals("NEW")));
comboTableData = null;
xmlDocument.setParameter("DocAction_BTNname", Utility.getButtonName(this, vars, "135", (dataField==null?data[0].getField("docaction"):dataField.getField("docaction")), "DocAction_linkBTN", usedButtonShortCuts, reservedButtonShortCuts));
xmlDocument.setParameter("Posted_BTNname", Utility.getButtonName(this, vars, "234", (dataField==null?data[0].getField("posted"):dataField.getField("posted")), "Posted_linkBTN", usedButtonShortCuts, reservedButtonShortCuts));
xmlDocument.setParameter("Created_Format", vars.getSessionValue("#AD_SqlDateTimeFormat"));xmlDocument.setParameter("Created_Maxlength", Integer.toString(vars.getSessionValue("#AD_SqlDateTimeFormat").length()));
xmlDocument.setParameter("Updated_Format", vars.getSessionValue("#AD_SqlDateTimeFormat"));xmlDocument.setParameter("Updated_Maxlength", Integer.toString(vars.getSessionValue("#AD_SqlDateTimeFormat").length()));
xmlDocument.setParameter("DateOrdered_Format", vars.getSessionValue("#AD_SqlDateFormat"));
xmlDocument.setParameter("DatePrinted_Format", vars.getSessionValue("#AD_SqlDateFormat"));
xmlDocument.setParameter("ShipDate_Format", vars.getSessionValue("#AD_SqlDateTimeFormat"));xmlDocument.setParameter("ShipDate_Maxlength", Integer.toString(vars.getSessionValue("#AD_SqlDateTimeFormat").length()));