Search in sources :

Example 6 with Quantity

use of de.metas.quantity.Quantity in project metasfresh-webui-api by metasfresh.

the class PPOrderLinesLoader method createForHUViewRecordRecursively.

private PPOrderLineRow createForHUViewRecordRecursively(@NonNull final I_PP_Order_Qty ppOrderQty, @NonNull final HUEditorRow huEditorRow, @Nullable final HUEditorRow parentHUEditorRow, final boolean readonly) {
    final Quantity quantity = computeQuantityForHuPPOrderLineRow(ppOrderQty, huEditorRow, parentHUEditorRow);
    final ImmutableList<PPOrderLineRow> includedRows = huEditorRow.getIncludedRows().stream().map(includedHUEditorRow -> createForHUViewRecordRecursively(ppOrderQty, includedHUEditorRow, huEditorRow, readonly)).collect(ImmutableList.toImmutableList());
    return PPOrderLineRow.builderForIssuedOrReceivedHU().rowId(huEditorRow.getId()).type(PPOrderLineType.ofHUEditorRowType(huEditorRow.getType())).ppOrderQty(ppOrderQty).processed(readonly || ppOrderQty.isProcessed()).attributesSupplier(huEditorRow.getAttributesSupplier()).code(huEditorRow.getValue()).product(huEditorRow.getProduct()).packingInfo(huEditorRow.getPackingInfo()).topLevelHU(huEditorRow.isTopLevel()).huStatus(huEditorRow.getHUStatus()).quantity(quantity).includedRows(includedRows).build();
}
Also used : I_M_HU_LUTU_Configuration(de.metas.handlingunits.model.I_M_HU_LUTU_Configuration) X_PP_Order_BOMLine(org.eevolution.model.X_PP_Order_BOMLine) GuavaCollectors(org.adempiere.util.GuavaCollectors) ListMultimap(com.google.common.collect.ListMultimap) IHUPPOrderBL(de.metas.handlingunits.pporder.api.IHUPPOrderBL) InterfaceWrapperHelper.loadOutOfTrx(org.adempiere.model.InterfaceWrapperHelper.loadOutOfTrx) I_PP_Order_Qty(de.metas.handlingunits.model.I_PP_Order_Qty) Function(java.util.function.Function) IPPOrderBOMDAO(de.metas.material.planning.pporder.IPPOrderBOMDAO) BigDecimal(java.math.BigDecimal) SqlHUEditorViewRepository(de.metas.ui.web.handlingunits.SqlHUEditorViewRepository) InterfaceWrapperHelper(org.adempiere.model.InterfaceWrapperHelper) ImmutableList(com.google.common.collect.ImmutableList) Quantity(de.metas.quantity.Quantity) I_PP_Order(de.metas.handlingunits.model.I_PP_Order) HUPackingInfos(de.metas.ui.web.handlingunits.util.HUPackingInfos) Nullable(javax.annotation.Nullable) HUEditorRow(de.metas.ui.web.handlingunits.HUEditorRow) IHUPPOrderQtyDAO(de.metas.handlingunits.pporder.api.IHUPPOrderQtyDAO) MatchingSourceHusQuery(de.metas.handlingunits.sourcehu.SourceHUsService.MatchingSourceHusQuery) Util(org.compiere.util.Util) IPPOrderBOMBL(de.metas.material.planning.pporder.IPPOrderBOMBL) ImmutableSet(com.google.common.collect.ImmutableSet) HUPackingInfoFormatter(de.metas.ui.web.handlingunits.util.HUPackingInfoFormatter) ITranslatableString(de.metas.i18n.ITranslatableString) NonNull(lombok.NonNull) HUEditorViewRepository(de.metas.ui.web.handlingunits.HUEditorViewRepository) SourceHUsService(de.metas.handlingunits.sourcehu.SourceHUsService) IModelTranslationMap(de.metas.i18n.IModelTranslationMap) SqlViewBinding(de.metas.ui.web.view.descriptor.SqlViewBinding) WindowId(de.metas.ui.web.window.datatypes.WindowId) IHUPackingInfo(de.metas.ui.web.handlingunits.util.IHUPackingInfo) I_PP_Order_BOMLine(de.metas.handlingunits.model.I_PP_Order_BOMLine) ASIViewRowAttributesProvider(de.metas.ui.web.view.ASIViewRowAttributesProvider) Services(org.adempiere.util.Services) List(java.util.List) Builder(lombok.Builder) I_C_DocType(org.compiere.model.I_C_DocType) X_PP_Order(org.eevolution.model.X_PP_Order) Comparator(java.util.Comparator) HUEditorRowAttributesProvider(de.metas.ui.web.handlingunits.HUEditorRowAttributesProvider) ImmutableTranslatableString(de.metas.i18n.ImmutableTranslatableString) Quantity(de.metas.quantity.Quantity)

Aggregations

Quantity (de.metas.quantity.Quantity)6 I_M_HU_LUTU_Configuration (de.metas.handlingunits.model.I_M_HU_LUTU_Configuration)2 I_PP_Order_Qty (de.metas.handlingunits.model.I_PP_Order_Qty)2 ITranslatableString (de.metas.i18n.ITranslatableString)2 BigDecimal (java.math.BigDecimal)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 ListMultimap (com.google.common.collect.ListMultimap)1 TerminalException (de.metas.adempiere.form.terminal.TerminalException)1 IHUContextFactory (de.metas.handlingunits.IHUContextFactory)1 IMutableHUContext (de.metas.handlingunits.IMutableHUContext)1 IAllocationRequest (de.metas.handlingunits.allocation.IAllocationRequest)1 ILUTUConfigurationFactory (de.metas.handlingunits.allocation.ILUTUConfigurationFactory)1 ILUTUProducerAllocationDestination (de.metas.handlingunits.allocation.ILUTUProducerAllocationDestination)1 I_M_HU (de.metas.handlingunits.model.I_M_HU)1 I_M_ReceiptSchedule (de.metas.handlingunits.model.I_M_ReceiptSchedule)1 I_PP_Order (de.metas.handlingunits.model.I_PP_Order)1 I_PP_Order_BOMLine (de.metas.handlingunits.model.I_PP_Order_BOMLine)1 IHUPPOrderBL (de.metas.handlingunits.pporder.api.IHUPPOrderBL)1 IHUPPOrderQtyDAO (de.metas.handlingunits.pporder.api.IHUPPOrderQtyDAO)1