BigDecimal costs = productsCostCalculationService.calculateProductCostForGivenQuantity(productEntity,
productQuantity, mode);
<<<<<<< HEAD
materialsTable.addCell(new Phrase(numberService.format(costs), FontUtils.getDejavuRegular9Dark()));
=======
for (Entry product : products.entrySet()) {
materialsTable.addCell(new Phrase(product.getKey().getStringField(NUMBER), FontUtils.getDejavuRegular9Dark()));
materialsTable.addCell(new Phrase(numberService.format(product.getValue()), FontUtils.getDejavuRegular9Dark()));
materialsTable.addCell(new Phrase(product.getKey().getStringField(L_UNIT), FontUtils.getDejavuRegular9Dark()));
BigDecimal nominalCost = (BigDecimal) product.getKey().getField(L_NOMINAL_COST);
BigDecimal costForNumber = (BigDecimal) product.getKey().getField(L_COST_FOR_NUMBER);
BigDecimal totalCostPerUnit = nominalCost.divide(costForNumber, numberService.getMathContext());
BigDecimal costs = product.getValue().multiply(totalCostPerUnit, numberService.getMathContext());
materialsTable.addCell(new Phrase(numberService.format(costs) + " " + currencyService.getCurrencyAlphabeticCode(),
FontUtils.getDejavuRegular9Dark()));
>>>>>>> fa7956b21598e5c0177da0e0eaf539f7f361b99c
BigDecimal margin = (BigDecimal) costCalculation.getField(MATERIAL_COST_MARGIN);
if (margin == null) {
materialsTable.addCell(new Phrase("", FontUtils.getDejavuRegular9Dark())); |