Search in sources :

Example 1 with I_M_Product_Category

use of org.compiere.model.I_M_Product_Category in project metasfresh-webui-api by metasfresh.

the class PurchaseRowsLoaderTest method init.

@BeforeEach
public void init() {
    AdempiereTestHelper.get().init();
    availabilityCheckService = Mockito.mock(AvailabilityCheckService.class);
    org = newInstance(I_AD_Org.class);
    saveRecord(org);
    final I_C_UOM uom = newInstance(I_C_UOM.class);
    uom.setUOMSymbol("testUOMSympol");
    saveRecord(uom);
    this.TEN = Quantity.of(BigDecimal.TEN, uom);
    warehouse = newInstance(I_M_Warehouse.class);
    saveRecord(warehouse);
    final I_M_Product_Category productCategory = newInstance(I_M_Product_Category.class);
    saveRecord(productCategory);
    product = newInstance(I_M_Product.class);
    product.setM_Product_Category_ID(productCategory.getM_Product_Category_ID());
    product.setC_UOM_ID(uom.getC_UOM_ID());
    saveRecord(product);
    final I_C_BPartner bPartnerCustomer = newInstance(I_C_BPartner.class);
    bPartnerCustomer.setName("bPartnerCustomer.Name");
    saveRecord(bPartnerCustomer);
    salesOrderRecord = newInstance(I_C_Order.class);
    salesOrderRecord.setC_BPartner_ID(bPartnerCustomer.getC_BPartner_ID());
    salesOrderRecord.setPreparationDate(SystemTime.asTimestamp());
    salesOrderRecord.setC_PaymentTerm_ID(30);
    saveRecord(salesOrderRecord);
    bPartnerVendor = newInstance(I_C_BPartner.class);
    bPartnerVendor.setName("bPartnerVendor.Name");
    saveRecord(bPartnerVendor);
    currencyId = PlainCurrencyDAO.createCurrencyId(CurrencyCode.EUR);
    // wire together a SalesOrder2PurchaseViewFactory
    final PurchaseCandidateRepository purchaseCandidateRepository = new PurchaseCandidateRepository(new PurchaseItemRepository(), new ReferenceGenerator(), new BPPurchaseScheduleService(new BPPurchaseScheduleRepository()));
    final DoNothingPurchaseProfitInfoServiceImpl purchaseProfitInfoService = new DoNothingPurchaseProfitInfoServiceImpl();
    final PurchaseDemandWithCandidatesService purchaseDemandWithCandidatesService = new PurchaseDemandWithCandidatesService(purchaseCandidateRepository, new BPPurchaseScheduleService(new BPPurchaseScheduleRepository()), new VendorProductInfoService(new BPartnerBL(new UserRepository())), purchaseProfitInfoService);
    final PurchaseRowFactory purchaseRowFactory = new PurchaseRowFactory(new AvailableToPromiseRepository(), purchaseProfitInfoService);
    salesOrder2PurchaseViewFactory = new SalesOrder2PurchaseViewFactory(purchaseDemandWithCandidatesService, // mocked
    availabilityCheckService, purchaseCandidateRepository, purchaseRowFactory, new SalesOrderLineRepository(new OrderLineRepository()));
}
Also used : BPPurchaseScheduleService(de.metas.purchasecandidate.BPPurchaseScheduleService) AvailabilityCheckService(de.metas.purchasecandidate.availability.AvailabilityCheckService) I_C_Order(org.compiere.model.I_C_Order) AvailableToPromiseRepository(de.metas.material.dispo.commons.repository.atp.AvailableToPromiseRepository) I_M_Product(org.compiere.model.I_M_Product) I_AD_Org(org.compiere.model.I_AD_Org) SalesOrderLineRepository(de.metas.purchasecandidate.SalesOrderLineRepository) OrderLineRepository(de.metas.order.OrderLineRepository) SalesOrderLineRepository(de.metas.purchasecandidate.SalesOrderLineRepository) BPartnerBL(de.metas.bpartner.service.impl.BPartnerBL) I_M_Warehouse(org.compiere.model.I_M_Warehouse) PurchaseDemandWithCandidatesService(de.metas.purchasecandidate.PurchaseDemandWithCandidatesService) I_M_Product_Category(org.compiere.model.I_M_Product_Category) PurchaseItemRepository(de.metas.purchasecandidate.purchaseordercreation.remotepurchaseitem.PurchaseItemRepository) UserRepository(de.metas.user.UserRepository) BPPurchaseScheduleRepository(de.metas.purchasecandidate.BPPurchaseScheduleRepository) ReferenceGenerator(de.metas.purchasecandidate.ReferenceGenerator) PurchaseCandidateRepository(de.metas.purchasecandidate.PurchaseCandidateRepository) VendorProductInfoService(de.metas.purchasecandidate.VendorProductInfoService) I_C_UOM(org.compiere.model.I_C_UOM) I_C_BPartner(org.compiere.model.I_C_BPartner) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with I_M_Product_Category

use of org.compiere.model.I_M_Product_Category in project metasfresh-webui-api by metasfresh.

the class PurchaseRowFactoryTest method createVendorProductInfo.

private VendorProductInfo createVendorProductInfo() {
    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_Category productCategory = newInstance(I_M_Product_Category.class);
    save(productCategory);
    final I_M_Product product = newInstance(I_M_Product.class);
    product.setC_UOM_ID(uom.getC_UOM_ID());
    product.setM_Product_Category_ID(productCategory.getM_Product_Category_ID());
    save(product);
    return VendorProductInfo.builder().vendorId(BPartnerId.ofRepoId(bpartner.getC_BPartner_ID())).defaultVendor(false).product(ProductAndCategoryAndManufacturerId.of(product.getM_Product_ID(), product.getM_Product_Category_ID(), product.getManufacturer_ID())).attributeSetInstanceId(AttributeSetInstanceId.NONE).vendorProductNo("productNo").vendorProductName("productName").pricingConditions(PricingConditions.builder().build()).build();
}
Also used : I_M_Product(org.compiere.model.I_M_Product) I_C_UOM(org.compiere.model.I_C_UOM) I_C_BPartner(org.compiere.model.I_C_BPartner) I_M_Product_Category(org.compiere.model.I_M_Product_Category)

Example 3 with I_M_Product_Category

use of org.compiere.model.I_M_Product_Category in project metasfresh-webui-api by metasfresh.

the class MaterialCockpitRowFactoryTest method init.

@BeforeEach
public void init() {
    AdempiereTestHelper.get().init();
    attributesTestHelper = new AttributesTestHelper();
    final I_M_Product_Category productCategory = newInstance(I_M_Product_Category.class);
    productCategory.setName("productCategoryName");
    save(productCategory);
    final I_C_UOM uom = newInstance(I_C_UOM.class);
    saveRecord(uom);
    product = newInstance(I_M_Product.class);
    product.setValue("productValue");
    product.setName("productName");
    product.setIsStocked(true);
    product.setC_UOM_ID(uom.getC_UOM_ID());
    product.setM_Product_Category_ID(productCategory.getM_Product_Category_ID());
    save(product);
    attr1 = attributesTestHelper.createM_Attribute("test1", X_M_Attribute.ATTRIBUTEVALUETYPE_List, true);
    attr1_value1 = attributesTestHelper.createM_AttributeValue(attr1, "test1_value1");
    attr2 = attributesTestHelper.createM_Attribute("test21", X_M_Attribute.ATTRIBUTEVALUETYPE_List, true);
    attr2_value1 = attributesTestHelper.createM_AttributeValue(attr2, "test2_value1");
    attr2_value2 = attributesTestHelper.createM_AttributeValue(attr2, "test2_value2");
    initDimenstionSpec();
    materialCockpitRowFactory = new MaterialCockpitRowFactory();
}
Also used : I_M_Product(org.compiere.model.I_M_Product) AttributesTestHelper(org.adempiere.mm.attributes.api.impl.AttributesTestHelper) I_C_UOM(org.compiere.model.I_C_UOM) I_M_Product_Category(org.compiere.model.I_M_Product_Category) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

I_C_UOM (org.compiere.model.I_C_UOM)3 I_M_Product (org.compiere.model.I_M_Product)3 I_M_Product_Category (org.compiere.model.I_M_Product_Category)3 I_C_BPartner (org.compiere.model.I_C_BPartner)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 BPartnerBL (de.metas.bpartner.service.impl.BPartnerBL)1 AvailableToPromiseRepository (de.metas.material.dispo.commons.repository.atp.AvailableToPromiseRepository)1 OrderLineRepository (de.metas.order.OrderLineRepository)1 BPPurchaseScheduleRepository (de.metas.purchasecandidate.BPPurchaseScheduleRepository)1 BPPurchaseScheduleService (de.metas.purchasecandidate.BPPurchaseScheduleService)1 PurchaseCandidateRepository (de.metas.purchasecandidate.PurchaseCandidateRepository)1 PurchaseDemandWithCandidatesService (de.metas.purchasecandidate.PurchaseDemandWithCandidatesService)1 ReferenceGenerator (de.metas.purchasecandidate.ReferenceGenerator)1 SalesOrderLineRepository (de.metas.purchasecandidate.SalesOrderLineRepository)1 VendorProductInfoService (de.metas.purchasecandidate.VendorProductInfoService)1 AvailabilityCheckService (de.metas.purchasecandidate.availability.AvailabilityCheckService)1 PurchaseItemRepository (de.metas.purchasecandidate.purchaseordercreation.remotepurchaseitem.PurchaseItemRepository)1 UserRepository (de.metas.user.UserRepository)1 AttributesTestHelper (org.adempiere.mm.attributes.api.impl.AttributesTestHelper)1 I_AD_Org (org.compiere.model.I_AD_Org)1