multi-check system

This commit is contained in:
leca 2025-05-11 00:25:05 +03:00
parent 86a11faf70
commit 463edd3df9
13 changed files with 435 additions and 268 deletions

View File

@ -1,14 +1,19 @@
#include "check.h" #include "check.h"
#include "../goods/goods.h" #include "../goods/goods.h"
#include <iostream>
Check::Check() {} Check::Check() {}
void Check::add_goods(Goods goods) { this->goods.push_back(goods); } void Check::add_goods(Goods goods) {
this->goods.push_back(goods);
this->total = this->calculae_total_price();
}
void Check::add_goods(std::vector<Goods> &goods) { void Check::add_goods(std::vector<Goods> &goods) {
for (auto g : goods) { for (auto &g : goods) {
this->goods.push_back(g); this->goods.push_back(g);
} }
this->total = this->calculae_total_price();
} }
double Check::calculae_total_price() { double Check::calculae_total_price() {
@ -17,7 +22,6 @@ double Check::calculae_total_price() {
for (Goods &g : goods) { for (Goods &g : goods) {
total += g.calculate_total_price(); total += g.calculate_total_price();
} }
return total; return total;
} }
@ -25,6 +29,64 @@ std::vector<Goods>& Check::get_goods() {
return goods; return goods;
} }
void Check::set_fn(std::string fn) {
this->fn = fn;
}
void Check::set_fd(std::string fd) {
this->fd = fd;
}
void Check::set_fi(std::string fi) {
this->fi = fi;
}
std::string Check::get_date() { std::string Check::get_date() {
return date; return date;
} }
void Check::set_date(std::string date) {
this->date = date;
}
void Check::set_operation_type(OperationType t) {
this->operation_type = t;
}
double Check::get_total() {
return total;
}
bool Check::operator==(Check &c) {
// std::cout << "Comparing" << std::endl;
// std::cout << this->date << " <>" << c.date << std::endl;
// std::cout << this->fd << " <>" << c.fd << std::endl;
// std::cout << this->fi<< " <>" << c.fi << std::endl;
// std::cout << this->fn<< " <>" << c.fn << std::endl;
// std::cout << this->operation_type << " <>" << c.operation_type << std::endl;
// std::cout << this->total<< " <>" << c.total<< std::endl;
return
this->date == c.date &&
this->fd == c.fd &&
this->fi == c.fi &&
this->fn == c.fn &&
this->operation_type == c.operation_type &&
this->total == c.total;
}
bool Check::operator==(const Check &c) {
// std::cout << "Comparing" << std::endl;
// std::cout << this->date << " <>" << c.date << std::endl;
// std::cout << this->fd << " <>" << c.fd << std::endl;
// std::cout << this->fi<< " <>" << c.fi << std::endl;
// std::cout << this->fn<< " <>" << c.fn << std::endl;
// std::cout << this->operation_type << " <>" << c.operation_type << std::endl;
// std::cout << this->total<< " <>" << c.total<< std::endl;
return
this->date == c.date &&
this->fd == c.fd &&
this->fi == c.fi &&
this->fn == c.fn &&
this->operation_type == c.operation_type &&
this->total == c.total;
}

View File

@ -43,6 +43,9 @@ public:
std::string get_date(); std::string get_date();
OperationType get_operationType(); OperationType get_operationType();
double get_total(); double get_total();
bool operator==(Check &);
bool operator==(const Check &);
}; };
#endif // CHECK_H #endif // CHECK_H

View File

@ -1,9 +1,9 @@
FROM ubuntu:18.04 FROM ubuntu:24.04
# Installing dependencies # Installing dependencies
RUN apt update RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y qtbase5-dev openssl libmbedtls-dev libopencv-dev libzbar-dev qttools5-dev nlohmann-json-dev libcurl4-openssl-dev libqrencode-dev RUN DEBIAN_FRONTEND=noninteractive apt install -y qt6-base-dev qt6-tools-dev openssl libmbedtls-dev libopencv-dev libzbar-dev nlohmann-json3-dev libcurl4-openssl-dev libqrencode-dev
RUN DEBIAN_FRONTEND=noninteractive apt install -y wget git cmake make gcc g++ fuse libboost-regex-dev RUN DEBIAN_FRONTEND=noninteractive apt install -y wget git cmake make gcc g++ fuse libboost-regex-dev
WORKDIR /app WORKDIR /app
@ -21,6 +21,8 @@ COPY net ./net
COPY translations ./translations COPY translations ./translations
COPY http_server ./http_server COPY http_server ./http_server
COPY utils ./utils COPY utils ./utils
COPY widgets ./widgets
COPY email_parser ./email_parser
COPY ./*.h ./*cpp ./*.ui ./*.qrc CMakeLists.txt . COPY ./*.h ./*cpp ./*.ui ./*.qrc CMakeLists.txt .

View File

@ -33,11 +33,13 @@ MainWindow::MainWindow(QWidget *parent)
ui->stop_server_button->hide(); ui->stop_server_button->hide();
QVBoxLayout *layout = new QVBoxLayout; QVBoxLayout *layout = new QVBoxLayout;
ui->checks_scroll_area->setLayout(layout);
ui->scrollAreaWidgetContents->setLayout(layout); ui->scrollAreaWidgetContents->setLayout(layout);
QLabel a = QLabel("123"); ui->checks_to_parse_label->hide();
layout->addWidget(&a); ui->checks_scroll_area->hide();
// ui->checks_to_parse_label->hide();
// ui->checks_scroll_area->hide(); connect(this, &MainWindow::deleteCheckFromList, this, &MainWindow::deleteCheckFromListHandler);
#ifdef BUILD_OFD_BINARYEYE_SCAN #ifdef BUILD_OFD_BINARYEYE_SCAN
QObject::connect(this, &MainWindow::httpErrorOccured, this, &MainWindow::notifyHttpServerFailure); QObject::connect(this, &MainWindow::httpErrorOccured, this, &MainWindow::notifyHttpServerFailure);
@ -97,7 +99,7 @@ void MainWindow::on_binary_eye_button_clicked() {
infoDialog.setText(QString::fromStdString(connectionString)); infoDialog.setText(QString::fromStdString(connectionString));
infoDialog.setIconPixmap(QPixmap(QString::fromStdString(get_path_relative_to_home(".local/share/checks_parser/binaryeye_connection.png"))).scaled(400, 400, Qt::KeepAspectRatio)); infoDialog.setIconPixmap(QPixmap(QString::fromStdString(get_path_relative_to_home(".local/share/checks_parser/binaryeye_connection.png"))).scaled(400, 400, Qt::KeepAspectRatio));
infoDialog.setWindowTitle(tr("QR code for binaryeye to connect")); infoDialog.setWindowTitle(tr("QR code for binaryeye to connect"));
infoDialog.setButtonText(1, tr("I've scanned")); infoDialog.addButton(tr("I've scanned"), QMessageBox::ButtonRole::AcceptRole);
infoDialog.exec(); infoDialog.exec();
} }
@ -206,6 +208,30 @@ void MainWindow::on_parse_button_clicked() {
d.exec(); d.exec();
} }
void MainWindow::deleteCheckFromListHandler(Check &check) {
for (unsigned int i = 0; i < ui->scrollAreaWidgetContents->layout()->count(); i ++) {
QLayoutItem *item = ui->scrollAreaWidgetContents->layout()->itemAt(i);
QObject *child = item->widget();
CheckListViewWidget *c = (CheckListViewWidget *)child;
if (c->get_check() == check) {
ui->scrollAreaWidgetContents->layout()->removeItem(item);
delete item;
delete child;
ui->scrollAreaWidgetContents->layout()->update();
ui->scrollAreaWidgetContents->update();
}
}
int position = std::find(checks.begin(), checks.end(), check) - checks.begin() - 1;
checks.erase(checks.begin() + position);
if (ui->scrollAreaWidgetContents->layout()->count() == 0) {
ui->checks_to_parse_label->hide();
ui->checks_scroll_area->hide();
}
}
void MainWindow::on_add_new_check_button_clicked() { void MainWindow::on_add_new_check_button_clicked() {
Check *new_check = parse_new_check(); Check *new_check = parse_new_check();
if (new_check == nullptr) { if (new_check == nullptr) {
@ -214,10 +240,9 @@ void MainWindow::on_add_new_check_button_clicked() {
checks.push_back(*new_check); checks.push_back(*new_check);
CheckListViewWidget check_list_widget(this, *new_check); CheckListViewWidget *check_list_widget = new CheckListViewWidget(this, *new_check);
auto a = QLabel("123"); ui->scrollAreaWidgetContents->layout()->addWidget(check_list_widget);
ui->scrollAreaWidgetContents->layout()->addWidget(&a);
delete new_check; delete new_check;
@ -250,6 +275,11 @@ Check *MainWindow::parse_new_check() {
solved_captcha); solved_captcha);
(*check) = parseOfdRuAnswer(check_content); (*check) = parseOfdRuAnswer(check_content);
check->set_date(ui->purchase_datetime_edit->dateTime().toString(Qt::ISODate).toStdString());
check->set_fn(ui->fn_line_edit->text().toStdString());
check->set_fd(ui->fd_line_edit->text().toStdString());
check->set_fi(ui->fi_line_edit->text().toStdString());
check->set_operation_type(OperationType(ui->operation_type_combo_box->currentIndex() + 1));
return check; return check;
} catch(OfdRequestException e) { } catch(OfdRequestException e) {
if (!strcmp(e.what(), "Incorrect captcha")) { if (!strcmp(e.what(), "Incorrect captcha")) {

View File

@ -22,6 +22,7 @@ public:
~MainWindow(); ~MainWindow();
Check *parse_new_check(); Check *parse_new_check();
#ifdef BUILD_OFD_BINARYEYE_SCAN #ifdef BUILD_OFD_BINARYEYE_SCAN
void startHttpServer(); void startHttpServer();
#endif #endif
@ -29,6 +30,7 @@ public:
signals: signals:
void httpNewMessage(QString message); void httpNewMessage(QString message);
void httpErrorOccured(); void httpErrorOccured();
void deleteCheckFromList(Check&);
private slots: private slots:
#ifdef BUILD_OFD_LOCAL_QR_SCAN #ifdef BUILD_OFD_LOCAL_QR_SCAN
@ -45,12 +47,12 @@ private slots:
void on_stop_server_button_clicked(); void on_stop_server_button_clicked();
void httpNewMessageHandler(QString message); void httpNewMessageHandler(QString message);
void deleteCheckFromListHandler(Check&);
#endif #endif
#ifdef BUILD_EMAIL_MODE #ifdef BUILD_EMAIL_MODE
void on_parse_email_button_clicked(); void on_parse_email_button_clicked();
#endif #endif
void on_add_new_check_button_clicked(); void on_add_new_check_button_clicked();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
std::vector<Check> checks; std::vector<Check> checks;

View File

@ -15,6 +15,12 @@ OutputDialog::OutputDialog(QWidget *parent, std::vector<Check> *checks)
ui->setupUi(this); ui->setupUi(this);
ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->verticalHeader()->setSectionsMovable(true);
ui->tableWidget->verticalHeader()->setDragDropOverwriteMode(false);
ui->tableWidget->verticalHeader()->setDragEnabled(true);
ui->tableWidget->verticalHeader()->setDragDropMode(QAbstractItemView::InternalMove);
ui->tableWidget->item(0, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["date"]["name"])); ui->tableWidget->item(0, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["date"]["name"]));
ui->tableWidget->item(0, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["date"]["position"])); ui->tableWidget->item(0, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["date"]["position"]));
@ -79,7 +85,7 @@ void OutputDialog::on_buttonBox_accepted() {
for (auto &column : this->options.get_columns()) { for (auto &column : this->options.get_columns()) {
switch (column.type) { switch (column.type) {
case ColumnType::date: case ColumnType::date:
if (i == 0) output_file << "date goes here"; if (i == 0) output_file << check.get_date();
break; break;
case ColumnType::goods_name: case ColumnType::goods_name:
output_file << it->get_name(); output_file << it->get_name();

View File

@ -26,10 +26,10 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="3"> <item row="1" column="1">
<widget class="QLabel" name="or_label_2"> <widget class="QLabel" name="or_label_1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -39,23 +39,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="2" colspan="2"> <item row="6" column="0">
<widget class="QPushButton" name="add_new_check_button"> <widget class="QLabel" name="datetime_label">
<property name="text"> <property name="text">
<string>Add new check</string> <string>Date and time of purchase</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="fn_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FN (Fiscal Number)</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -72,118 +59,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2" colspan="3">
<widget class="QLineEdit" name="fi_line_edit"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="choose_image_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Choose image on your PC</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="stop_server_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stop server</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="fi_label">
<property name="text">
<string>FI (Fiscal Identifier)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="settings_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Settings</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="total_label">
<property name="text">
<string>Total</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<widget class="QLineEdit" name="fn_line_edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="6" column="2" colspan="3">
<widget class="QDateTimeEdit" name="purchase_datetime_edit"/>
</item>
<item row="9" column="0" colspan="2">
<widget class="QPushButton" name="clear_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="datetime_label">
<property name="text">
<string>Date and time of purchase</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="or_label_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>or</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="operation_type_label">
<property name="text">
<string>Operation type</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="3">
<widget class="QLineEdit" name="fd_line_edit"/>
</item>
<item row="8" column="2" colspan="3"> <item row="8" column="2" colspan="3">
<widget class="QDoubleSpinBox" name="total_spin_box"> <widget class="QDoubleSpinBox" name="total_spin_box">
<property name="maximum"> <property name="maximum">
@ -191,16 +66,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="0" column="5">
<widget class="QPushButton" name="binary_eye_button"> <widget class="QLabel" name="checks_to_parse_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Use your phone as a QR code scanner</string> <string>Checks to parse</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="fi_label">
<property name="text">
<string>FI (Fiscal Identifier)</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -217,8 +96,41 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="0" column="0">
<widget class="QPushButton" name="parse_email_button"> <widget class="QPushButton" name="settings_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Settings</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="fn_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>FN (Fiscal Number)</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="total_label">
<property name="text">
<string>Total</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="binary_eye_button">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -226,10 +138,49 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Parse an E-Mail</string> <string>Use your phone as a QR code scanner</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3">
<widget class="QLabel" name="or_label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>or</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="choose_image_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Choose image on your PC</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<widget class="QLineEdit" name="fn_line_edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="6" column="2" colspan="3">
<widget class="QDateTimeEdit" name="purchase_datetime_edit"/>
</item>
<item row="2" column="0" colspan="5"> <item row="2" column="0" colspan="5">
<widget class="QLabel" name="info_label"> <widget class="QLabel" name="info_label">
<property name="sizePolicy"> <property name="sizePolicy">
@ -243,6 +194,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="4">
<widget class="QPushButton" name="stop_server_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stop server</string>
</property>
</widget>
</item>
<item row="7" column="2" colspan="3"> <item row="7" column="2" colspan="3">
<widget class="QComboBox" name="operation_type_combo_box"> <widget class="QComboBox" name="operation_type_combo_box">
<item> <item>
@ -267,14 +231,54 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="5" rowspan="9"> <item row="7" column="0">
<widget class="QScrollArea" name="checks_scroll_area"> <widget class="QLabel" name="operation_type_label">
<property name="text">
<string>Operation type</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="parse_email_button">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text">
<string>Parse an E-Mail</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QPushButton" name="clear_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="3">
<widget class="QLineEdit" name="fi_line_edit"/>
</item>
<item row="9" column="2" colspan="2">
<widget class="QPushButton" name="add_new_check_button">
<property name="text">
<string>Add new check</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="3">
<widget class="QLineEdit" name="fd_line_edit"/>
</item>
<item row="1" column="5" rowspan="9">
<widget class="QScrollArea" name="checks_scroll_area">
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -290,16 +294,6 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="0" column="5">
<widget class="QLabel" name="checks_to_parse_label">
<property name="text">
<string>Checks to parse</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@ -14,13 +14,10 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="4" column="2"> <item row="0" column="0">
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QLabel" name="pathLabel">
<property name="orientation"> <property name="text">
<enum>Qt::Orientation::Horizontal</enum> <string>Path to export: </string>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -45,15 +42,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="4" column="2">
<widget class="QLabel" name="pathLabel"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="text"> <property name="orientation">
<string>Path to export: </string> <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> <item row="3" column="0" colspan="3">
<widget class="QTableWidget" name="tableWidget"> <widget class="TableWidgetMovable" name="tableWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -200,6 +200,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>TableWidgetMovable</class>
<extends>QTableWidget</extends>
<header>widgets/tablewidgetmovable.hpp</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>

View File

@ -70,7 +70,7 @@
<translation type="vanished">Store type</translation> <translation type="vanished">Store type</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="216"/> <location filename="../scenes/mainwindow.ui" line="95"/>
<source>Parse</source> <source>Parse</source>
<translation>Parse</translation> <translation>Parse</translation>
</message> </message>
@ -113,13 +113,13 @@
<translation type="vanished">0000000000000000</translation> <translation type="vanished">0000000000000000</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="58"/> <location filename="../scenes/mainwindow.ui" line="121"/>
<source>FN (Fiscal Number)</source> <source>FN (Fiscal Number)</source>
<translatorcomment>FN = Фискальный Номер</translatorcomment> <translatorcomment>FN = Фискальный Номер</translatorcomment>
<translation>FN (Fiscal Number)</translation> <translation>FN (Fiscal Number)</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="71"/> <location filename="../scenes/mainwindow.ui" line="58"/>
<source>FD (Fiscal Document)</source> <source>FD (Fiscal Document)</source>
<translatorcomment>FD = Фискальный Документ</translatorcomment> <translatorcomment>FD = Фискальный Документ</translatorcomment>
<translation>FD (Fiscal Document)</translation> <translation>FD (Fiscal Document)</translation>
@ -133,93 +133,93 @@
<translation type="obsolete">Back</translation> <translation type="obsolete">Back</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="100"/> <location filename="../scenes/mainwindow.ui" line="206"/>
<source>Stop server</source> <source>Stop server</source>
<translation>Stop server</translation> <translation>Stop server</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="87"/> <location filename="../scenes/mainwindow.ui" line="167"/>
<source>Choose image on your PC</source> <source>Choose image on your PC</source>
<translation>Choose image on your PC</translation> <translation>Choose image on your PC</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="38"/> <location filename="../scenes/mainwindow.ui" line="38"/>
<location filename="../scenes/mainwindow.ui" line="173"/> <location filename="../scenes/mainwindow.ui" line="154"/>
<source>or</source> <source>or</source>
<translation>or</translation> <translation>or</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="203"/> <location filename="../scenes/mainwindow.ui" line="141"/>
<source>Use your phone as a QR code scanner</source> <source>Use your phone as a QR code scanner</source>
<translation>Use your phone as a QR code scanner</translation> <translation>Use your phone as a QR code scanner</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="107"/> <location filename="../scenes/mainwindow.ui" line="82"/>
<source>FI (Fiscal Identifier)</source> <source>FI (Fiscal Identifier)</source>
<translatorcomment>FI = Фискальный Признак</translatorcomment> <translatorcomment>FI = Фискальный Признак</translatorcomment>
<translation>FI (Fiscal Identifier)</translation> <translation>FI (Fiscal Identifier)</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="45"/> <location filename="../scenes/mainwindow.ui" line="273"/>
<source>Add new check</source> <source>Add new check</source>
<translation>Add new check</translation> <translation>Add new check</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="153"/> <location filename="../scenes/mainwindow.ui" line="263"/>
<source>Clear</source> <source>Clear</source>
<translation>Clear</translation> <translation>Clear</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="160"/> <location filename="../scenes/mainwindow.ui" line="45"/>
<source>Date and time of purchase</source> <source>Date and time of purchase</source>
<translation>Date and time of purchase</translation> <translation>Date and time of purchase</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="180"/> <location filename="../scenes/mainwindow.ui" line="237"/>
<source>Operation type</source> <source>Operation type</source>
<translation>Operation type</translation> <translation>Operation type</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="229"/> <location filename="../scenes/mainwindow.ui" line="250"/>
<source>Parse an E-Mail</source> <source>Parse an E-Mail</source>
<translation>Parse an E-Mail</translation> <translation>Parse an E-Mail</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="250"/> <location filename="../scenes/mainwindow.ui" line="214"/>
<source>Funds income</source> <source>Funds income</source>
<translatorcomment>Приход средств</translatorcomment> <translatorcomment>Приход средств</translatorcomment>
<translation>Funds income</translation> <translation>Funds income</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="255"/> <location filename="../scenes/mainwindow.ui" line="219"/>
<source>Funds return</source> <source>Funds return</source>
<translatorcomment>Возврат средств</translatorcomment> <translatorcomment>Возврат средств</translatorcomment>
<translation>Funds return</translation> <translation>Funds return</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="260"/> <location filename="../scenes/mainwindow.ui" line="224"/>
<source>Funds spend</source> <source>Funds spend</source>
<translatorcomment>Расход средств</translatorcomment> <translatorcomment>Расход средств</translatorcomment>
<translation>Funds spend</translation> <translation>Funds spend</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="265"/> <location filename="../scenes/mainwindow.ui" line="229"/>
<source>Spends return</source> <source>Spends return</source>
<translatorcomment>Возврат расхода</translatorcomment> <translatorcomment>Возврат расхода</translatorcomment>
<translation>Spends return</translation> <translation>Spends return</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="296"/> <location filename="../scenes/mainwindow.ui" line="72"/>
<source>Checks to parse</source> <source>Checks to parse</source>
<translation>Checks to parse</translation> <translation>Checks to parse</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="120"/> <location filename="../scenes/mainwindow.ui" line="108"/>
<source>Settings</source> <source>Settings</source>
<translation>Settings</translation> <translation>Settings</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="127"/> <location filename="../scenes/mainwindow.ui" line="128"/>
<source>Total</source> <source>Total</source>
<translation>Total</translation> <translation>Total</translation>
</message> </message>
@ -228,37 +228,37 @@
<translation type="vanished">checks parser</translation> <translation type="vanished">checks parser</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="99"/> <location filename="../mainwindow.cpp" line="101"/>
<source>QR code for binaryeye to connect</source> <source>QR code for binaryeye to connect</source>
<translation>QR code for binaryeye to connect</translation> <translation>QR code for binaryeye to connect</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="100"/> <location filename="../mainwindow.cpp" line="102"/>
<source>I&apos;ve scanned</source> <source>I&apos;ve scanned</source>
<translation>I&apos;ve scanned</translation> <translation>I&apos;ve scanned</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="106"/> <location filename="../mainwindow.cpp" line="108"/>
<source>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</source> <source>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</source>
<translation>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</translation> <translation>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="108"/> <location filename="../mainwindow.cpp" line="110"/>
<source>Could not start http server.</source> <source>Could not start http server.</source>
<translation>Could not start http server.</translation> <translation>Could not start http server.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="152"/> <location filename="../mainwindow.cpp" line="154"/>
<source>Selected image: </source> <source>Selected image: </source>
<translation>Selected image: </translation> <translation>Selected image: </translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="185"/> <location filename="../mainwindow.cpp" line="187"/>
<source>This feature is under development. Wait it to appear in next updates.</source> <source>This feature is under development. Wait it to appear in next updates.</source>
<translation>This feature is under development. Wait for it to appear in next updates.</translation> <translation>This feature is under development. Wait for it to appear in next updates.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="187"/> <location filename="../mainwindow.cpp" line="189"/>
<source>Under development</source> <source>Under development</source>
<translation>Under development</translation> <translation>Under development</translation>
</message> </message>
@ -271,32 +271,32 @@
<translation type="vanished">No checks to parse</translation> <translation type="vanished">No checks to parse</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="257"/> <location filename="../mainwindow.cpp" line="287"/>
<source>Captcha was not solved correctly!</source> <source>Captcha was not solved correctly!</source>
<translation>Captcha was not solved correctly!</translation> <translation>Captcha was not solved correctly!</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="259"/> <location filename="../mainwindow.cpp" line="289"/>
<source>Captcha is incorrect</source> <source>Captcha is incorrect</source>
<translation>Captcha is incorrect</translation> <translation>Captcha is incorrect</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="264"/> <location filename="../mainwindow.cpp" line="294"/>
<source>Internal server error. Please, try again later.</source> <source>Internal server error. Please, try again later.</source>
<translation>Internal server error. Please, try again later.</translation> <translation>Internal server error. Please, try again later.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="266"/> <location filename="../mainwindow.cpp" line="296"/>
<source>Internal server error</source> <source>Internal server error</source>
<translation>Internal server error</translation> <translation>Internal server error</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="271"/> <location filename="../mainwindow.cpp" line="301"/>
<source>Check not found. Please, ensure correctness of entered data.</source> <source>Check not found. Please, ensure correctness of entered data.</source>
<translation>Check not found. Please, ensure correctness of entered data.</translation> <translation>Check not found. Please, ensure correctness of entered data.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="273"/> <location filename="../mainwindow.cpp" line="303"/>
<source>Check was not found</source> <source>Check was not found</source>
<translation>Check was not found</translation> <translation>Check was not found</translation>
</message> </message>
@ -309,12 +309,12 @@
<translation type="vanished">Error in parsing</translation> <translation type="vanished">Error in parsing</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="145"/> <location filename="../mainwindow.cpp" line="147"/>
<source>Please, select a picture where QR code that contains info about check is present</source> <source>Please, select a picture where QR code that contains info about check is present</source>
<translation>Please, select a picture where QR code that contains info about check is present</translation> <translation>Please, select a picture where QR code that contains info about check is present</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="147"/> <location filename="../mainwindow.cpp" line="149"/>
<source>Picture was not selected</source> <source>Picture was not selected</source>
<translation>Picture was not selected</translation> <translation>Picture was not selected</translation>
</message> </message>
@ -522,17 +522,17 @@
<translation>Dialog</translation> <translation>Dialog</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="51"/> <location filename="../scenes/outputdialog.ui" line="20"/>
<source>Path to export: </source> <source>Path to export: </source>
<translation>Path to export: </translation> <translation>Path to export: </translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="30"/> <location filename="../scenes/outputdialog.ui" line="27"/>
<source>Choose</source> <source>Choose</source>
<translation>Choose</translation> <translation>Choose</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="37"/> <location filename="../scenes/outputdialog.ui" line="34"/>
<source>Print header</source> <source>Print header</source>
<translation>Print header</translation> <translation>Print header</translation>
</message> </message>
@ -633,7 +633,7 @@
<translation>Total price</translation> <translation>Total price</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="44"/> <location filename="../scenes/outputdialog.ui" line="41"/>
<source>Print total</source> <source>Print total</source>
<translation>Print total</translation> <translation>Print total</translation>
</message> </message>

View File

@ -70,7 +70,7 @@
<translation type="vanished">Магазин</translation> <translation type="vanished">Магазин</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="216"/> <location filename="../scenes/mainwindow.ui" line="95"/>
<source>Parse</source> <source>Parse</source>
<translation>Парсить</translation> <translation>Парсить</translation>
</message> </message>
@ -113,13 +113,13 @@
<translation type="vanished">0000000000000000</translation> <translation type="vanished">0000000000000000</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="58"/> <location filename="../scenes/mainwindow.ui" line="121"/>
<source>FN (Fiscal Number)</source> <source>FN (Fiscal Number)</source>
<translatorcomment>Фискальный Норма</translatorcomment> <translatorcomment>Фискальный Норма</translatorcomment>
<translation>ФН</translation> <translation>ФН</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="71"/> <location filename="../scenes/mainwindow.ui" line="58"/>
<source>FD (Fiscal Document)</source> <source>FD (Fiscal Document)</source>
<translatorcomment>Фискальный Документ</translatorcomment> <translatorcomment>Фискальный Документ</translatorcomment>
<translation>ФД</translation> <translation>ФД</translation>
@ -133,89 +133,89 @@
<translation type="obsolete">Назад</translation> <translation type="obsolete">Назад</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="100"/> <location filename="../scenes/mainwindow.ui" line="206"/>
<source>Stop server</source> <source>Stop server</source>
<translation>Остановить сервер</translation> <translation>Остановить сервер</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="87"/> <location filename="../scenes/mainwindow.ui" line="167"/>
<source>Choose image on your PC</source> <source>Choose image on your PC</source>
<translation>Выбрать изображение на компьютере</translation> <translation>Выбрать изображение на компьютере</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="38"/> <location filename="../scenes/mainwindow.ui" line="38"/>
<location filename="../scenes/mainwindow.ui" line="173"/> <location filename="../scenes/mainwindow.ui" line="154"/>
<source>or</source> <source>or</source>
<translation>или</translation> <translation>или</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="203"/> <location filename="../scenes/mainwindow.ui" line="141"/>
<source>Use your phone as a QR code scanner</source> <source>Use your phone as a QR code scanner</source>
<translation>Использовать телефон как сканнер QR</translation> <translation>Использовать телефон как сканнер QR</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="107"/> <location filename="../scenes/mainwindow.ui" line="82"/>
<source>FI (Fiscal Identifier)</source> <source>FI (Fiscal Identifier)</source>
<translatorcomment>Фискальный Признак</translatorcomment> <translatorcomment>Фискальный Признак</translatorcomment>
<translation>ФП</translation> <translation>ФП</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="45"/> <location filename="../scenes/mainwindow.ui" line="273"/>
<source>Add new check</source> <source>Add new check</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="153"/> <location filename="../scenes/mainwindow.ui" line="263"/>
<source>Clear</source> <source>Clear</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="160"/> <location filename="../scenes/mainwindow.ui" line="45"/>
<source>Date and time of purchase</source> <source>Date and time of purchase</source>
<translation>Дата и время покупки</translation> <translation>Дата и время покупки</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="180"/> <location filename="../scenes/mainwindow.ui" line="237"/>
<source>Operation type</source> <source>Operation type</source>
<translation>Тип операции</translation> <translation>Тип операции</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="229"/> <location filename="../scenes/mainwindow.ui" line="250"/>
<source>Parse an E-Mail</source> <source>Parse an E-Mail</source>
<translation>Парсить E-Mail</translation> <translation>Парсить E-Mail</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="250"/> <location filename="../scenes/mainwindow.ui" line="214"/>
<source>Funds income</source> <source>Funds income</source>
<translation>Приход средств</translation> <translation>Приход средств</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="255"/> <location filename="../scenes/mainwindow.ui" line="219"/>
<source>Funds return</source> <source>Funds return</source>
<translation>Возврат средств</translation> <translation>Возврат средств</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="260"/> <location filename="../scenes/mainwindow.ui" line="224"/>
<source>Funds spend</source> <source>Funds spend</source>
<translation>Расход средств</translation> <translation>Расход средств</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="265"/> <location filename="../scenes/mainwindow.ui" line="229"/>
<source>Spends return</source> <source>Spends return</source>
<translation>Возврат расхода</translation> <translation>Возврат расхода</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="296"/> <location filename="../scenes/mainwindow.ui" line="72"/>
<source>Checks to parse</source> <source>Checks to parse</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="120"/> <location filename="../scenes/mainwindow.ui" line="108"/>
<source>Settings</source> <source>Settings</source>
<translation>Настройки</translation> <translation>Настройки</translation>
</message> </message>
<message> <message>
<location filename="../scenes/mainwindow.ui" line="127"/> <location filename="../scenes/mainwindow.ui" line="128"/>
<source>Total</source> <source>Total</source>
<translation>Итого</translation> <translation>Итого</translation>
</message> </message>
@ -224,67 +224,67 @@
<translation type="vanished">Парсер чеков</translation> <translation type="vanished">Парсер чеков</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="99"/> <location filename="../mainwindow.cpp" line="101"/>
<source>QR code for binaryeye to connect</source> <source>QR code for binaryeye to connect</source>
<translation>QR код для подключения BinaryEye</translation> <translation>QR код для подключения BinaryEye</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="100"/> <location filename="../mainwindow.cpp" line="102"/>
<source>I&apos;ve scanned</source> <source>I&apos;ve scanned</source>
<translation>Просканировал</translation> <translation>Просканировал</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="106"/> <location filename="../mainwindow.cpp" line="108"/>
<source>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</source> <source>Could not start http server. 10 times in a row random port was occupied. Either you should run for a lottery ticket, or the problem is in the program. If the lottery ticket wasn&apos;t lucky, please, contact the developer.</source>
<translation>Не смог поднять HTTP сервер. 10 раз подряд случайно выбранный порт был занят. Либо Вам следует бежать за лоттерейным билетом, или в программе баг. Если лотерейный билет не был выигрышным, пожалуйста, сообщите разработчику.</translation> <translation>Не смог поднять HTTP сервер. 10 раз подряд случайно выбранный порт был занят. Либо Вам следует бежать за лоттерейным билетом, или в программе баг. Если лотерейный билет не был выигрышным, пожалуйста, сообщите разработчику.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="108"/> <location filename="../mainwindow.cpp" line="110"/>
<source>Could not start http server.</source> <source>Could not start http server.</source>
<translation>Не получилось запустить HTTP сервер.</translation> <translation>Не получилось запустить HTTP сервер.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="152"/> <location filename="../mainwindow.cpp" line="154"/>
<source>Selected image: </source> <source>Selected image: </source>
<translation>Выбранное изображение: </translation> <translation>Выбранное изображение: </translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="185"/> <location filename="../mainwindow.cpp" line="187"/>
<source>This feature is under development. Wait it to appear in next updates.</source> <source>This feature is under development. Wait it to appear in next updates.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="187"/> <location filename="../mainwindow.cpp" line="189"/>
<source>Under development</source> <source>Under development</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="257"/> <location filename="../mainwindow.cpp" line="287"/>
<source>Captcha was not solved correctly!</source> <source>Captcha was not solved correctly!</source>
<translation>Капча была решена неверно!</translation> <translation>Капча была решена неверно!</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="259"/> <location filename="../mainwindow.cpp" line="289"/>
<source>Captcha is incorrect</source> <source>Captcha is incorrect</source>
<translation>Капча введена неверно</translation> <translation>Капча введена неверно</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="264"/> <location filename="../mainwindow.cpp" line="294"/>
<source>Internal server error. Please, try again later.</source> <source>Internal server error. Please, try again later.</source>
<translation>Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.</translation> <translation>Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="266"/> <location filename="../mainwindow.cpp" line="296"/>
<source>Internal server error</source> <source>Internal server error</source>
<translation>Внутренняя ошибка сервера</translation> <translation>Внутренняя ошибка сервера</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="271"/> <location filename="../mainwindow.cpp" line="301"/>
<source>Check not found. Please, ensure correctness of entered data.</source> <source>Check not found. Please, ensure correctness of entered data.</source>
<translation>Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.</translation> <translation>Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="273"/> <location filename="../mainwindow.cpp" line="303"/>
<source>Check was not found</source> <source>Check was not found</source>
<translation>Чек не найден</translation> <translation>Чек не найден</translation>
</message> </message>
@ -297,12 +297,12 @@
<translation type="vanished">Ошибка в парсинге</translation> <translation type="vanished">Ошибка в парсинге</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="145"/> <location filename="../mainwindow.cpp" line="147"/>
<source>Please, select a picture where QR code that contains info about check is present</source> <source>Please, select a picture where QR code that contains info about check is present</source>
<translation>Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке</translation> <translation>Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="147"/> <location filename="../mainwindow.cpp" line="149"/>
<source>Picture was not selected</source> <source>Picture was not selected</source>
<translation>Изображение не было выбрано</translation> <translation>Изображение не было выбрано</translation>
</message> </message>
@ -510,17 +510,17 @@
<translation>Диалог</translation> <translation>Диалог</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="51"/> <location filename="../scenes/outputdialog.ui" line="20"/>
<source>Path to export: </source> <source>Path to export: </source>
<translation>Путь для экспорта: </translation> <translation>Путь для экспорта: </translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="30"/> <location filename="../scenes/outputdialog.ui" line="27"/>
<source>Choose</source> <source>Choose</source>
<translation>Выбрать</translation> <translation>Выбрать</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="37"/> <location filename="../scenes/outputdialog.ui" line="34"/>
<source>Print header</source> <source>Print header</source>
<translation>Печатать заголовок</translation> <translation>Печатать заголовок</translation>
</message> </message>
@ -621,7 +621,7 @@
<translation>Всего</translation> <translation>Всего</translation>
</message> </message>
<message> <message>
<location filename="../scenes/outputdialog.ui" line="44"/> <location filename="../scenes/outputdialog.ui" line="41"/>
<source>Print total</source> <source>Print total</source>
<translation>Печатать Итого</translation> <translation>Печатать Итого</translation>
</message> </message>

View File

@ -7,23 +7,30 @@
#include <iostream> #include <iostream>
CheckListViewWidget::CheckListViewWidget(QWidget *parent, Check check) : QWidget(parent), check(check) { CheckListViewWidget::CheckListViewWidget(QWidget *parent, Check check) : QWidget(parent), check(check) {
mw = (MainWindow*) parent;
std::cout << "I was created with check with date " << check.get_date() << std::endl; std::cout << "I was created with check with date " << check.get_date() << std::endl;
QHBoxLayout *layout = new QHBoxLayout; QHBoxLayout *layout = new QHBoxLayout;
QLabel *label1 = new QLabel(QString::fromStdString(check.get_date())); QLabel *date_label = new QLabel(QString::fromStdString(check.get_date()));
QLabel *label2 = new QLabel("Text 2"); QLabel *summ_label = new QLabel(QString::number(check.get_total()));
QLabel *label3 = new QLabel("Text 3");
QPushButton *deleteButton = new QPushButton(tr("Delete")); QPushButton *deleteButton = new QPushButton(tr("Delete"));
deleteButton->connect(deleteButton, &QPushButton::clicked, this, &CheckListViewWidget::deleteButtonPressed); deleteButton->connect(deleteButton, &QPushButton::clicked, this, &CheckListViewWidget::delete_button_pressed);
layout->addWidget(label1); layout->addWidget(date_label);
layout->addWidget(label2); layout->addWidget(summ_label);
layout->addWidget(label3);
layout->addSpacing(10); layout->addSpacing(10);
layout->addWidget(deleteButton); layout->addWidget(deleteButton);
setLayout(layout); setLayout(layout);
} }
Check &CheckListViewWidget::get_check(){
return check;
}
void CheckListViewWidget::delete_button_pressed() {
emit mw->deleteCheckFromList(this->check);
}

View File

@ -3,6 +3,7 @@
#include <QObject> #include <QObject>
#include <QWidget> #include <QWidget>
#include <mainwindow.h>
#include <check/check.h> #include <check/check.h>
@ -10,9 +11,12 @@ class CheckListViewWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
Check check; Check check;
MainWindow* mw;
public: public:
explicit CheckListViewWidget(QWidget *parent = nullptr, Check check = Check()); explicit CheckListViewWidget(QWidget *parent = nullptr, Check check = Check());
Check &get_check();
void delete_button_pressed();
signals: signals:
Check deleteButtonPressed(); Check deleteButtonPressed();
}; };

View File

@ -7,6 +7,56 @@
TableWidgetMovable::TableWidgetMovable(QWidget *parent) : QTableWidget(parent) { } TableWidgetMovable::TableWidgetMovable(QWidget *parent) : QTableWidget(parent) { }
// void TableWidgetMovable::dropEvent(QDropEvent *event) {
// if (event->source() == this) {
// // Get the index of the row being dragged
// QModelIndex sourceIndex = currentIndex();
// if (!sourceIndex.isValid()) {
// return;
// }
// // Get the index of the target row
// QModelIndex targetIndex = indexAt(event->pos());
// if (!targetIndex.isValid()) {
// return;
// }
// int sourceRow = sourceIndex.row();
// int targetRow = targetIndex.row();
// // Swap rows
// if (sourceRow != targetRow) {
// // Store the data of the source row
// QList<QTableWidgetItem*> itemsSource;
// for (int col = 0; col < columnCount(); ++col) {
// itemsSource.append(takeItem(sourceRow, col));
// }
// QList<QTableWidgetItem*> itemsTarget;
// for (int col = 0; col < columnCount(); ++col) {
// itemsTarget.append(takeItem(targetRow, col));
// }
// // Insert the items into the target row
// for (int col = 0; col < columnCount(); ++col) {
// setItem(targetRow, col, itemsSource[col]);
// setItem(sourceRow, col, itemsTarget[col]);
// }
// // for (int col = 0; col < columnCount(); ++col) {
// // }
// // Remove the original row
// // removeRow(sourceRow < targetRow ? sourceRow : sourceRow + 1);
// }
// event->acceptProposedAction();
// } else {
// QTableWidget::dropEvent(event);
// }
// }
// TOOD: fix None of these works. WIP // TOOD: fix None of these works. WIP
// void TableWidgetMovable::dropEvent(QDropEvent *event) { // void TableWidgetMovable::dropEvent(QDropEvent *event) {