541 painter.fillRect( 20, y, 715, 20, mo_line); |
541 painter.fillRect( 20, y, 715, 20, mo_line); |
542 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).name); |
542 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).name); |
543 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[recipe->miscs.at(i).type])); |
543 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[recipe->miscs.at(i).type])); |
544 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
544 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
545 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
545 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
546 QString("%1 %2").arg(recipe->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(recipe->miscs.at(i).amount_is_weight ? "gr":"ml")); |
546 QString("%1 %2").arg(recipe->miscs.at(i).amount * 1000.0, 1, 'f', 2).arg(recipe->miscs.at(i).amount_is_weight ? "gr":"ml")); |
547 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
547 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
548 y += 20; |
548 y += 20; |
549 } |
549 } |
550 painter.fillRect(670, y, 60, 20, c_line1); |
550 painter.fillRect(670, y, 60, 20, c_line1); |
551 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
551 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
969 painter.fillRect( 20, y, 715, 20, mo_line); |
969 painter.fillRect( 20, y, 715, 20, mo_line); |
970 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).name); |
970 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).name); |
971 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[product->miscs.at(i).type])); |
971 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[product->miscs.at(i).type])); |
972 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
972 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
973 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
973 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
974 QString("%1 %2").arg(product->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(product->miscs.at(i).amount_is_weight ? "gr":"ml")); |
974 QString("%1 %2").arg(product->miscs.at(i).amount * 1000.0, 1, 'f', 2).arg(product->miscs.at(i).amount_is_weight ? "gr":"ml")); |
975 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
975 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
976 y += 20; |
976 y += 20; |
977 } |
977 } |
978 painter.fillRect(670, y, 60, 20, c_line1); |
978 painter.fillRect(670, y, 60, 20, c_line1); |
979 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
979 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
2081 /* During packaging */ |
2081 /* During packaging */ |
2082 lines = 0; |
2082 lines = 0; |
2083 for (int i = 0; i < product->fermentables.size(); i++) |
2083 for (int i = 0; i < product->fermentables.size(); i++) |
2084 if (product->fermentables.at(i).added >= FERMENTABLE_ADDED_BOTTLE) |
2084 if (product->fermentables.at(i).added >= FERMENTABLE_ADDED_BOTTLE) |
2085 lines++; |
2085 lines++; |
|
2086 for (int i = 0; i < product->hops.size(); i++) |
|
2087 if (product->hops.at(i).useat == HOP_USEAT_BOTTLING) |
|
2088 lines++; |
2086 for (int i = 0; i < product->miscs.size(); i++) |
2089 for (int i = 0; i < product->miscs.size(); i++) |
2087 if (product->miscs.at(i).use_use == MISC_USES_BOTTLING) |
2090 if (product->miscs.at(i).use_use == MISC_USES_BOTTLING) |
2088 lines++; |
2091 lines++; |
2089 for (int i = 0; i < product->yeasts.size(); i++) |
2092 for (int i = 0; i < product->yeasts.size(); i++) |
2090 if (product->yeasts.at(i).use == YEAST_USE_BOTTLE) |
2093 if (product->yeasts.at(i).use == YEAST_USE_BOTTLE) |
2129 QString unit = (product->miscs.at(i).amount_is_weight) ? "gr":"ml"; |
2132 QString unit = (product->miscs.at(i).amount_is_weight) ? "gr":"ml"; |
2130 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3` during bottling")).arg(product->miscs.at(i).amount * 1000 * factor, 1, 'f', 2) |
2133 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3` during bottling")).arg(product->miscs.at(i).amount * 1000 * factor, 1, 'f', 2) |
2131 .arg(unit).arg(product->miscs.at(i).name)); |
2134 .arg(unit).arg(product->miscs.at(i).name)); |
2132 } |
2135 } |
2133 } |
2136 } |
|
2137 for (int i = 0; i < product->hops.size(); i++) { |
|
2138 if (product->hops.at(i).useat == HOP_USEAT_BOTTLING) { |
|
2139 checkLine(&painter, &y, QString(tr("Add %1 gr `%2`")).arg(product->hops.at(i).amount * 1000 * factor, 1, 'f', 2) |
|
2140 .arg(product->hops.at(i).name)); |
|
2141 } |
|
2142 } |
2134 } |
2143 } |
2135 } |
2144 } |
2136 |
2145 |
2137 painter.end(); |
2146 painter.end(); |
2138 } |
2147 } |