src/PrinterDialog.cpp

Mon, 14 Mar 2022 16:05:11 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 14 Mar 2022 16:05:11 +0100
changeset 54
bba7be9034be
parent 53
d36879f13d32
child 55
2d8dbbc1ffab
permissions
-rw-r--r--

Added print private yeastbank

52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Printer.cpp is part of bmsapp.
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * (at your option) any later version.
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 *
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * GNU General Public License for more details.
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 *
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 */
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "PrinterDialog.h"
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 #include "config.h"
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 #include "bmsapp.h"
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 #include <QPrintPreviewDialog>
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 PrinterDialog::PrinterDialog(int job, int rec, QWidget* parent) : QDialog(parent)
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 {
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 qDebug() << "PrinterDialog start job" << job << "rec" << rec;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 p_job = job;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 p_rec = rec;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 QPrinter printer(QPrinter::ScreenResolution);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 QPrintPreviewDialog preview(&printer, this);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 connect(&preview, &QPrintPreviewDialog::paintRequested,
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 this, &PrinterDialog::printDocument);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 preview.exec();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 qDebug() << "return";
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 PrinterDialog::~PrinterDialog()
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 {
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 qDebug() << "PrinterDialog done";
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 void PrinterDialog::printDocument(QPrinter *printer)
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 {
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 qDebug() << "PrinterDialog printDocument()";
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 QRect rectangle;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 QRect boundingRect;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 QPainter painter;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 QString w;
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
55 QSqlQuery query;
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
57 const QColor c_header(255, 150, 100, 255);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
58 const QColor c_line1(210, 245, 255, 255);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
59 const QColor c_line2(255, 255, 210, 255);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 const QStringList f_types({tr("Grain"), tr("Sugar"), tr("Extract"), tr("Dry extract"), tr("Adjunct")});
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 const QStringList h_form({tr("Pellet"), tr("Plug"), tr("Leaf"), tr("Leaf Wet"), tr("Cryo")});
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 const QStringList m_types({tr("Spice"), tr("Herb"), tr("Flavor"), tr("Fining"), tr("Water agent"), tr("Yeast nutrient"), tr("Other")});
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
63 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")});
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
64 const QStringList y_types({tr("Lager"), tr("Ale"), tr("Wheat"), tr("Wine"), tr("Champagne"), tr("Brett"), tr("Kveik"), tr("Hybrid")});
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
65 const QStringList y_form({tr("Liquid"), tr("Dry"), tr("Slant"), tr("Culture"), tr("Frozen"), tr("Bottle"), tr("Dried")});
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 painter.begin(printer);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 bool firstPage = true;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 qreal y = 0;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 if (p_job == PR_SUPPLIES) {
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
72 /*
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
73 * Print supplies in stock
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
74 */
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 double tot_fermentables = 0, tot_hops = 0, tot_yeasts = 0, tot_miscs = 0;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
77 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
78 y = 120;
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 /* Fermentables supplies header */
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 painter.setFont(QFont("Helvetica", 9, QFont::Bold));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 painter.setPen(Qt::black);
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
82 painter.fillRect( 0, y, 735, 20, c_header);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 painter.drawText( 0, y+4, 90, 20, Qt::AlignLeft, tr("Type"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 painter.drawText( 90, y+4, 100, 20, Qt::AlignLeft, tr("Supplier"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 painter.drawText(190, y+4, 270, 20, Qt::AlignLeft, tr("Fermentable"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, tr("Stock"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, tr("Price/Kg"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, tr("Value"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 painter.setFont(QFont("Helvetica", 9, QFont::Normal));
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
91 query.exec("SELECT type,name,supplier,inventory,cost FROM inventory_fermentables WHERE inventory > 0 ORDER BY type,supplier,name");
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 query.first();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 for (int i = 0 ; i < query.size() ; i++ ) {
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
94 if ((y + 20) > painter.device()->height()) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
95 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
96 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
97 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
98 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
99 painter.fillRect( 0, y, 735, 20, (i % 2) ? c_line1:c_line2);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 painter.drawText( 0, y+4, 90, 20, Qt::AlignLeft, f_types[query.value(0).toInt()]);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 painter.drawText( 90, y+4, 100, 20, Qt::AlignLeft, query.value(2).toString());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 painter.drawText(190, y+4, 270, 20, Qt::AlignLeft, query.value(1).toString());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 w = QString("%1 €").arg(query.value(4).toDouble(), 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 w = QString("%1 €").arg(query.value(3).toDouble() * query.value(4).toDouble(), 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 tot_fermentables += (query.value(3).toDouble() * query.value(4).toDouble());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 query.next();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 }
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
113 painter.fillRect( 0, y, 735, 20, c_header);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 painter.drawText( 0, y+4, 100, 20, Qt::AlignLeft, tr("Total"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 w = QString("%1 €").arg(tot_fermentables, 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
119 /* Hops supplies */
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 query.exec("SELECT name,form,origin,inventory,cost FROM inventory_hops WHERE inventory > 0 ORDER BY origin,name");
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 query.first();
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
122 if ((y + 80 + (query.size() * 20)) > painter.device()->height()) { /* Rows + header + footer + blank */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
123 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
124 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
125 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
126 } else {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
127 y += 40;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
128 }
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 painter.setFont(QFont("Helvetica", 9, QFont::Bold));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 painter.setPen(Qt::black);
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
131 painter.fillRect( 0, y, 735, 20, c_header);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, tr("Country"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 painter.drawText(120, y+4, 260, 20, Qt::AlignLeft, tr("Hop name"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 painter.drawText(380, y+4, 80, 20, Qt::AlignLeft, tr("Form"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, tr("Stock"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, tr("Price/Kg"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, tr("Value"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 painter.setFont(QFont("Helvetica", 9, QFont::Normal));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 for (int i = 0; i < query.size(); i++) {
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
141 if ((y + 20) > painter.device()->height()) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
142 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
143 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
144 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
145 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
146 painter.fillRect( 0, y, 735, 20, (i % 2) ? c_line1:c_line2);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, query.value(2).toString());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 painter.drawText(120, y+4, 260, 20, Qt::AlignLeft, query.value(0).toString());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 painter.drawText(380, y+4, 80, 20, Qt::AlignLeft, h_form[query.value(1).toInt()]);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 if (query.value(3).toDouble() < 0.6)
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 else
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 w = QString("%1 €").arg(query.value(4).toDouble(), 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 w = QString("%1 €").arg(query.value(3).toDouble() * query.value(4).toDouble(), 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 tot_hops += (query.value(3).toDouble() * query.value(4).toDouble());
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 query.next();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 }
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
163 painter.fillRect( 0, y, 735, 20, c_header);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 painter.drawText( 0, y+4, 100, 20, Qt::AlignLeft, tr("Total"));
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 w = QString("%1 €").arg(tot_hops, 8, 'f', 2);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 y += 20;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
169 /* Yeasts supplies */
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 query.exec("SELECT name,laboratory,product_id,form,inventory,cost FROM inventory_yeasts WHERE inventory > 0 ORDER BY laboratory,product_id");
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 query.first();
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
172 if ((y + 80 + (query.size() * 20)) > painter.device()->height()) { /* Rows + header + footer + blank */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
173 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
174 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
175 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
176 } else {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
177 y += 40;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
178 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
179 painter.setFont(QFont("Helvetica", 9, QFont::Bold));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
180 painter.setPen(Qt::black);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
181 painter.fillRect( 0, y, 735, 20, c_header);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
182 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, tr("Laboratory"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
183 painter.drawText(120, y+4, 120, 20, Qt::AlignLeft, tr("Product"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
184 painter.drawText(240, y+4, 220, 20, Qt::AlignLeft, tr("Yeast"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
185 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, tr("Stock"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
186 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, tr("Price/Kg"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
187 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, tr("Value"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
188 y += 20;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
189 painter.setFont(QFont("Helvetica", 9, QFont::Normal));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
190 for (int i = 0; i < query.size(); i++) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
191 if ((y + 20) > painter.device()->height()) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
192 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
193 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
194 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
195 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
196 painter.fillRect( 0, y, 735, 20, (i % 2) ? c_line1:c_line2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
197 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, query.value(1).toString());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
198 painter.drawText(120, y+4, 120, 20, Qt::AlignLeft, query.value(2).toString());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
199 painter.drawText(240, y+4, 220, 20, Qt::AlignLeft, query.value(0).toString());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
200 if (query.value(3).toInt() == 0)
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
201 w = QString("%1 %2").arg(query.value(4).toDouble(), 10, 'f', 1).arg(y_unit[query.value(3).toInt()]);
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
202 else
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
203 w = QString("%1 %2").arg(query.value(4).toDouble() * 1000.0, 10, 'f', 1).arg(y_unit[query.value(3).toInt()]);
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
204 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
205 w = QString("%1 €").arg(query.value(5).toDouble(), 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
206 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
207 w = QString("%1 €").arg(query.value(4).toDouble() * query.value(5).toDouble(), 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
208 tot_yeasts += (query.value(4).toDouble() * query.value(5).toDouble());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
209 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
210 query.next();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
211 y += 20;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
212 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
213 painter.fillRect( 0, y, 735, 20, c_header);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
214 painter.drawText( 0, y+4, 100, 20, Qt::AlignLeft, tr("Total"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
215 w = QString("%1 €").arg(tot_yeasts, 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
216 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
217 y += 20;
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
219 /* Miscs supplies */
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 query.exec("SELECT name,type,amount_is_weight,inventory,cost FROM inventory_miscs WHERE inventory > 0 ORDER BY type,name");
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 query.first();
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
222 if ((y + 80 + (query.size() * 20)) > painter.device()->height()) { /* Rows + header + footer + blank */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
223 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
224 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
225 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
226 } else {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
227 y += 40;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
228 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
229 painter.setFont(QFont("Helvetica", 9, QFont::Bold));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
230 painter.setPen(Qt::black);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
231 painter.fillRect( 0, y, 735, 20, c_header);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
232 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, tr("Type"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
233 painter.drawText(120, y+4, 340, 20, Qt::AlignLeft, tr("Ingredient"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
234 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, tr("Stock"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
235 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, tr("Price/Kg"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
236 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, tr("Value"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
237 y += 20;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
238 painter.setFont(QFont("Helvetica", 9, QFont::Normal));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
239 for (int i = 0; i < query.size(); i++) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
240 if ((y + 20) > painter.device()->height()) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
241 printer->newPage();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
242 printHeader(&painter);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
243 y = 120;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
244 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
245 painter.fillRect( 0, y, 735, 20, (i % 2) ? c_line1:c_line2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
246 painter.drawText( 0, y+4, 120, 20, Qt::AlignLeft, m_types[query.value(1).toInt()]);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
247 painter.drawText(120, y+4, 340, 20, Qt::AlignLeft, query.value(0).toString());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
248 if (query.value(2).toInt())
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
249 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
250 else
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
251 w = QString("%1 ml").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
252 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
253 w = QString("%1 €").arg(query.value(4).toDouble(), 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
254 painter.drawText(575, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
255 w = QString("%1 €").arg(query.value(3).toDouble() * query.value(4).toDouble(), 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
256 tot_miscs += (query.value(3).toDouble() * query.value(4).toDouble());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
257 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
258 query.next();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
259 y += 20;
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
260 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
261 painter.fillRect( 0, y, 735, 20, c_header);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
262 painter.drawText( 0, y+4, 100, 20, Qt::AlignLeft, tr("Total"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
263 w = QString("%1 €").arg(tot_miscs, 8, 'f', 2);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
264 painter.drawText(655, y+4, 80, 20, Qt::AlignRight, w);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
265 y += 20;
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
266
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
267 } else if (p_job == PR_YEASTBANK) {
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
268 /*
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
269 * Print yeast in the private yeast bank.
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
270 */
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
271 query.exec("SELECT brewery_name,my_yeastlab FROM profile_setup WHERE record = '1'");
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
272 query.first();
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
273 QString my_lab = query.value(1).toString();
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
274 qDebug() << my_lab;
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
275 printHeader(&painter);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
276 y = 120;
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
277
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
278 painter.setFont(QFont("Helvetica", 9, QFont::Bold));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
279 painter.setPen(Qt::black);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
280 painter.fillRect( 0, y, 735, 20, c_header);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
281 painter.drawText( 0, y+4, 200, 20, Qt::AlignLeft, tr("Yeast"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
282 painter.drawText(200, y+4, 230, 20, Qt::AlignLeft, tr("Description"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
283 painter.drawText(430, y+4, 80, 20, Qt::AlignCenter, tr("Type"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
284 painter.drawText(510, y+4, 80, 20, Qt::AlignCenter, tr("Form"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
285 painter.drawText(590, y+4, 70, 20, Qt::AlignRight, tr("Stock"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
286 painter.drawText(665, y+4, 70, 20, Qt::AlignLeft, tr("Date"));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
287 y += 20;
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
288 painter.setFont(QFont("Helvetica", 9, QFont::Normal));
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
289 query.prepare("SELECT name,type,form,inventory,production_date,short_desc "
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
290 "FROM inventory_yeasts WHERE inventory > 0 AND laboratory = :my_lab ORDER BY product_id");
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
291 query.bindValue(":my_lab", my_lab);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
292 query.exec();
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
293 query.first();
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
294 for (int i = 0; i < query.size(); i++) {
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
295 painter.fillRect( 0, y, 735, 20, (i % 2) ? c_line1:c_line2);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
296 painter.drawText( 0, y+4, 200, 20, Qt::AlignLeft, query.value(0).toString());
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
297 painter.drawText(200, y+4, 230, 20, Qt::AlignLeft, query.value(5).toString());
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
298 painter.drawText(430, y+4, 80, 20, Qt::AlignCenter, y_types[query.value(1).toInt()]);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
299 painter.drawText(510, y+4, 80, 20, Qt::AlignCenter, y_form[query.value(2).toInt()]);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
300
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
301 if (query.value(2).toInt() == 0)
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
302 w = QString("%1 %2").arg(query.value(3).toDouble(), 10, 'f', 1).arg(y_unit[query.value(2).toInt()]);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
303 else
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
304 w = QString("%1 %2").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1).arg(y_unit[query.value(2).toInt()]);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
305 painter.drawText(590, y+4, 70, 20, Qt::AlignRight, w);
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
306 painter.drawText(665, y+4, 70, 20, Qt::AlignLeft, query.value(4).toString());
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
307 query.next();
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
308 y += 20;
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
309 }
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 painter.end();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
318 void PrinterDialog::printHeader(QPainter *painter)
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 {
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
320 QSqlQuery query("SELECT brewery_logo,brewery_name FROM profile_setup");
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 query.first();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 QByteArray logoByteArray = query.value(0).toByteArray();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 QPixmap outPixmap = QPixmap();
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 outPixmap.loadFromData(logoByteArray);
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
325 int w = outPixmap.width();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
326 int h = outPixmap.height();
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
327 /* Make sure to keep the logo aspect ratio */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
328 if (w == h) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
329 painter->drawPixmap(0, 0, 100, 100, outPixmap);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
330 } else if (w > h) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
331 painter->drawPixmap(0, 0, 100, (h * 100) / w, outPixmap);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
332 } else {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
333 painter->drawPixmap(0, 0, (w * 100) / h, 100, outPixmap);
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
334 }
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
336 /* The fat header line */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
337 painter->setFont(QFont("Helvetica",18, QFont::Bold));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
338 if (p_job == PR_SUPPLIES) {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
339 painter->drawText(120, 0, 500, 40, Qt::AlignLeft, tr("Inventory") + " " + query.value(1).toString());
54
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
340 } else if (p_job == PR_YEASTBANK) {
bba7be9034be Added print private yeastbank
Michiel Broek <mbroek@mbse.eu>
parents: 53
diff changeset
341 painter->drawText(120, 0, 500, 40, Qt::AlignLeft, tr("Yeast bank") + " " + query.value(1).toString());
53
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
342 } else {
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
343 painter->drawText(120, 0, 500, 40, Qt::AlignLeft, "?? " + query.value(1).toString());
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
344 }
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
345 /* The first normal header line */
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
346 painter->setFont(QFont("Helvetica",10, QFont::Normal));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
347 painter->drawText(120,35, 80, 20, Qt::AlignLeft, tr("Date and time"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
348 painter->drawText(200,35, 400, 20, Qt::AlignLeft, ": " + QDateTime::currentDateTime().toString("dd-MM-yyyy hh:mm"));
d36879f13d32 Completed printing inventory supplies.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
349 /* The report itself may print more lines from y = 55. */
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352

mercurial