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;
}
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();
}
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();
}
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();
}
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();
}
Aggregations