Search in sources :

Example 46 with Query

use of org.compiere.model.Query in project adempiere by adempiere.

the class ExpressReceiptScanBar method getSource.

protected LinkedHashMap<Integer, ArrayList<Object>> getSource() {
    if (source != null)
        return source;
    List<MWMInOutBoundLine> InOutBoundLines = new Query(Env.getCtx(), I_WM_InOutBoundLine.Table_Name, "WM_InOutBound_ID=?", null).setClient_ID().setParameters(getRecord_ID()).list();
    source = new LinkedHashMap<Integer, ArrayList<Object>>();
    for (MWMInOutBoundLine line : InOutBoundLines) {
        ArrayList<Object> parameters = new ArrayList<Object>();
        parameters.add(ID, line.getC_OrderLine_ID());
        parameters.add(PRODUCT_ID, line.getM_Product_ID());
        parameters.add(QTY_ORDERED, line.getPickedQty());
        parameters.add(QTY_PICKED, line.getPickedQty());
        parameters.add(QTY_DELIVERED, BigDecimal.ZERO);
        source.put(line.get_ID(), parameters);
    }
    return source;
}
Also used : MWMInOutBoundLine(org.eevolution.model.MWMInOutBoundLine) Query(org.compiere.model.Query) ArrayList(java.util.ArrayList)

Example 47 with Query

use of org.compiere.model.Query in project adempiere by adempiere.

the class ExpressReceiptScanBar method getProductByValueC.

public MProduct getProductByValueC(String barCode) {
    StringBuilder whereClause = new StringBuilder();
    whereClause.append("UPPER(").append(I_M_Product.COLUMNNAME_Value).append(")=?");
    return new Query(Env.getCtx(), I_M_Product.Table_Name, whereClause.toString(), null).setClient_ID().setParameters(barCode.toUpperCase()).first();
}
Also used : Query(org.compiere.model.Query)

Example 48 with Query

use of org.compiere.model.Query in project adempiere by adempiere.

the class MWMInOutBoundLine method getLocator.

/**
	 * get MLocator based in Distribution Order Line
	 * @return MLocator or null
	 */
public MLocator getLocator() {
    String whereClause = MWMInOutBoundLine.COLUMNNAME_WM_InOutBoundLine_ID + "=?";
    MDDOrderLine line = new Query(getCtx(), I_DD_OrderLine.Table_Name, whereClause, get_TrxName()).setClient_ID().setParameters(new Object[] { getWM_InOutBoundLine_ID() }).firstOnly();
    return (MLocator) line.getM_LocatorTo();
}
Also used : Query(org.compiere.model.Query) MLocator(org.compiere.model.MLocator)

Example 49 with Query

use of org.compiere.model.Query in project adempiere by adempiere.

the class MWMInOutBoundLine method getByInvoiceLine.

public static MWMInOutBoundLine getByInvoiceLine(MInvoiceLine invoiceLine) {
    StringBuilder whereClause = new StringBuilder();
    whereClause.append(MWMInOutBoundLine.COLUMNNAME_C_InvoiceLine_ID).append("=?");
    return new Query(invoiceLine.getCtx(), MWMInOutBoundLine.Table_Name, whereClause.toString(), invoiceLine.get_TrxName()).setClient_ID().setParameters(invoiceLine.getC_InvoiceLine_ID()).first();
}
Also used : Query(org.compiere.model.Query)

Example 50 with Query

use of org.compiere.model.Query in project adempiere by adempiere.

the class MWMSectionDetail method getLocatorBySection.

/**
	 * get the Locator for this Section
	 * @param section
	 * @return Collection of the MLocator
	 */
public static List<MLocator> getLocatorBySection(MWMSection section) {
    ArrayList locators = new ArrayList();
    String whereClause = "EXISTS (SELECT 1 FROM WM_Section_Detail sd WHERE sd.WM_Section_ID = ? AND sd.M_Locator_ID=M_Locator.M_Locator_ID) ";
    return new Query(section.getCtx(), MLocator.Table_Name, whereClause, section.get_TrxName()).setOnlyActiveRecords(true).setParameters(new Object[] { section.getWM_Section_ID() }).list();
}
Also used : Query(org.compiere.model.Query) ArrayList(java.util.ArrayList)

Aggregations

Query (org.compiere.model.Query)210 ArrayList (java.util.ArrayList)49 BigDecimal (java.math.BigDecimal)25 Properties (java.util.Properties)22 MProduct (org.compiere.model.MProduct)20 AdempiereException (org.adempiere.exceptions.AdempiereException)12 MTable (org.compiere.model.MTable)12 MOrderLine (org.compiere.model.MOrderLine)8 MWarehouse (org.compiere.model.MWarehouse)8 PO (org.compiere.model.PO)8 MBPartner (org.compiere.model.MBPartner)6 MQuery (org.compiere.model.MQuery)6 MPPProductBOM (org.eevolution.model.MPPProductBOM)6 MColumn (org.compiere.model.MColumn)5 MLocation (org.compiere.model.MLocation)5 MPPProductBOMLine (org.eevolution.model.MPPProductBOMLine)5 SQLException (java.sql.SQLException)4 Timestamp (java.sql.Timestamp)4 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 MClient (org.compiere.model.MClient)4