134 w = QString("%1").arg(query.value(8).toDouble(), 2, 'f', 1, '0' ); /* HSI */ |
134 w = QString("%1").arg(query.value(8).toDouble(), 2, 'f', 1, '0' ); /* HSI */ |
135 item = new QTableWidgetItem(w); |
135 item = new QTableWidgetItem(w); |
136 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
136 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
137 this->tableHops->setItem(ridx, 7, item); |
137 this->tableHops->setItem(ridx, 7, item); |
138 |
138 |
139 if (query.value(15).toDouble() > 0) |
139 if (query.value("inventory").toDouble() > 0) |
140 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(query.value(17).toString())); /* Harvest */ |
140 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(query.value("production_date").toString())); |
141 else |
141 else |
142 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(QString(""))); |
142 this->tableHops->setItem(ridx, 8, new QTableWidgetItem(QString(""))); |
143 |
143 |
144 w = QString(""); |
144 w = QString(""); |
145 if (query.value(15).toDouble() > 0) { |
145 if (query.value("inventory").toDouble() > 0) { |
146 if (query.value(15).toDouble() < 1.000) { |
146 if (query.value("form").toInt() < HOP_FORMS_CO2EXTRACT) { |
147 w = QString("%1 gr").arg(query.value(15).toDouble() * 1000.0, 2, 'f', 1, '0' ); |
147 if (query.value("inventory").toDouble() < 1.000) { |
148 } else { |
148 w = QString("%1 gr").arg(query.value("inventory").toDouble() * 1000.0, 2, 'f', 1, '0' ); |
149 w = QString("%1 kg").arg(query.value(15).toDouble(), 4, 'f', 3, '0' ); |
149 } else { |
150 } |
150 w = QString("%1 kg").arg(query.value("inventory").toDouble(), 4, 'f', 3, '0' ); |
151 } |
151 } |
|
152 } else { |
|
153 if (query.value("inventory").toDouble() < 1.000) { |
|
154 w = QString("%1 mL").arg(query.value("inventory").toDouble() * 1000.0, 2, 'f', 1, '0' ); |
|
155 } else { |
|
156 w = QString("%1 L").arg(query.value("inventory").toDouble(), 4, 'f', 3, '0' ); |
|
157 } |
|
158 } |
|
159 } |
152 item = new QTableWidgetItem(w); |
160 item = new QTableWidgetItem(w); |
153 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
161 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
154 this->tableHops->setItem(ridx, 9, item); |
162 this->tableHops->setItem(ridx, 9, item); |
155 |
163 |
156 /* Add the Edit button */ |
164 /* Add the Edit button */ |