use of de.metas.purchasecandidate.VendorProductInfo in project metasfresh-webui-api by metasfresh.
the class PurchaseRowsLoaderTest method createPurchaseCandidate.
private static PurchaseCandidate createPurchaseCandidate(final I_C_OrderLine orderLine, final I_C_BPartner_Product bPartnerProduct) {
final VendorProductInfo vendorProductInfo = VendorProductInfo.fromDataRecord(bPartnerProduct);
final PurchaseCandidate purchaseCandidate = PurchaseCandidate.builder().orgId(20).dateRequired(orderLine.getDatePromised()).productId(orderLine.getM_Product_ID()).qtyToPurchase(orderLine.getQtyOrdered()).salesOrderId(orderLine.getC_Order_ID()).salesOrderLineId(orderLine.getC_OrderLine_ID()).uomId(orderLine.getM_Product().getC_UOM_ID()).vendorBPartnerId(vendorProductInfo.getVendorBPartnerId()).vendorProductInfo(vendorProductInfo).warehouseId(30).build();
return purchaseCandidate;
}
use of de.metas.purchasecandidate.VendorProductInfo in project metasfresh-webui-api by metasfresh.
the class PurchaseRowFactoryTest method createPurchaseCandidate.
public static PurchaseCandidate createPurchaseCandidate(final int purchaseCandidateId) {
final I_C_BPartner bPartner = newInstance(I_C_BPartner.class);
save(bPartner);
final I_C_UOM uom = newInstance(I_C_UOM.class);
uom.setUOMSymbol("uomSympol");
save(uom);
final I_M_Product product = newInstance(I_M_Product.class);
product.setC_UOM(uom);
save(product);
final VendorProductInfo vendorProductInfo = VendorProductInfo.builder().bPartnerProductId(10).vendorBPartnerId(bPartner.getC_BPartner_ID()).productId(product.getM_Product_ID()).productNo("productNo").productName("productName").build();
return PurchaseCandidate.builder().purchaseCandidateId(purchaseCandidateId).salesOrderId(1).salesOrderLineId(2).orgId(3).warehouseId(4).productId(product.getM_Product_ID()).uomId(uom.getC_UOM_ID()).vendorBPartnerId(bPartner.getC_BPartner_ID()).vendorProductInfo(vendorProductInfo).qtyToPurchase(BigDecimal.ONE).dateRequired(SystemTime.asDayTimestamp()).processed(// imporant if we expect purchaseRowId.getProcessedPurchaseCandidateId() to be > 0
true).locked(false).build();
}
Aggregations