final EntityTree entityTree  final List<Entity> operationComponents
mes-plugins/mes-plugins-products/src/main/java/com/qcadoo/mes/products/print/ReportDataService.java
addOperationsFromSubtechnologiesToList(
    public final Map<Entity, BigDecimal> prepareTechnologySeries(final Entity entity) {
    public final void countQuantityForProductsIn(final Map<Entity, BigDecimal> products, final Entity technology,
    public final void addSeries(final Document document, final Entity entity, final Locale locale, final String type)
            throws DocumentException {
        DecimalFormat decimalFormat = (DecimalFormat) DecimalFormat.getInstance(locale);
        decimalFormat.setMaximumFractionDigits(3);
        decimalFormat.setMinimumFractionDigits(3);
        boolean firstPage = true;
        for (Entry<Entity, Map<Pair<Entity, Entity>, Pair<Map<Entity, BigDecimal>, Map<Entity, BigDecimal>>>> entry : prepareOperationSeries(
                entity, type).entrySet()) {
            if (!firstPage) {
                document.newPage();
void addOperationsFromSubtechnologiesToList(final EntityTree entityTree, final List<Entity> operationComponents)

            final Map<Entity  Map<Pair<Entity  Entity>  Pair<Map<Entity  BigDecimal>  Map<Entity  BigDecimal>>>> operations 
            final Map<Entity  Map<Pair<Entity  Entity>  Pair<Map<Entity  BigDecimal>  Map<Entity  BigDecimal>>>> orderOperations
mes-plugins/mes-plugins-products/src/main/java/com/qcadoo/mes/products/print/ReportDataService.java
if (operations.size() == 0) {
            operations.putAll(orderOperations);
void concatenateOperationsList(
            final Map<Entity, Map<Pair<Entity, Entity>, Pair<Map<Entity, BigDecimal>, Map<Entity, BigDecimal>>>> operations,
            final Map<Entity, Map<Pair<Entity, Entity>, Pair<Map<Entity, BigDecimal>, Map<Entity, BigDecimal>>>> orderOperations)
final BigDecimal totalQuantity 
            final Entry<Entity  Map<Pair<Entity  Entity>  Pair<Map<Entity  BigDecimal>  Map<Entity  BigDecimal>>>> entry 
            final Locale locale  final String type
mes-plugins/mes-plugins-products/src/main/java/com/qcadoo/mes/products/print/ReportDataService.java
Paragraph title = new Paragraph();
        if (type.equals("machine")) {
            Entity machine = entry.getKey();
            title.add(new Phrase(translationService.translate("products.workPlan.report.paragrah3", locale), PdfUtil
                    .getArialBold11Light()));
            String name = "";
            if (machine != null) {
                name = machine.getField("name").toString();
            title.add(new Phrase(" " + name, PdfUtil.getArialBold19Dark()));
Paragraph prepareTitle(final BigDecimal totalQuantity,
            final Entry<Entity, Map<Pair<Entity, Entity>, Pair<Map<Entity, BigDecimal>, Map<Entity, BigDecimal>>>> entry,
            final Locale locale, final String type)
final List<Entity> orders 
            final Entry<Entity  Map<Pair<Entity  Entity>  Pair<Map<Entity  BigDecimal>  Map<Entity  BigDecimal>>>> entry
mes-plugins/mes-plugins-products/src/main/java/com/qcadoo/mes/products/print/ReportDataService.java
BigDecimal totalQuantity = new BigDecimal("0");
        for (Pair<Entity, Entity> pair : entry.getValue().keySet()) {
            if (!orders.contains(pair.getValue())) {
                totalQuantity = totalQuantity.add((BigDecimal) pair.getValue().getField("plannedQuantity"));
                orders.add(pair.getValue());
        return totalQuantity;
    private List<String> prepareOrderHeader(final Document document, final Entity entity, final Locale locale)
            throws DocumentException {
        String documenTitle = translationService.translate("products.workPlan.report.title", locale);
        String documentAuthor = translationService.translate("products.materialRequirement.report.author", locale);
        UsersUser user = securityService.getCurrentUser();
        PdfUtil.addDocumentHeader(document, entity.getField("name").toString(), documenTitle, documentAuthor,
                (Date) entity.getField("date"), user);
        document.add(generateBarcode(entity.getField("name").toString()));
        document.add(new Paragraph(translationService.translate("products.workPlan.report.paragrah", locale), PdfUtil
                .getArialBold11Dark()));
        List<String> orderHeader = new ArrayList<String>();
        orderHeader.add(translationService.translate("products.order.number.label", locale));
        orderHeader.add(translationService.translate("products.order.name.label", locale));
        orderHeader.add(translationService.translate("products.order.product.label", locale));
        orderHeader.add(translationService.translate("products.order.plannedQuantity.label", locale));
        orderHeader.add(translationService.translate("products.product.unit.label", locale));
        orderHeader.add(translationService.translate("products.order.dateTo.label", locale));
        return orderHeader;
BigDecimal createUniqueOrdersList(final List<Entity> orders,
            final Entry<Entity, Map<Pair<Entity, Entity>, Pair<Map<Entity, BigDecimal>, Map<Entity, BigDecimal>>>> entry)
final EntityTree entityTree  final List<Entity> operationComponents
mes-plugins/mes-plugins-products/src/main/java/com/qcadoo/mes/products/print/ReportDataService.java
addOperationsFromSubtechnologies(
    public final Map<Entity, BigDecimal> getTechnologySeries(final Entity entity) {
    public void countQuantityForProductsIn(final Map<Entity, BigDecimal> products, final Entity technology,

                            quantity = ((BigDecimal) operationProductComponent.getField("quantity")).multiply(plannedQuantity)
                                    .add(quantity);
                            products.put(product,
                                    ((BigDecimal) operationProductComponent.getField("quantity")).multiply(plannedQuantity));
            Entity productOutComponent = checkOutProducts(node);
            if (productOutComponent == null) {
                return false;
void addOperationsFromSubtechnologies(final EntityTree entityTree, final List<Entity> operationComponents)