From a3b832b08792ffe53e5d09b87ec357b288101084 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 7 Aug 2018 08:53:31 +0200 Subject: [PATCH] print articles of special seller --- src/gui/reportdialog.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gui/reportdialog.cpp b/src/gui/reportdialog.cpp index 7b5aa02..4dc5203 100644 --- a/src/gui/reportdialog.cpp +++ b/src/gui/reportdialog.cpp @@ -102,13 +102,29 @@ void ReportDialog::onPrintReportButtonClicked() painter.drawText(QRect(0, 50, width, height), Qt::AlignLeft, content); } - // now print the overall statistics + // pieces booked on the special account "Sonderkonto" + const auto specialSeller = market_->findSellerWithUuid("11111111-1111-1111-1111-111111111111"); + if (specialSeller && specialSeller->numArticlesSold() > 0) { + printer.newPage(); + painter.setFont(QFont("Arial", 16, QFont::Bold)); + painter.drawText(QRect(0, 0, width, height), Qt::AlignTop | Qt::AlignHCenter, + "Auswertung Kindersachenmarkt"); + painter.setFont(QFont("monospace", 12)); + QString content("Einzelteile ohne Nummer\n=======================\n\n"); + for (const auto& article : specialSeller->getArticles(true)) { + content += QString("- %1:\t").arg(article->getDescription().c_str(), -45); + content += QString("%1\n").arg(article->getPriceAsString().c_str(), 11); + } + painter.drawText(QRect(0, 50, width, height), Qt::AlignLeft, content); + } + + // overall statistics printer.newPage(); painter.setFont(QFont("Arial", 16, QFont::Bold)); painter.drawText(QRect(0, 0, width, height), Qt::AlignTop | Qt::AlignHCenter, "Auswertung Kindersachenmarkt"); painter.setFont(QFont("monospace", 12)); - QString content("Gesamtstatistik\n---------------\n\n"); + QString content("Gesamtstatistik\n===============\n\n"); content += QString("Registrierte Verkäufer: %1\n").arg(sellers.size(), 6); content += QString("Verkaufte Artikel: %1\n\n").arg(6, 6); content += QString("Gesamtumsatz: %1\n").arg(market_->getOverallSumAsString().c_str(), 10);