fixed only handling two fields of a check
This commit is contained in:
@@ -20,6 +20,13 @@ OutputDialog::OutputDialog(QWidget *parent, std::vector<Check> *checks)
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
for (Check &c : *checks) {
|
||||
std::cout << "Check: " << c.get_date() << " " << c.get_total() << std::endl;
|
||||
for (Goods &g : c.get_goods()) {
|
||||
std::cout << g.get_name() << " " << g.get_net_weight() << " " << g.get_price_per_unit() << " " << g.get_quantity() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
columns = new std::vector<OutputColumn>;
|
||||
|
||||
OutputColumnModel *model = new OutputColumnModel(columns, this);
|
||||
@@ -34,8 +41,12 @@ OutputDialog::OutputDialog(QWidget *parent, std::vector<Check> *checks)
|
||||
unsigned short position = settings->get_all_settings()["output_order"][column.first]["position"];
|
||||
ColumnType type = column.second;
|
||||
columns->at(position - 1) = (OutputColumn(QString::fromStdString(name), type));
|
||||
|
||||
}
|
||||
|
||||
for (unsigned short i = 0; i < 6; i ++)
|
||||
emit model->dataChanged(model->index(i, 0), model->index(i, 0));
|
||||
|
||||
ui->printHeaderCheckBox->setChecked(settings->get_all_settings()["print_header"]);
|
||||
ui->printTotalCheckBox->setChecked(settings->get_all_settings()["print_total"]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user