53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#ifndef OUTPUTDIALOG_H
|
|
#define OUTPUTDIALOG_H
|
|
|
|
#include "check/check.h"
|
|
#include "output/output_options.h"
|
|
#include <QComboBox>
|
|
#include <QDialog>
|
|
#include <outputcolumn.h>
|
|
|
|
namespace Ui {
|
|
class OutputDialog;
|
|
}
|
|
|
|
class OutputDialog : public QDialog {
|
|
Q_OBJECT
|
|
|
|
OutputOptions options;
|
|
std::vector<Check> *checks;
|
|
std::vector<OutputColumn> *columns;
|
|
Settings *settings;
|
|
|
|
const std::map<std::string, ColumnType> column_names = {
|
|
{"date", ColumnType::date},
|
|
{"goods_name", ColumnType::goods_name},
|
|
{"goods_price_per_unit", ColumnType::goods_price_per_unit},
|
|
{"goods_quantity", ColumnType::goods_quantity},
|
|
{"goods_net_weight", ColumnType::goods_net_weight},
|
|
{"goods_total", ColumnType::goods_total}
|
|
};
|
|
|
|
public:
|
|
explicit OutputDialog(QWidget *parent = nullptr, std::vector<Check> *checks = nullptr);
|
|
~OutputDialog();
|
|
|
|
private slots:
|
|
void on_buttonBox_accepted();
|
|
|
|
void on_chooseFileButton_clicked();
|
|
|
|
void on_printHeaderCheckBox_stateChanged(int arg1);
|
|
|
|
void on_printTotalCheckBox_stateChanged(int arg1);
|
|
|
|
private:
|
|
Ui::OutputDialog *ui;
|
|
|
|
void print_header(std::ofstream *output_file);
|
|
|
|
void save_settings();
|
|
};
|
|
|
|
#endif // OUTPUTDIALOG_H
|