Search in sources :

Example 16 with ProcessInfoParameter

use of org.compiere.process.ProcessInfoParameter in project adempiere by adempiere.

the class ZkReportViewerProvider method openViewer.

public void openViewer(ReportEngine report) {
    if (report.getPrintInfo().getAD_Process_ID() == 202 && MSysConfig.getBooleanValue("SMART_REPORT", Boolean.FALSE)) {
        ProcessInfo processInfo = report.getProcessInfo();
        MReport m_report = new MReport(report.getCtx(), processInfo.getRecord_ID(), processInfo.getTransactionName());
        ProcessInfoParameter[] pi = processInfo.getParameter();
        // Goodwill BF: report title is taken wrongly from other report if report line set is shared 
        // - passing PA_Report_ID instead of PA_ReportLineSet_ID
        Window smjviewer = new SMJReportViewer(processInfo.getAD_PInstance_ID(), processInfo.getTransactionName(), m_report.getPA_Report_ID(), pi[0].getParameterAsInt(), report.getPrintFormat().getAD_PrintFont_ID(), m_report.getColumnSet().getColumns());
        smjviewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
        smjviewer.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
        SessionManager.getAppDesktop().showWindow(smjviewer);
    } else {
        Window viewer = new ZkReportViewer(report, report.getName());
        viewer.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
        viewer.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
        SessionManager.getAppDesktop().showWindow(viewer);
    }
}
Also used : MReport(org.compiere.report.MReport) Window(org.adempiere.webui.component.Window) ProcessInfoParameter(org.compiere.process.ProcessInfoParameter) ProcessInfo(org.compiere.process.ProcessInfo) SMJReportViewer(org.adempiere.webui.component.SMJReportViewer)

Example 17 with ProcessInfoParameter

use of org.compiere.process.ProcessInfoParameter in project adempiere by adempiere.

the class CashFlow method prepare.

protected void prepare() {
    for (ProcessInfoParameter para : getParameter()) {
        log.config("prepare - " + para);
        String name = para.getParameterName();
        if (para.getParameter() == null)
            ;
        else if (name.equals("DueDate"))
            p_DueDate = (Timestamp) para.getParameter();
        else if (name.equals("C_Currency_ID"))
            p_C_Currency_ID = ((BigDecimal) para.getParameter()).intValue();
        else if (name.equals("C_BP_Group_ID"))
            p_C_BP_Group_ID = ((BigDecimal) para.getParameter()).intValue();
        else if (name.equals("C_BPartner_ID"))
            p_C_BPartner_ID = ((BigDecimal) para.getParameter()).intValue();
        else if (name.equals("IsIncludeOrders"))
            p_IsIncludeOrders = "Y".equals(para.getParameter());
        else if (name.equals("IsIncludeCashflows"))
            p_IsIncludeCashFlows = "Y".equals(para.getParameter());
        else if (name.equals("IsIncludeInvoices"))
            p_IsIncludeInvoices = "Y".equals(para.getParameter());
        else if (name.equals("IsIncludeBankBalances"))
            p_IsIncludeBankBalance = "Y".equals(para.getParameter());
        else
            log.config("prepare - Unknown Parameter: " + name);
    }
    if (p_DueDate == null)
        p_DueDate = new Timestamp(System.currentTimeMillis());
}
Also used : ProcessInfoParameter(org.compiere.process.ProcessInfoParameter) Timestamp(java.sql.Timestamp) BigDecimal(java.math.BigDecimal)

Example 18 with ProcessInfoParameter

use of org.compiere.process.ProcessInfoParameter in project adempiere by adempiere.

the class GenerateSalesHistory method prepare.

/**
	 * Prepare - e.g., get Parameters.
	 */
protected void prepare() {
    for (ProcessInfoParameter para : getParameter()) {
        String name = para.getParameterName();
        if (para.getParameter() == null)
            ;
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_AD_Org_ID))
            p_AD_Org_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_DateInvoiced)) {
            p_DateInvoicedFrom = (Timestamp) para.getParameter();
            p_DateInvoicedTo = (Timestamp) para.getParameter_To();
        } else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_BPartner_ID))
            p_C_BPartner_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_BP_Group_ID))
            p_C_BP_Group_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_BPartner_Location_ID))
            p_C_BPartner_Location_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Product_ID))
            p_M_Product_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Product_Category_ID))
            p_M_Product_Category_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Product_Classification_ID))
            p_M_Product_Classification_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Product_Class_ID))
            p_M_Product_Class_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Product_Group_ID))
            p_M_Product_Group_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_M_Warehouse_ID))
            p_M_Warehouse_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_Campaign_ID))
            p_C_Campaign_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_SalesRegion_ID))
            p_C_SalesRegion_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_Project_ID))
            p_C_Project_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_C_Activity_ID))
            p_C_Activity_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_User1_ID))
            p_User1_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_User2_ID))
            p_User2_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_User3_ID))
            p_User3_ID = para.getParameterAsInt();
        else if (name.equals(I_C_SalesHistory.COLUMNNAME_User4_ID))
            p_User4_ID = para.getParameterAsInt();
        else
            log.log(Level.SEVERE, "Unknown Parameter: " + name);
    }
}
Also used : ProcessInfoParameter(org.compiere.process.ProcessInfoParameter)

Example 19 with ProcessInfoParameter

use of org.compiere.process.ProcessInfoParameter in project adempiere by adempiere.

the class MRP method prepare.

protected void prepare() {
    for (ProcessInfoParameter para : getParameter()) {
        String name = para.getParameterName();
        if (para.getParameter() == null)
            ;
        else if (name.equals("AD_Org_ID"))
            p_AD_Org_ID = para.getParameterAsInt();
        else if (name.equals("M_Warehouse_ID"))
            p_M_Warehouse_ID = para.getParameterAsInt();
        else if (name.equals("S_Resource_ID"))
            p_S_Resource_ID = para.getParameterAsInt();
        else if (name.equals("Synchronize"))
            p_IsSynchronize = para.getParameterAsBoolean();
        else if (name.equals("IsMPS"))
            p_IsMPS = para.getParameterAsBoolean();
        else if (name.equals("IsRequiredMRP"))
            p_IsMRP = para.getParameterAsBoolean();
        else if (name.equals("IsRequiredDRP"))
            p_IsDRP = para.getParameterAsBoolean();
        else if (name.equals("IsBOM"))
            p_IsMfg = para.getParameterAsBoolean();
        else if (name.equals("IsPurchased"))
            p_IsPur = para.getParameterAsBoolean();
        else if (name.equals("LowLevel"))
            p_IsLowLevel = para.getParameterAsBoolean();
        else if (name.equals("Planner_ID"))
            p_Planner_ID = para.getParameterAsInt();
        else if (name.equals("C_BPartner_ID"))
            p_C_BPartner_ID = para.getParameterAsInt();
        else if (name.equals("M_Product_ID"))
            p_M_Product_ID = para.getParameterAsInt();
        else if (name.equals("M_Produc_Category_ID"))
            p_M_Product_Category_ID = para.getParameterAsInt();
        else if (name.equals("Version"))
            p_Version = (String) para.getParameter();
        else
            log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
    }
    //Regenerative Material Plan process
    int AD_Process_ID = getProcessInfo().getAD_Process_ID();
    if (AD_Process_ID == 53016) {
        EXECUTION_MODE = MRP_Regenerative;
        p_IsMRP = false;
        if (isSynchronize())
            p_IsDRP = false;
    }
    //Net Change Material Plan
    if (AD_Process_ID == 53320) {
        EXECUTION_MODE = MRP_Net_Change;
        p_IsMRP = true;
        if (isSynchronize())
            p_IsDRP = true;
    }
    //Selective Material Plan process
    if (AD_Process_ID == 53313)
        EXECUTION_MODE = MRP_Selective;
    // DRP Distribution Plan
    if (AD_Process_ID == 53022) {
        EXECUTION_MODE = MPR_DRP;
        p_IsSynchronize = true;
        p_IsDRP = true;
    }
}
Also used : ProcessInfoParameter(org.compiere.process.ProcessInfoParameter)

Example 20 with ProcessInfoParameter

use of org.compiere.process.ProcessInfoParameter in project adempiere by adempiere.

the class CompletePrintOrder method prepare.

/**
	 * Prepare - e.g., get Parameters.
	 */
protected void prepare() {
    for (ProcessInfoParameter para : getParameter()) {
        String name = para.getParameterName();
        if (para.getParameter() == null)
            ;
        else if (name.equals("PP_Order_ID"))
            p_PP_Order_ID = para.getParameterAsInt();
        else if (name.equals("IsPrintPickList"))
            p_IsPrintPickList = para.getParameterAsBoolean();
        else if (name.equals("IsPrintWorkflow"))
            p_IsPrintWorkflow = para.getParameterAsBoolean();
        else if (name.equals("IsPrintPackingList"))
            p_IsPrintPackList = para.getParameterAsBoolean();
        else if (name.equals("IsComplete"))
            p_IsComplete = para.getParameterAsBoolean();
        else
            log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
    }
}
Also used : ProcessInfoParameter(org.compiere.process.ProcessInfoParameter)

Aggregations

ProcessInfoParameter (org.compiere.process.ProcessInfoParameter)26 Timestamp (java.sql.Timestamp)4 ProcessInfo (org.compiere.process.ProcessInfo)3 BigDecimal (java.math.BigDecimal)2 AdempiereException (org.adempiere.exceptions.AdempiereException)2 Trx (org.compiere.util.Trx)2 PrinterJob (java.awt.print.PrinterJob)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 MalformedURLException (java.net.MalformedURLException)1 CallableStatement (java.sql.CallableStatement)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Locale (java.util.Locale)1 PropertyResourceBundle (java.util.PropertyResourceBundle)1 Vector (java.util.Vector)1