huge wip
This commit is contained in:
parent
6706cbec45
commit
86a11faf70
|
@ -62,12 +62,12 @@ set(CMAKE_AUTOUIC_SEARCH_PATHS scenes)
|
|||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt6Core REQUIRED)
|
||||
if (BUILD_TRANSLATIONS)
|
||||
find_package(Qt5 REQUIRED COMPONENTS LinguistTools)
|
||||
find_package(Qt6 REQUIRED COMPONENTS LinguistTools)
|
||||
endif()
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt6Gui REQUIRED)
|
||||
find_package(Qt6Widgets REQUIRED)
|
||||
|
||||
set(TRANSLATION_SOURCES
|
||||
main.cpp
|
||||
|
@ -95,6 +95,9 @@ set(PROJECT_SOURCES
|
|||
net/net.h net/net.cpp
|
||||
settings/settings.h settings/settings.cpp
|
||||
|
||||
widgets/tablewidgetmovable.hpp widgets/tablewidgetmovable.cpp
|
||||
widgets/checklistviewwidget.h widgets/checklistviewwidget.cpp
|
||||
|
||||
${TRANSLATION_SOURCES}
|
||||
)
|
||||
|
||||
|
@ -111,7 +114,7 @@ if (BUILD_OFD_BINARYEYE_SCAN)
|
|||
endif()
|
||||
|
||||
if (BUILD_EMAIL_MODE)
|
||||
list(APPEND PROJECT_SOURCES email_parser/emailparser.h email_parser/emailparser.cpp)
|
||||
# list(APPEND PROJECT_SOURCES email_parser/emailparser.h email_parser/emailparser.cpp)
|
||||
list(APPEND PROJECT_SOURCES utils/base64.h utils/base64.cpp)
|
||||
endif()
|
||||
|
||||
|
@ -122,9 +125,9 @@ if (BUILD_TRANSLATIONS)
|
|||
translations/ru_RU.ts
|
||||
)
|
||||
|
||||
qt5_create_translation(QM_FILES "${TRANSLATION_SOURCES}" ${TS_FILES})
|
||||
qt_create_translation(QM_FILES "${TRANSLATION_SOURCES}" ${TS_FILES})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY)
|
||||
qt5_add_resources(TRANSLATIONQRC ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
||||
qt_add_resources(TRANSLATIONQRC ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
||||
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||
add_custom_target(resources ALL DEPENDS ${TRANSLATIONQRC})
|
||||
add_dependencies(resources translations)
|
||||
|
@ -133,13 +136,13 @@ endif()
|
|||
# Media QRC
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/media.qrc ${CMAKE_CURRENT_BINARY_DIR}/media.qrc COPYONLY)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
qt5_add_resources(MEDIAQRC ${CMAKE_CURRENT_BINARY_DIR}/media.qrc)
|
||||
qt_add_resources(MEDIAQRC ${CMAKE_CURRENT_BINARY_DIR}/media.qrc)
|
||||
add_custom_target(mediaresource ALL DEPENDS ${MEDIAQRC})
|
||||
|
||||
#Scenes QRC
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scenes.qrc ${CMAKE_CURRENT_BINARY_DIR}/scenes.qrc COPYONLY)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/scenes DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
qt5_add_resources(SCENESQRC ${CMAKE_CURRENT_BINARY_DIR}/scenes.qrc)
|
||||
qt_add_resources(SCENESQRC ${CMAKE_CURRENT_BINARY_DIR}/scenes.qrc)
|
||||
add_custom_target(scenessource ALL DEPENDS ${SCENESQRC})
|
||||
|
||||
set(SOURCES "")
|
||||
|
@ -163,7 +166,9 @@ else()
|
|||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(checks-parser PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(checks-parser PRIVATE Qt6::Widgets)
|
||||
|
||||
target_include_directories(checks-parser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/widgets)
|
||||
|
||||
if (BUILD_OFD_LOCAL_QR_SCAN)
|
||||
target_include_directories(checks-parser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/image_redactor)
|
||||
|
@ -219,6 +224,11 @@ if (BUILD_OFD_LOCAL_QR_SCAN OR BUILD_OFD_BINARYEYE_SCAN)
|
|||
include_directories( ${OpenCV_INCLUDE_DIRS} )
|
||||
endif()
|
||||
|
||||
# if (BUILD_EMAIL_MODE)
|
||||
# find_package(vmime REQUIRED)
|
||||
# target_link_libraries(checks-parser PRIVATE vmime)
|
||||
# endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
|
||||
target_link_libraries(checks-parser PRIVATE -lstdc++fs)
|
||||
endif()
|
||||
|
|
|
@ -24,3 +24,7 @@ double Check::calculae_total_price() {
|
|||
std::vector<Goods>& Check::get_goods() {
|
||||
return goods;
|
||||
}
|
||||
|
||||
std::string Check::get_date() {
|
||||
return date;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
#include "utils/utils.h"
|
||||
#include <email_parser/emailparser.h>
|
||||
|
||||
#include <utils/base64.h>
|
||||
#include <utils/utils.h>
|
||||
#include <check/check.h>
|
||||
#include <boost/regex.hpp>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <bits/stdc++.h>
|
||||
#include <fstream>
|
||||
#if __GNUC__ < 8 && __clang_major__ < 17
|
||||
# include <experimental/filesystem>
|
||||
|
@ -14,7 +17,7 @@
|
|||
#endif
|
||||
|
||||
std::string EmailParser::get_payload_in_email(std::string &email_content) {
|
||||
boost::regex content_type_and_transfer_encoding_regex("Content-Type")
|
||||
boost::regex content_type_and_transfer_encoding_regex("Content-Type");
|
||||
// boost::regex body_start_regex("\r\n\r\n"); //boost::regex_constants::egrep
|
||||
// boost::smatch smatch;
|
||||
// if (boost::regex_search(email_content, smatch, body_start_regex)) {
|
||||
|
@ -23,6 +26,40 @@ std::string EmailParser::get_payload_in_email(std::string &email_content) {
|
|||
// return "";
|
||||
}
|
||||
|
||||
std::multimap<std::string, std::string> EmailParser::parse_email_content_types(std::string path) {
|
||||
std::ifstream input_file(path, std::ios::in);
|
||||
|
||||
std::string line = "";
|
||||
std::multimap<std::string, std::string> mail_options;
|
||||
std::string latest_key;
|
||||
while(std::getline(input_file, line)) {
|
||||
// ;
|
||||
|
||||
char first_char = line.substr(0, 1)[0];
|
||||
// if (line == "\0") {
|
||||
// break;
|
||||
// }
|
||||
|
||||
std::vector<std::string> split_by_colon = split(line, ":");
|
||||
std::string key = split_by_colon[0];
|
||||
std::string value = "";
|
||||
|
||||
for (int i = 1; i < split_by_colon.size(); i ++) value += split_by_colon[i];
|
||||
if (key != "Content-Type" ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first_char == '\t') {
|
||||
mail_options.emplace(std::make_pair(latest_key, line));
|
||||
} else {
|
||||
// std::cout << "key: " << key << "\nvalue: " << value << std::endl;
|
||||
mail_options.emplace(std::make_pair(key, value));
|
||||
latest_key = key;
|
||||
}
|
||||
}
|
||||
return mail_options;
|
||||
}
|
||||
|
||||
// std::vector<int> EmailParser::find_base64_blocks_in_email(std::string &email_content) {
|
||||
// std::string glued_together;
|
||||
// for (auto c : email_content) {
|
||||
|
@ -38,6 +75,18 @@ EmailParser::EmailParser() {
|
|||
|
||||
}
|
||||
|
||||
std::vector<int> search_content_types_in_email_content(std::string& email_content) {
|
||||
std::vector<int> content_type_positions = {};
|
||||
boost::regex image_content_type_regex("Content-Type: image/.*");
|
||||
for (boost::sregex_iterator it{email_content.begin(), email_content.end(), image_content_type_regex}, end{};
|
||||
it != end; it++) {
|
||||
content_type_positions.push_back(it->position());
|
||||
}
|
||||
return content_type_positions;
|
||||
}
|
||||
|
||||
// void find_and_decode_email_content()
|
||||
|
||||
Check EmailParser::parse(std::string &email_content) {
|
||||
//1. Search "Content-Type: image/.*" in the .eml file.
|
||||
// 1.1 If found 0, go to [2]
|
||||
|
@ -46,7 +95,15 @@ Check EmailParser::parse(std::string &email_content) {
|
|||
//2. Try decoding content of the e-mail
|
||||
//3. Search "t=\d{8}T\d{4,6}&s=\d{1,6}\.\d{1,2}&fn=\d{10,16}&i=\d{6}&fp=\d{10}&n=\d". Note that in some emails = and & signs could be replaced with its code in HTTP requests: %3D, %26
|
||||
// 3.1 If not found, notify the user that we could not parse the .eml file
|
||||
std::vector<int> content_type_positions = search_content_types_in_email_content(email_content);
|
||||
|
||||
if (content_type_positions.size() < 0) {
|
||||
|
||||
} else if (content_type_positions.size() == 1) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
// std::string payload = get_payload_in_email(email_content);
|
||||
// Check c;
|
||||
|
@ -62,9 +119,62 @@ Check EmailParser::parse(std::string &email_content) {
|
|||
}
|
||||
|
||||
Check EmailParser::parse_file(std::string path) {
|
||||
std::ifstream ifile(path, std::ios::in | std::ios::binary);
|
||||
const unsigned int size = std::filesystem::file_size(path);
|
||||
std::string content(size, '\0');
|
||||
ifile.read(content.data(), size);
|
||||
return parse(content);
|
||||
|
||||
// std::vector<std::string> contents = read_file(path);
|
||||
// unsigned int body_start = -1;
|
||||
// for (unsigned int i = 0; i < contents.size(); i ++) {
|
||||
// std::string &line = contents[i];
|
||||
// if (line == "\r") {
|
||||
// body_start = i;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (body_start == (unsigned int) -1) throw "Not an E-Mail";
|
||||
|
||||
// for (unsigned int i = 0; i < contents.size(); i ++) {
|
||||
// std::string &line = contents[i];
|
||||
// if (line[0] == '\t') {
|
||||
// contents[i - 1] += " " + contents[i];
|
||||
// contents.erase(remove(contents.begin(), contents.end(), line), contents.end());
|
||||
// i -= 2;
|
||||
// }
|
||||
// }
|
||||
|
||||
// for (auto &line : contents) {
|
||||
// std::cout << line << std::endl;
|
||||
// }
|
||||
|
||||
// std::cout << contents[body_start + 1] << std::endl;
|
||||
// unsigned int body_start = contents.find("\r\n\r\n");
|
||||
// if (body_start == (unsigned int)-1)
|
||||
// throw "Not a E-Mail file";
|
||||
// std::cout << contents.erase(0, body_start + 4);
|
||||
// std::cout << contents << std::endl;
|
||||
|
||||
// std::vector<std::tuple<int, int>> message_parts_positions;
|
||||
|
||||
// while (contents.find("--") > 0) {
|
||||
|
||||
// }
|
||||
|
||||
return Check();
|
||||
|
||||
std::multimap<std::string, std::string> content_types = parse_email_content_types(path);
|
||||
bool found_qr_image = false;
|
||||
for (auto &content_type : content_types) {
|
||||
boost::regex image_content_type_regex("image\\/(png|gif|jpg|jpeg)");
|
||||
boost::cmatch cmatch;
|
||||
if (boost::regex_match(content_type.second.c_str(), cmatch, image_content_type_regex)) {
|
||||
std::cout << cmatch << std::endl;
|
||||
|
||||
}
|
||||
std::cout << content_type.first << ": " << content_type.second << std::endl;
|
||||
}
|
||||
|
||||
// std::ifstream ifile(path, std::ios::in | std::ios::binary);
|
||||
// const unsigned int size = std::filesystem::file_size(path);
|
||||
// std::string content(size, '\0');
|
||||
// ifile.read(content.data(), size);
|
||||
// return parse(content);
|
||||
return Check();
|
||||
}
|
||||
|
|
|
@ -2,14 +2,18 @@
|
|||
#define CHECKS_PARSER_EMAIL_PARSER
|
||||
|
||||
#include <check/check.h>
|
||||
#include <map>
|
||||
|
||||
class EmailParser {
|
||||
std::string get_payload_in_email(std::string &email_content);
|
||||
std::multimap<std::string, std::string> parse_email_content_types(std::string path);
|
||||
|
||||
// std::vector<int> find_base64_blocks_in_email(std::string &email_content);
|
||||
public:
|
||||
EmailParser();
|
||||
Check parse(std::string &email_content);
|
||||
Check parse_file(std::string path);
|
||||
|
||||
};
|
||||
|
||||
#endif // CHECKS_PARSER_EMAIL_PARSER
|
||||
|
|
14
main.cpp
14
main.cpp
|
@ -24,16 +24,13 @@
|
|||
#endif
|
||||
#include <settingsdialog.h>
|
||||
#ifdef BUILD_EMAIL_MODE
|
||||
//placeholder
|
||||
// #include <vmime/vmime.hpp>
|
||||
#endif
|
||||
#include <QPushButton>
|
||||
|
||||
#include <utils/base64.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// EmailParser ep;
|
||||
// ep.parse_file("/home/leca/example_email_receipts/rzd.eml");
|
||||
// return 0;
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser");
|
||||
|
@ -72,14 +69,5 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
w.show();
|
||||
|
||||
// TODO: move to the window
|
||||
//Settings button setup
|
||||
// QPushButton *settingsButton = w.findChild<QPushButton *>("settings_button");
|
||||
// QObject::connect(settingsButton, &QPushButton::clicked, [&]() {
|
||||
// SettingsDialog d;
|
||||
// d.show();
|
||||
// d.exec();
|
||||
// });
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <net/net.h>
|
||||
#include <utils/utils.h>
|
||||
#include <exceptions/ofdrequestexception.h>
|
||||
#include <checklistviewwidget.h>
|
||||
|
||||
#ifdef BUILD_OFD_BINARYEYE_SCAN
|
||||
# include <qrencode.h>
|
||||
|
@ -31,6 +32,13 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
ui->setupUi(this);
|
||||
ui->stop_server_button->hide();
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
ui->scrollAreaWidgetContents->setLayout(layout);
|
||||
QLabel a = QLabel("123");
|
||||
layout->addWidget(&a);
|
||||
// ui->checks_to_parse_label->hide();
|
||||
// ui->checks_scroll_area->hide();
|
||||
|
||||
#ifdef BUILD_OFD_BINARYEYE_SCAN
|
||||
QObject::connect(this, &MainWindow::httpErrorOccured, this, &MainWindow::notifyHttpServerFailure);
|
||||
connect(this, SIGNAL(httpNewMessage(QString)), this, SLOT(httpNewMessageHandler(QString)));
|
||||
|
@ -170,19 +178,65 @@ void MainWindow::onDataDecode(std::map<std::string, std::string> data) {
|
|||
ui->total_spin_box->setValue(std::stod(total));
|
||||
}
|
||||
|
||||
#ifdef BUILD_EMAIL_MODE
|
||||
|
||||
void MainWindow::on_parse_email_button_clicked() {
|
||||
QMessageBox infoDialog;
|
||||
infoDialog.setText(tr("This feature is under development. Wait it to appear in next updates."));
|
||||
infoDialog.setIcon(QMessageBox::Warning);
|
||||
infoDialog.setWindowTitle(tr("Under development"));
|
||||
infoDialog.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#endif // ifdef BUILD_EMAIL_MODE
|
||||
|
||||
void MainWindow::on_parse_button_clicked() {
|
||||
// if (checks.empty()) {
|
||||
// QMessageBox infoDialog;
|
||||
// infoDialog.setText(tr("Please, add check(s) to parse"));
|
||||
// infoDialog.setIcon(QMessageBox::Warning);
|
||||
// infoDialog.setWindowTitle(tr("No checks to parse"));
|
||||
// infoDialog.exec();
|
||||
// return;
|
||||
// }
|
||||
|
||||
OutputDialog d = OutputDialog(this, &checks);
|
||||
d.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_add_new_check_button_clicked() {
|
||||
Check *new_check = parse_new_check();
|
||||
if (new_check == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
checks.push_back(*new_check);
|
||||
|
||||
CheckListViewWidget check_list_widget(this, *new_check);
|
||||
|
||||
auto a = QLabel("123");
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(&a);
|
||||
|
||||
delete new_check;
|
||||
|
||||
if (checks.size() == 1) {
|
||||
ui->checks_scroll_area->show();
|
||||
ui->checks_to_parse_label->show();
|
||||
}
|
||||
}
|
||||
|
||||
Check *MainWindow::parse_new_check() {
|
||||
Net net;
|
||||
net.get_captcha_from_ofdru();
|
||||
|
||||
std::string solved_captcha = "";
|
||||
bool success = true;
|
||||
bool is_captcha_solved = true;
|
||||
Check check;
|
||||
|
||||
do {
|
||||
for (unsigned short i = 0; i < 5; i ++) {
|
||||
// Will be repaced with neural network to solve captchas as soon as I train it.
|
||||
net.get_captcha_from_ofdru();
|
||||
SolveCaptchaDialog dialog = SolveCaptchaDialog(this, &solved_captcha);
|
||||
dialog.exec();
|
||||
is_captcha_solved = true;
|
||||
Check* check = new Check();
|
||||
|
||||
try {
|
||||
std::string check_content = net.fetch_check_data_from_ofdru(
|
||||
|
@ -195,44 +249,36 @@ void MainWindow::on_parse_button_clicked() {
|
|||
ui->total_spin_box->text().toDouble() * 100,
|
||||
solved_captcha);
|
||||
|
||||
check = parseOfdRuAnswer(check_content);
|
||||
(*check) = parseOfdRuAnswer(check_content);
|
||||
return check;
|
||||
} catch(OfdRequestException e) {
|
||||
success = false;
|
||||
if (!strcmp(e.what(), "Incorrect captcha")) {
|
||||
is_captcha_solved = false;
|
||||
QMessageBox infoDialog;
|
||||
infoDialog.setText(tr("Captcha was not solved correctly!"));
|
||||
infoDialog.setIcon(QMessageBox::Critical);
|
||||
infoDialog.setWindowTitle(tr("Captcha is incorrect"));
|
||||
infoDialog.exec();
|
||||
break;
|
||||
continue;
|
||||
} else if (!strcmp(e.what(), "Internal server error")) {
|
||||
QMessageBox infoDialog;
|
||||
infoDialog.setText(tr("Internal server error. Please, try again later."));
|
||||
infoDialog.setIcon(QMessageBox::Critical);
|
||||
infoDialog.setWindowTitle(tr("Internal server error"));
|
||||
infoDialog.exec();
|
||||
return;
|
||||
return nullptr;
|
||||
} else if (!strcmp(e.what(), "Does not exist")) {
|
||||
QMessageBox infoDialog;
|
||||
infoDialog.setText(tr("Check not found. Please, ensure correctness of entered data."));
|
||||
infoDialog.setIcon(QMessageBox::Critical);
|
||||
infoDialog.setWindowTitle(tr("Check was not found"));
|
||||
infoDialog.exec();
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
} while (!is_captcha_solved);
|
||||
|
||||
if (success) {
|
||||
OutputDialog *d = new OutputDialog(this, check);
|
||||
d->exec();
|
||||
|
||||
delete d;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
delete ui;
|
||||
}
|
||||
|
|
10
mainwindow.h
10
mainwindow.h
|
@ -7,6 +7,8 @@
|
|||
|
||||
#include <http_server/http_server.h>
|
||||
|
||||
#include <check/check.h>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
@ -18,6 +20,8 @@ class MainWindow : public QWidget
|
|||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
Check *parse_new_check();
|
||||
#ifdef BUILD_OFD_BINARYEYE_SCAN
|
||||
void startHttpServer();
|
||||
#endif
|
||||
|
@ -42,8 +46,14 @@ private slots:
|
|||
|
||||
void httpNewMessageHandler(QString message);
|
||||
#endif
|
||||
#ifdef BUILD_EMAIL_MODE
|
||||
void on_parse_email_button_clicked();
|
||||
#endif
|
||||
void on_add_new_check_button_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
std::vector<Check> checks;
|
||||
#ifdef BUILD_OFD_BINARYEYE_SCAN
|
||||
std::thread *httpServerThread;
|
||||
HttpServer *server = NULL;
|
||||
|
|
|
@ -50,10 +50,5 @@ bool OutputOptions::get_print_header() { return this->print_header; }
|
|||
void OutputOptions::set_print_total(bool value) { this->print_total = value; }
|
||||
bool OutputOptions::get_print_total() { return this->print_total; }
|
||||
|
||||
OutputFormat OutputOptions::get_output_format() { return this->format; }
|
||||
void OutputOptions::set_output_format(OutputFormat format) {
|
||||
this->format = format;
|
||||
}
|
||||
|
||||
void OutputOptions::set_path(std::string path) { this->path = path; }
|
||||
std::string &OutputOptions::get_path() { return this->path; }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#if __GNUC__ < 8
|
||||
#if __GNUC__ <= 8 && __clang_major__ < 17
|
||||
# include <experimental/filesystem>
|
||||
#else
|
||||
# include <filesystem>
|
||||
|
@ -15,6 +15,7 @@
|
|||
#include "../settings/settings.h"
|
||||
|
||||
enum class ColumnType {
|
||||
date,
|
||||
goods_name,
|
||||
goods_price_per_unit,
|
||||
goods_quantity,
|
||||
|
@ -28,14 +29,12 @@ struct Column { // Example:
|
|||
unsigned int position; // "0" <-- 0 = "A", 1 = "B", etc.. column letter in
|
||||
// table processor (i.e. excel or libreoffice)
|
||||
} typedef Column;
|
||||
enum class OutputFormat { csv, ods, xlsx, plaintext } typedef OutputFormat;
|
||||
|
||||
class OutputOptions {
|
||||
|
||||
std::vector<Column> order;
|
||||
bool print_header;
|
||||
bool print_total;
|
||||
OutputFormat format;
|
||||
std::string path;
|
||||
|
||||
public:
|
||||
|
@ -56,9 +55,6 @@ public:
|
|||
void set_print_total(bool);
|
||||
bool get_print_total();
|
||||
|
||||
void set_output_format(OutputFormat);
|
||||
OutputFormat get_output_format();
|
||||
|
||||
void set_path(std::string);
|
||||
std::string &get_path();
|
||||
};
|
||||
|
|
|
@ -8,28 +8,30 @@
|
|||
#include "settings/settings.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
OutputDialog::OutputDialog(QWidget *parent, Check &check)
|
||||
: QDialog(parent), ui(new Ui::OutputDialog), check(check),
|
||||
OutputDialog::OutputDialog(QWidget *parent, std::vector<Check> *checks)
|
||||
: QDialog(parent), ui(new Ui::OutputDialog), checks(checks),
|
||||
options(OutputOptions()) {
|
||||
|
||||
Settings settings(get_path_relative_to_home(".local/share/checks_parser/settings.json"));
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tableWidget->item(0, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_name"]["name"]));
|
||||
ui->tableWidget->item(0, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_name"]["position"]));
|
||||
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(1, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_price_per_unit"]["name"]));
|
||||
ui->tableWidget->item(1, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_price_per_unit"]["position"]));
|
||||
ui->tableWidget->item(1, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_name"]["name"]));
|
||||
ui->tableWidget->item(1, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_name"]["position"]));
|
||||
|
||||
ui->tableWidget->item(2, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_quantity"]["name"]));
|
||||
ui->tableWidget->item(2, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_quantity"]["position"]));
|
||||
ui->tableWidget->item(2, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_price_per_unit"]["name"]));
|
||||
ui->tableWidget->item(2, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_price_per_unit"]["position"]));
|
||||
|
||||
ui->tableWidget->item(3, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_net_weight"]["name"]));
|
||||
ui->tableWidget->item(3, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_net_weight"]["position"]));
|
||||
ui->tableWidget->item(3, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_quantity"]["name"]));
|
||||
ui->tableWidget->item(3, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_quantity"]["position"]));
|
||||
|
||||
ui->tableWidget->item(4, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_total"]["name"]));
|
||||
ui->tableWidget->item(4, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_total"]["position"]));
|
||||
ui->tableWidget->item(4, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_net_weight"]["name"]));
|
||||
ui->tableWidget->item(4, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_net_weight"]["position"]));
|
||||
|
||||
ui->tableWidget->item(5, 1)->setText(QString::fromStdString(settings.get_all_settings()["output_order"]["goods_total"]["name"]));
|
||||
ui->tableWidget->item(5, 0)->setText(QString::number((int)settings.get_all_settings()["output_order"]["goods_total"]["position"]));
|
||||
|
||||
|
||||
ui->printHeaderCheckBox->setChecked(settings.get_all_settings()["print_header"]);
|
||||
|
@ -61,6 +63,7 @@ void OutputDialog::on_buttonBox_accepted() {
|
|||
this->options.get_columns().end(), compare_position);
|
||||
|
||||
if (options.get_print_header()) {
|
||||
// output_file << "date,"
|
||||
for (auto &column : this->options.get_columns()) {
|
||||
output_file << column.name
|
||||
<< (column.position == this->options.get_columns().size()
|
||||
|
@ -69,39 +72,44 @@ void OutputDialog::on_buttonBox_accepted() {
|
|||
}
|
||||
output_file << std::endl;
|
||||
}
|
||||
for (Check &check : *checks) {
|
||||
int i = 0;
|
||||
// auto &goods : check.get_goods()
|
||||
for (auto it = check.get_goods().begin(); it != check.get_goods().end(); i++, it++) {
|
||||
for (auto &column : this->options.get_columns()) {
|
||||
switch (column.type) {
|
||||
case ColumnType::date:
|
||||
if (i == 0) output_file << "date goes here";
|
||||
break;
|
||||
case ColumnType::goods_name:
|
||||
output_file << it->get_name();
|
||||
break;
|
||||
case ColumnType::goods_price_per_unit:
|
||||
output_file << std::fixed << std::setprecision(2) << it->get_price_per_unit();
|
||||
break;
|
||||
case ColumnType::goods_quantity:
|
||||
output_file << std::fixed << std::setprecision(2) << it->get_quantity();
|
||||
break;
|
||||
case ColumnType::goods_net_weight:
|
||||
output_file << it->get_net_weight();
|
||||
break;
|
||||
case ColumnType::goods_total:
|
||||
output_file << std::fixed << std::setprecision(2) << it->calculate_total_price();
|
||||
break;
|
||||
}
|
||||
|
||||
for (auto goods : this->check.get_goods()) {
|
||||
for (auto &column : this->options.get_columns()) {
|
||||
switch (column.type) {
|
||||
case ColumnType::goods_name:
|
||||
output_file << goods.get_name();
|
||||
break;
|
||||
case ColumnType::goods_price_per_unit:
|
||||
output_file << std::fixed << std::setprecision(2) << goods.get_price_per_unit();
|
||||
break;
|
||||
case ColumnType::goods_quantity:
|
||||
output_file << std::fixed << std::setprecision(2) << goods.get_quantity();
|
||||
break;
|
||||
case ColumnType::goods_net_weight:
|
||||
output_file << goods.get_net_weight();
|
||||
break;
|
||||
case ColumnType::goods_total:
|
||||
output_file << std::fixed << std::setprecision(2) << goods.calculate_total_price();
|
||||
break;
|
||||
}
|
||||
|
||||
if (column.position != this->options.get_columns().size()) {
|
||||
output_file << ",";
|
||||
} else {
|
||||
output_file << "\n";
|
||||
if (column.position != this->options.get_columns().size()) {
|
||||
output_file << ",";
|
||||
} else {
|
||||
output_file << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->options.get_print_total()) {
|
||||
output_file << "Total: " << std::fixed << std::setprecision(2) << check.calculae_total_price() << std::endl;
|
||||
if (this->options.get_print_total()) {
|
||||
output_file << "Total: " << std::fixed << std::setprecision(2) << check.calculae_total_price() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
output_file.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ class OutputDialog : public QDialog {
|
|||
Q_OBJECT
|
||||
|
||||
OutputOptions options;
|
||||
Check ✓
|
||||
std::vector<Check> *checks;
|
||||
|
||||
public:
|
||||
explicit OutputDialog(QWidget *parent = nullptr, Check & = *(new Check()));
|
||||
explicit OutputDialog(QWidget *parent = nullptr, std::vector<Check> *checks = nullptr);
|
||||
~OutputDialog();
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1039</width>
|
||||
<height>426</height>
|
||||
<width>1269</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -39,29 +39,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="5">
|
||||
<widget class="QPushButton" name="parse_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="add_new_check_button">
|
||||
<property name="text">
|
||||
<string>Parse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="fd_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FD (Fiscal Document)</string>
|
||||
<string>Add new check</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -78,15 +59,24 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="operation_type_label">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="fd_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Operation type</string>
|
||||
<string>FD (Fiscal Document)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="binary_eye_button">
|
||||
<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>
|
||||
|
@ -94,27 +84,7 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use your phone as a QR code scanner</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QLabel" name="info_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<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>
|
||||
<string>Choose image on your PC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -131,16 +101,23 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="choose_image_button">
|
||||
<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="MinimumExpanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Choose image on your PC</string>
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -151,23 +128,36 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="fi_label">
|
||||
<property name="text">
|
||||
<string>FI (Fiscal Identifier)</string>
|
||||
<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="1" column="2">
|
||||
<widget class="QPushButton" name="parse_email_button">
|
||||
<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="MinimumExpanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parse an E-Mail</string>
|
||||
<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>
|
||||
|
@ -184,24 +174,74 @@
|
|||
</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>
|
||||
<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="5" column="2" colspan="3">
|
||||
<widget class="QLineEdit" name="fi_line_edit"/>
|
||||
<item row="8" column="2" colspan="3">
|
||||
<widget class="QDoubleSpinBox" name="total_spin_box">
|
||||
<property name="maximum">
|
||||
<double>4294967296.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="3">
|
||||
<widget class="QDateTimeEdit" name="purchase_datetime_edit"/>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="binary_eye_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use your phone as a QR code scanner</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="4">
|
||||
<widget class="QPushButton" name="parse_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="parse_email_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parse an E-Mail</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QLabel" name="info_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="3">
|
||||
<widget class="QComboBox" name="operation_type_combo_box">
|
||||
|
@ -227,23 +267,36 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2" colspan="3">
|
||||
<widget class="QDoubleSpinBox" name="total_spin_box">
|
||||
<property name="maximum">
|
||||
<double>4294967296.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="settings_button">
|
||||
<item row="1" column="5" rowspan="9">
|
||||
<widget class="QScrollArea" name="checks_scroll_area">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>273</width>
|
||||
<height>404</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="checks_to_parse_label">
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
<string>Checks to parse</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -14,10 +14,13 @@
|
|||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
<property name="text">
|
||||
<string>Path to export: </string>
|
||||
<item row="4" column="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -42,6 +45,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="pathLabel">
|
||||
<property name="text">
|
||||
<string>Path to export: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<property name="sizePolicy">
|
||||
|
@ -50,6 +60,47 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragDropMode::InternalMove</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::DropAction::MoveAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
</property>
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::PenStyle::SolidLine</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Date</string>
|
||||
</property>
|
||||
</row>
|
||||
<row>
|
||||
<property name="text">
|
||||
<string>Goods name</string>
|
||||
|
@ -92,7 +143,7 @@
|
|||
</item>
|
||||
<item row="0" column="1">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
<string>Date</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
@ -102,7 +153,7 @@
|
|||
</item>
|
||||
<item row="1" column="1">
|
||||
<property name="text">
|
||||
<string>Price</string>
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
|
@ -112,7 +163,7 @@
|
|||
</item>
|
||||
<item row="2" column="1">
|
||||
<property name="text">
|
||||
<string>Quantity</string>
|
||||
<string>Price</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
|
@ -122,7 +173,7 @@
|
|||
</item>
|
||||
<item row="3" column="1">
|
||||
<property name="text">
|
||||
<string>Net weight</string>
|
||||
<string>Quantity</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
|
@ -131,22 +182,22 @@
|
|||
</property>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<property name="text">
|
||||
<string>Net weight</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<property name="text">
|
||||
<string>6</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<property name="text">
|
||||
<string>Total price</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
@ -24,108 +24,14 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>673</width>
|
||||
<height>554</height>
|
||||
<width>659</width>
|
||||
<height>634</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Goods quantity alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="goodsTotalPositionSpin"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="goodsNameAliasEdit"/>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Goods net weight alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Goods price per unit alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="goodsQuantityAliasEdit"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Print total</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Goods name alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="goodsPricePerUnitAliasEdit"/>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="goodsTotalAliasEdit"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="goodsQuantityPositionSpin"/>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Goods total alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Print header</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="goodsNetWeightAliasEdit"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Goods total position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="goodsNetWeightPositionSpin"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Goods net weight position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QComboBox" name="languageComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -139,46 +45,160 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Goods quantity alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="goodsQuantityAliasEdit"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="goodsPricePerUnitPositionSpin"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="goodsNamePositionSpin"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="goodsNetWeightPositionSpin"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Goods price per unit alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QLineEdit" name="goodsTotalAliasEdit"/>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Print header</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Goods quantity position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="goodsNamePositionSpin"/>
|
||||
<item row="10" column="1">
|
||||
<widget class="QSpinBox" name="goodsTotalPositionSpin"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Goods net weight position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="dateNamePositionSpin"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="goodsPricePerUnitAliasEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Goods name position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="printHeaderCheckBox">
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Print total</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Date name position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Goods price per unit position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="printTotalCheckBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="goodsPricePerUnitPositionSpin"/>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Goods total position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="goodsQuantityPositionSpin"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Goods name alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="goodsNetWeightAliasEdit"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Goods total alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="goodsNameAliasEdit"/>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="printHeaderCheckBox">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Goods net weight alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Date name alias</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="dateNameAliasEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include <fstream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
#include "../utils/utils.h"
|
||||
|
||||
#if __GNUC__ <= 8 && __clang_major__ < 17
|
||||
# include <experimental/filesystem>
|
||||
|
@ -23,24 +22,28 @@ Settings::Settings(std::string path) {
|
|||
"print_header": true,
|
||||
"print_total": true,
|
||||
"output_order": {
|
||||
"goods_name": {
|
||||
"date" : {
|
||||
"position":1,
|
||||
"name": "Date"
|
||||
},
|
||||
"goods_name": {
|
||||
"position":2,
|
||||
"name":"Goods name"
|
||||
},
|
||||
"goods_price_per_unit": {
|
||||
"position":2,
|
||||
"position":3,
|
||||
"name":"Goods price per unit"
|
||||
},
|
||||
"goods_quantity": {
|
||||
"position":3,
|
||||
"position":4,
|
||||
"name":"Goods quantity"
|
||||
},
|
||||
"goods_net_weight": {
|
||||
"position":4,
|
||||
"position":5,
|
||||
"name":"Goods net weight"
|
||||
},
|
||||
"goods_total": {
|
||||
"position":5,
|
||||
"position":6,
|
||||
"name":"Goods total"
|
||||
}
|
||||
}
|
||||
|
@ -56,9 +59,6 @@ Settings::Settings(std::string path) {
|
|||
nlohmann::json settings = nlohmann::json::parse(input);
|
||||
this->settings = settings;
|
||||
}
|
||||
|
||||
create_directories(get_path_relative_to_home(this->settings["ofds_modules_dir"]));
|
||||
create_directories(get_path_relative_to_home(this->settings["stores_modules_dir"]));
|
||||
}
|
||||
|
||||
void Settings::write_setting(std::string setting, std::string value) {
|
||||
|
|
|
@ -138,3 +138,4 @@ void SettingsDialog::on_languageComboBox_currentTextChanged(const QString &chang
|
|||
|
||||
|
||||
SettingsDialog::~SettingsDialog() { delete ui; }
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<translation type="vanished">Store type</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="51"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="216"/>
|
||||
<source>Parse</source>
|
||||
<translation>Parse</translation>
|
||||
</message>
|
||||
|
@ -113,13 +113,13 @@
|
|||
<translation type="vanished">0000000000000000</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="77"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="58"/>
|
||||
<source>FN (Fiscal Number)</source>
|
||||
<translatorcomment>FN = Фискальный Номер</translatorcomment>
|
||||
<translation>FN (Fiscal Number)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="64"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="71"/>
|
||||
<source>FD (Fiscal Document)</source>
|
||||
<translatorcomment>FD = Фискальный Документ</translatorcomment>
|
||||
<translation>FD (Fiscal Document)</translation>
|
||||
|
@ -133,78 +133,93 @@
|
|||
<translation type="obsolete">Back</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="130"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="100"/>
|
||||
<source>Stop server</source>
|
||||
<translation>Stop server</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="143"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="87"/>
|
||||
<source>Choose image on your PC</source>
|
||||
<translation>Choose image on your PC</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="38"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="183"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="173"/>
|
||||
<source>or</source>
|
||||
<translation>or</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="97"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="203"/>
|
||||
<source>Use your phone as a QR code scanner</source>
|
||||
<translation>Use your phone as a QR code scanner</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="157"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="107"/>
|
||||
<source>FI (Fiscal Identifier)</source>
|
||||
<translatorcomment>FI = Фискальный Признак</translatorcomment>
|
||||
<translation>FI (Fiscal Identifier)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="117"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="45"/>
|
||||
<source>Add new check</source>
|
||||
<translation>Add new check</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="153"/>
|
||||
<source>Clear</source>
|
||||
<translation>Clear</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="160"/>
|
||||
<source>Date and time of purchase</source>
|
||||
<translation>Date and time of purchase</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="84"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="180"/>
|
||||
<source>Operation type</source>
|
||||
<translation>Operation type</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="170"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="229"/>
|
||||
<source>Parse an E-Mail</source>
|
||||
<translation>Parse an E-Mail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="210"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="250"/>
|
||||
<source>Funds income</source>
|
||||
<translatorcomment>Приход средств</translatorcomment>
|
||||
<translation>Funds income</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="215"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="255"/>
|
||||
<source>Funds return</source>
|
||||
<translatorcomment>Возврат средств</translatorcomment>
|
||||
<translation>Funds return</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="220"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="260"/>
|
||||
<source>Funds spend</source>
|
||||
<translatorcomment>Расход средств</translatorcomment>
|
||||
<translation>Funds spend</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="225"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="265"/>
|
||||
<source>Spends return</source>
|
||||
<translatorcomment>Возврат расхода</translatorcomment>
|
||||
<translation>Spends return</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="246"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="296"/>
|
||||
<source>Checks to parse</source>
|
||||
<translation>Checks to parse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="120"/>
|
||||
<source>Settings</source>
|
||||
<translation>Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="150"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="127"/>
|
||||
<source>Total</source>
|
||||
<translation>Total</translation>
|
||||
</message>
|
||||
|
@ -213,57 +228,75 @@
|
|||
<translation type="vanished">checks parser</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="91"/>
|
||||
<location filename="../mainwindow.cpp" line="99"/>
|
||||
<source>QR code for binaryeye to connect</source>
|
||||
<translation>QR code for binaryeye to connect</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="92"/>
|
||||
<location filename="../mainwindow.cpp" line="100"/>
|
||||
<source>I've scanned</source>
|
||||
<translation>I've scanned</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="98"/>
|
||||
<location filename="../mainwindow.cpp" line="106"/>
|
||||
<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'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't lucky, please, contact the developer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="100"/>
|
||||
<location filename="../mainwindow.cpp" line="108"/>
|
||||
<source>Could not start http server.</source>
|
||||
<translation>Could not start http server.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="144"/>
|
||||
<location filename="../mainwindow.cpp" line="152"/>
|
||||
<source>Selected image: </source>
|
||||
<translation>Selected image: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="204"/>
|
||||
<location filename="../mainwindow.cpp" line="185"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="187"/>
|
||||
<source>Under development</source>
|
||||
<translation>Under development</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please, add check(s) to parse</source>
|
||||
<translation type="vanished">Please, add check(s) to parse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No checks to parse</source>
|
||||
<translation type="vanished">No checks to parse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="257"/>
|
||||
<source>Captcha was not solved correctly!</source>
|
||||
<translation>Captcha was not solved correctly!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="206"/>
|
||||
<location filename="../mainwindow.cpp" line="259"/>
|
||||
<source>Captcha is incorrect</source>
|
||||
<translation>Captcha is incorrect</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="211"/>
|
||||
<location filename="../mainwindow.cpp" line="264"/>
|
||||
<source>Internal server error. Please, try again later.</source>
|
||||
<translation>Internal server error. Please, try again later.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="213"/>
|
||||
<location filename="../mainwindow.cpp" line="266"/>
|
||||
<source>Internal server error</source>
|
||||
<translation>Internal server error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="218"/>
|
||||
<location filename="../mainwindow.cpp" line="271"/>
|
||||
<source>Check not found. Please, ensure correctness of entered data.</source>
|
||||
<translation>Check not found. Please, ensure correctness of entered data.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="220"/>
|
||||
<location filename="../mainwindow.cpp" line="273"/>
|
||||
<source>Check was not found</source>
|
||||
<translation>Check was not found</translation>
|
||||
</message>
|
||||
|
@ -276,12 +309,12 @@
|
|||
<translation type="vanished">Error in parsing</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="137"/>
|
||||
<location filename="../mainwindow.cpp" line="145"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="139"/>
|
||||
<location filename="../mainwindow.cpp" line="147"/>
|
||||
<source>Picture was not selected</source>
|
||||
<translation>Picture was not selected</translation>
|
||||
</message>
|
||||
|
@ -489,107 +522,118 @@
|
|||
<translation>Dialog</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="20"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="51"/>
|
||||
<source>Path to export: </source>
|
||||
<translation>Path to export: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="27"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="30"/>
|
||||
<source>Choose</source>
|
||||
<translation>Choose</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="34"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="37"/>
|
||||
<source>Print header</source>
|
||||
<translation>Print header</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="55"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="101"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="146"/>
|
||||
<source>Date</source>
|
||||
<translation>Date</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="106"/>
|
||||
<source>Goods name</source>
|
||||
<translation>Goods name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="60"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="111"/>
|
||||
<source>Goods price</source>
|
||||
<translation>Goods price</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="65"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="116"/>
|
||||
<source>Goods quantity</source>
|
||||
<translation>Goods quality</translation>
|
||||
<translation>Goods quantity</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="70"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="121"/>
|
||||
<source>Goods net weight</source>
|
||||
<translation>Goods net weight</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="75"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="126"/>
|
||||
<source>Goods total</source>
|
||||
<translation>Goods total</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="80"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="131"/>
|
||||
<source>position</source>
|
||||
<translation>position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="85"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="136"/>
|
||||
<source>name</source>
|
||||
<translation>name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="90"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="141"/>
|
||||
<source>1</source>
|
||||
<translation>1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="95"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="156"/>
|
||||
<source>Name</source>
|
||||
<translation>Name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="100"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="151"/>
|
||||
<source>2</source>
|
||||
<translation>2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="105"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="166"/>
|
||||
<source>Price</source>
|
||||
<translation>Price</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="110"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="161"/>
|
||||
<source>3</source>
|
||||
<translation>3</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="115"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="176"/>
|
||||
<source>Quantity</source>
|
||||
<translation>Quantity</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="120"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="171"/>
|
||||
<source>4</source>
|
||||
<translation>4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="125"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="186"/>
|
||||
<source>Net weight</source>
|
||||
<translation>Net Weight</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="130"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="181"/>
|
||||
<source>5</source>
|
||||
<translation>5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="135"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="191"/>
|
||||
<source>6</source>
|
||||
<translation>6</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="196"/>
|
||||
<source>Total price</source>
|
||||
<translation>Total price</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="41"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="44"/>
|
||||
<source>Print total</source>
|
||||
<translation>Print total</translation>
|
||||
</message>
|
||||
|
@ -597,7 +641,7 @@
|
|||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="66"/>
|
||||
<location filename="../main.cpp" line="63"/>
|
||||
<source>Using locale: </source>
|
||||
<translation>Using locale: </translation>
|
||||
</message>
|
||||
|
@ -641,31 +685,41 @@
|
|||
<translation>Dialog</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="155"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="110"/>
|
||||
<source>Goods name position</source>
|
||||
<translation>Goods name position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="64"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="70"/>
|
||||
<source>Goods price per unit alias</source>
|
||||
<translation>Goods price per unit alias</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="50"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="124"/>
|
||||
<source>Date name position</source>
|
||||
<translation>Date name position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="182"/>
|
||||
<source>Language</source>
|
||||
<translation>Language</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="196"/>
|
||||
<source>Date name alias</source>
|
||||
<translation>Date name alias</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TextLabel</source>
|
||||
<translation type="vanished">Language</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="132"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="38"/>
|
||||
<source>en_US</source>
|
||||
<translation>en_US</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="137"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="43"/>
|
||||
<source>ru_RU</source>
|
||||
<translation>ru_RU</translation>
|
||||
</message>
|
||||
|
@ -674,12 +728,12 @@
|
|||
<translation type="vanished">Choose</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="104"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="80"/>
|
||||
<source>Print header</source>
|
||||
<translation>Print header</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="57"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="189"/>
|
||||
<source>Goods net weight alias</source>
|
||||
<translation>Goods net weight alias</translation>
|
||||
</message>
|
||||
|
@ -688,17 +742,17 @@
|
|||
<translation type="vanished">Stores modules url</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="97"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="165"/>
|
||||
<source>Goods total alias</source>
|
||||
<translation>Goods total alias</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="81"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="155"/>
|
||||
<source>Goods name alias</source>
|
||||
<translation>Goods name alias</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="37"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="51"/>
|
||||
<source>Goods quantity alias</source>
|
||||
<translation>Goods quantity alias</translation>
|
||||
</message>
|
||||
|
@ -711,12 +765,12 @@
|
|||
<translation type="vanished">OFD modules directory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="169"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="131"/>
|
||||
<source>Goods price per unit position</source>
|
||||
<translation>Goods price per unit position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="124"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="97"/>
|
||||
<source>Goods net weight position</source>
|
||||
<translation>Goods net weight position</translation>
|
||||
</message>
|
||||
|
@ -725,17 +779,17 @@
|
|||
<translation type="vanished">OFD modules url</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="114"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="145"/>
|
||||
<source>Goods total position</source>
|
||||
<translation>Goods total position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="145"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="87"/>
|
||||
<source>Goods quantity position</source>
|
||||
<translation>Goods quantity position</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="74"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="117"/>
|
||||
<source>Print total</source>
|
||||
<translation>Print total</translation>
|
||||
</message>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<translation type="vanished">Магазин</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="51"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="216"/>
|
||||
<source>Parse</source>
|
||||
<translation>Парсить</translation>
|
||||
</message>
|
||||
|
@ -113,13 +113,13 @@
|
|||
<translation type="vanished">0000000000000000</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="77"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="58"/>
|
||||
<source>FN (Fiscal Number)</source>
|
||||
<translatorcomment>Фискальный Норма</translatorcomment>
|
||||
<translation>ФН</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="64"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="71"/>
|
||||
<source>FD (Fiscal Document)</source>
|
||||
<translatorcomment>Фискальный Документ</translatorcomment>
|
||||
<translation>ФД</translation>
|
||||
|
@ -133,74 +133,89 @@
|
|||
<translation type="obsolete">Назад</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="130"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="100"/>
|
||||
<source>Stop server</source>
|
||||
<translation>Остановить сервер</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="143"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="87"/>
|
||||
<source>Choose image on your PC</source>
|
||||
<translation>Выбрать изображение на компьютере</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="38"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="183"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="173"/>
|
||||
<source>or</source>
|
||||
<translation>или</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="97"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="203"/>
|
||||
<source>Use your phone as a QR code scanner</source>
|
||||
<translation>Использовать телефон как сканнер QR</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="157"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="107"/>
|
||||
<source>FI (Fiscal Identifier)</source>
|
||||
<translatorcomment>Фискальный Признак</translatorcomment>
|
||||
<translation>ФП</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="117"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="45"/>
|
||||
<source>Add new check</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="153"/>
|
||||
<source>Clear</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="160"/>
|
||||
<source>Date and time of purchase</source>
|
||||
<translation>Дата и время покупки</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="84"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="180"/>
|
||||
<source>Operation type</source>
|
||||
<translation>Тип операции</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="170"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="229"/>
|
||||
<source>Parse an E-Mail</source>
|
||||
<translation>Парсить E-Mail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="210"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="250"/>
|
||||
<source>Funds income</source>
|
||||
<translation>Приход средств</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="215"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="255"/>
|
||||
<source>Funds return</source>
|
||||
<translation>Возврат средств</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="220"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="260"/>
|
||||
<source>Funds spend</source>
|
||||
<translation>Расход средств</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="225"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="265"/>
|
||||
<source>Spends return</source>
|
||||
<translation>Возврат расхода</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="246"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="296"/>
|
||||
<source>Checks to parse</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="120"/>
|
||||
<source>Settings</source>
|
||||
<translation>Настройки</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/mainwindow.ui" line="150"/>
|
||||
<location filename="../scenes/mainwindow.ui" line="127"/>
|
||||
<source>Total</source>
|
||||
<translation>Итого</translation>
|
||||
</message>
|
||||
|
@ -209,57 +224,67 @@
|
|||
<translation type="vanished">Парсер чеков</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="91"/>
|
||||
<location filename="../mainwindow.cpp" line="99"/>
|
||||
<source>QR code for binaryeye to connect</source>
|
||||
<translation>QR код для подключения BinaryEye</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="92"/>
|
||||
<location filename="../mainwindow.cpp" line="100"/>
|
||||
<source>I've scanned</source>
|
||||
<translation>Просканировал</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="98"/>
|
||||
<location filename="../mainwindow.cpp" line="106"/>
|
||||
<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't lucky, please, contact the developer.</source>
|
||||
<translation>Не смог поднять HTTP сервер. 10 раз подряд случайно выбранный порт был занят. Либо Вам следует бежать за лоттерейным билетом, или в программе баг. Если лотерейный билет не был выигрышным, пожалуйста, сообщите разработчику.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="100"/>
|
||||
<location filename="../mainwindow.cpp" line="108"/>
|
||||
<source>Could not start http server.</source>
|
||||
<translation>Не получилось запустить HTTP сервер.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="144"/>
|
||||
<location filename="../mainwindow.cpp" line="152"/>
|
||||
<source>Selected image: </source>
|
||||
<translation>Выбранное изображение: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="204"/>
|
||||
<location filename="../mainwindow.cpp" line="185"/>
|
||||
<source>This feature is under development. Wait it to appear in next updates.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="187"/>
|
||||
<source>Under development</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="257"/>
|
||||
<source>Captcha was not solved correctly!</source>
|
||||
<translation>Капча была решена неверно!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="206"/>
|
||||
<location filename="../mainwindow.cpp" line="259"/>
|
||||
<source>Captcha is incorrect</source>
|
||||
<translation>Капча введена неверно</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="211"/>
|
||||
<location filename="../mainwindow.cpp" line="264"/>
|
||||
<source>Internal server error. Please, try again later.</source>
|
||||
<translation>Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="213"/>
|
||||
<location filename="../mainwindow.cpp" line="266"/>
|
||||
<source>Internal server error</source>
|
||||
<translation>Внутренняя ошибка сервера</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="218"/>
|
||||
<location filename="../mainwindow.cpp" line="271"/>
|
||||
<source>Check not found. Please, ensure correctness of entered data.</source>
|
||||
<translation>Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="220"/>
|
||||
<location filename="../mainwindow.cpp" line="273"/>
|
||||
<source>Check was not found</source>
|
||||
<translation>Чек не найден</translation>
|
||||
</message>
|
||||
|
@ -272,12 +297,12 @@
|
|||
<translation type="vanished">Ошибка в парсинге</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="137"/>
|
||||
<location filename="../mainwindow.cpp" line="145"/>
|
||||
<source>Please, select a picture where QR code that contains info about check is present</source>
|
||||
<translation>Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="139"/>
|
||||
<location filename="../mainwindow.cpp" line="147"/>
|
||||
<source>Picture was not selected</source>
|
||||
<translation>Изображение не было выбрано</translation>
|
||||
</message>
|
||||
|
@ -485,107 +510,118 @@
|
|||
<translation>Диалог</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="20"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="51"/>
|
||||
<source>Path to export: </source>
|
||||
<translation>Путь для экспорта: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="27"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="30"/>
|
||||
<source>Choose</source>
|
||||
<translation>Выбрать</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="34"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="37"/>
|
||||
<source>Print header</source>
|
||||
<translation>Печатать заголовок</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="55"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="101"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="146"/>
|
||||
<source>Date</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="106"/>
|
||||
<source>Goods name</source>
|
||||
<translation>Имя товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="60"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="111"/>
|
||||
<source>Goods price</source>
|
||||
<translation>Цена товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="65"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="116"/>
|
||||
<source>Goods quantity</source>
|
||||
<translation>Количество товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="70"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="121"/>
|
||||
<source>Goods net weight</source>
|
||||
<translation>Масса нетто товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="75"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="126"/>
|
||||
<source>Goods total</source>
|
||||
<translation>Всего за товар</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="80"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="131"/>
|
||||
<source>position</source>
|
||||
<translation>позиция</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="85"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="136"/>
|
||||
<source>name</source>
|
||||
<translation>алиас</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="90"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="141"/>
|
||||
<source>1</source>
|
||||
<translation>1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="95"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="156"/>
|
||||
<source>Name</source>
|
||||
<translation>Имя</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="100"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="151"/>
|
||||
<source>2</source>
|
||||
<translation>2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="105"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="166"/>
|
||||
<source>Price</source>
|
||||
<translation>Цена</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="110"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="161"/>
|
||||
<source>3</source>
|
||||
<translation>3</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="115"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="176"/>
|
||||
<source>Quantity</source>
|
||||
<translation>Количество</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="120"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="171"/>
|
||||
<source>4</source>
|
||||
<translation>4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="125"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="186"/>
|
||||
<source>Net weight</source>
|
||||
<translation>Масса нетто</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="130"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="181"/>
|
||||
<source>5</source>
|
||||
<translation>5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="135"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="191"/>
|
||||
<source>6</source>
|
||||
<translation type="unfinished">6</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="196"/>
|
||||
<source>Total price</source>
|
||||
<translation>Всего</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/outputdialog.ui" line="41"/>
|
||||
<location filename="../scenes/outputdialog.ui" line="44"/>
|
||||
<source>Print total</source>
|
||||
<translation>Печатать Итого</translation>
|
||||
</message>
|
||||
|
@ -593,7 +629,7 @@
|
|||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../main.cpp" line="66"/>
|
||||
<location filename="../main.cpp" line="63"/>
|
||||
<source>Using locale: </source>
|
||||
<translation>Использую локаль: </translation>
|
||||
</message>
|
||||
|
@ -637,31 +673,41 @@
|
|||
<translation>Диалог</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="155"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="110"/>
|
||||
<source>Goods name position</source>
|
||||
<translation>Позиция имени товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="64"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="70"/>
|
||||
<source>Goods price per unit alias</source>
|
||||
<translation>Алиас цены товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="50"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="124"/>
|
||||
<source>Date name position</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="182"/>
|
||||
<source>Language</source>
|
||||
<translation>Язык</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="196"/>
|
||||
<source>Date name alias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TextLabel</source>
|
||||
<translation type="vanished">Язык</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="132"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="38"/>
|
||||
<source>en_US</source>
|
||||
<translation>en_US</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="137"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="43"/>
|
||||
<source>ru_RU</source>
|
||||
<translation>ru_RU</translation>
|
||||
</message>
|
||||
|
@ -670,12 +716,12 @@
|
|||
<translation type="vanished">Выбрать</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="104"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="80"/>
|
||||
<source>Print header</source>
|
||||
<translation>Печатать заголовок</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="57"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="189"/>
|
||||
<source>Goods net weight alias</source>
|
||||
<translation>Алиас массы нетто товара</translation>
|
||||
</message>
|
||||
|
@ -684,17 +730,17 @@
|
|||
<translation type="vanished">URL модулей магазина</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="97"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="165"/>
|
||||
<source>Goods total alias</source>
|
||||
<translation>Алиас всего за продукт</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="81"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="155"/>
|
||||
<source>Goods name alias</source>
|
||||
<translation>Алиас имени товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="37"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="51"/>
|
||||
<source>Goods quantity alias</source>
|
||||
<translation>Алиас количества товара</translation>
|
||||
</message>
|
||||
|
@ -707,12 +753,12 @@
|
|||
<translation type="vanished">Директория модулей ОФД</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="169"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="131"/>
|
||||
<source>Goods price per unit position</source>
|
||||
<translation>Позиция центы товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="124"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="97"/>
|
||||
<source>Goods net weight position</source>
|
||||
<translation>Позиция массы нетто товара</translation>
|
||||
</message>
|
||||
|
@ -721,17 +767,17 @@
|
|||
<translation type="vanished">URL модулей ОФД</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="114"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="145"/>
|
||||
<source>Goods total position</source>
|
||||
<translation>Позиция всего за товар</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="145"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="87"/>
|
||||
<source>Goods quantity position</source>
|
||||
<translation>Позиция количества товара</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../scenes/settingsdialog.ui" line="74"/>
|
||||
<location filename="../scenes/settingsdialog.ui" line="117"/>
|
||||
<source>Print total</source>
|
||||
<translation>Печатать Итого</translation>
|
||||
</message>
|
||||
|
|
|
@ -309,3 +309,15 @@ void generate_qr_code(std::string data) {
|
|||
}
|
||||
#endif // ifdef BUILD_OFD_BINARYEYE_SCAN
|
||||
|
||||
#ifdef BUILD_EMAIL_MODE
|
||||
std::vector<std::string> read_file(std::string path) {
|
||||
std::ifstream stream(path);
|
||||
std::vector<std::string> lines;
|
||||
std::string buffer;
|
||||
while(getline(stream, buffer)) {
|
||||
lines.push_back(buffer);
|
||||
}
|
||||
stream.close();
|
||||
return lines;
|
||||
}
|
||||
#endif // ifdef BUILD_EMAIL_MODE
|
||||
|
|
|
@ -31,5 +31,7 @@ std::string get_local_ip_address();
|
|||
#endif
|
||||
|
||||
void fetch_and_download_modules();
|
||||
|
||||
#ifdef BUILD_EMAIL_MODE
|
||||
std::vector<std::string> read_file(std::string path);
|
||||
#endif
|
||||
#endif // UTILS_H
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#include "checklistviewwidget.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <check/check.h>
|
||||
#include <iostream>
|
||||
|
||||
CheckListViewWidget::CheckListViewWidget(QWidget *parent, Check check) : QWidget(parent), check(check) {
|
||||
|
||||
std::cout << "I was created with check with date " << check.get_date() << std::endl;
|
||||
QHBoxLayout *layout = new QHBoxLayout;
|
||||
|
||||
QLabel *label1 = new QLabel(QString::fromStdString(check.get_date()));
|
||||
QLabel *label2 = new QLabel("Text 2");
|
||||
QLabel *label3 = new QLabel("Text 3");
|
||||
|
||||
QPushButton *deleteButton = new QPushButton(tr("Delete"));
|
||||
|
||||
deleteButton->connect(deleteButton, &QPushButton::clicked, this, &CheckListViewWidget::deleteButtonPressed);
|
||||
|
||||
layout->addWidget(label1);
|
||||
layout->addWidget(label2);
|
||||
layout->addWidget(label3);
|
||||
layout->addSpacing(10);
|
||||
layout->addWidget(deleteButton);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef CHECKLISTVIEWWIDGET_H
|
||||
#define CHECKLISTVIEWWIDGET_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
|
||||
#include <check/check.h>
|
||||
|
||||
class CheckListViewWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Check check;
|
||||
public:
|
||||
explicit CheckListViewWidget(QWidget *parent = nullptr, Check check = Check());
|
||||
|
||||
signals:
|
||||
Check deleteButtonPressed();
|
||||
};
|
||||
|
||||
#endif // CHECKLISTVIEWWIDGET_H
|
|
@ -0,0 +1,86 @@
|
|||
#include "tablewidgetmovable.hpp"
|
||||
#include <QDropEvent>
|
||||
#include <iostream>
|
||||
#include <QTableWidget>
|
||||
#include <qcoreevent.h>
|
||||
#include <QDebug>
|
||||
|
||||
TableWidgetMovable::TableWidgetMovable(QWidget *parent) : QTableWidget(parent) { }
|
||||
|
||||
// TOOD: fix None of these works. WIP
|
||||
|
||||
// void TableWidgetMovable::dropEvent(QDropEvent *event) {
|
||||
// std::cout << event->type() << std::endl;
|
||||
// if(event->source() == this && event->type() == QEvent::Type::Drop) {
|
||||
// int oldRow = this->selectedItems()[0]->row();
|
||||
// int oldColumn = this->selectedItems()[0]->column();
|
||||
|
||||
// int newRow = this->indexAt(event->pos()).row();
|
||||
// int newColumn = this->indexAt(event->pos()).column();
|
||||
|
||||
// auto oldCell = this->cellWidget(oldRow, oldColumn);
|
||||
// auto newCell = this->cellWidget(newRow, newColumn);
|
||||
|
||||
// this->removeCellWidget(oldRow, oldColumn);
|
||||
// this->removeCellWidget(newRow, newColumn);
|
||||
|
||||
// this->setCellWidget(newRow, newColumn, oldCell);
|
||||
// this->setCellWidget(oldRow, oldColumn, newCell);
|
||||
// event->accept();
|
||||
// }
|
||||
// }
|
||||
|
||||
// void TableWidgetMovable::dropEvent(QDropEvent *event) {
|
||||
// std::cout << event->type() << std::endl;
|
||||
// if(event->source() == this && event->type() == QEvent::Type::Drop) {
|
||||
// int oldRow = this->selectedItems()[0]->row();
|
||||
// int oldColumn = this->selectedItems()[0]->column();
|
||||
|
||||
// int newRow = this->indexAt(event->pos()).row();
|
||||
// int newColumn = this->indexAt(event->pos()).column();
|
||||
// std::cout << oldRow << " " << oldColumn<< " " << newRow << " " << newColumn << std::endl;
|
||||
// QTableWidgetItem *from = this->itemAt(oldColumn, oldRow), *to = this->itemAt(newColumn, newRow);
|
||||
|
||||
// // QList<QTableWidgetItem*> selectedItems = this->selectedItems();
|
||||
// if(newRow == -1) {
|
||||
// std::cout << newRow << std::endl;
|
||||
// // newRow = this->rowCount();
|
||||
// return;
|
||||
// }
|
||||
// // QTableWidgetItem bufferTo, bufferFrom;
|
||||
// QTableWidgetItem *bufferTo = new QTableWidgetItem("123"), *bufferFrom = new QTableWidgetItem("321");
|
||||
// std::cout << to->text().toStdString() << " " << from->text().toStdString() << std::endl;
|
||||
// *bufferTo = *to;
|
||||
// *bufferFrom = *from;
|
||||
// // this->setItem(newRow, newColumn, nullptr);
|
||||
// // this->setItem(oldRow, oldColumn, nullptr);
|
||||
// this->takeItem(newRow, newColumn);
|
||||
// this->takeItem(oldRow, oldColumn);
|
||||
// this->setItem(newRow, newColumn, from);
|
||||
// // this->setItem(oldRow, oldColumn, to);
|
||||
// // *to = *from;
|
||||
// // *from = buffer;
|
||||
// return;
|
||||
|
||||
// // int i;
|
||||
// // for(i = 0; i < selectedItems.length()/this->columnCount(); i++)
|
||||
// // this->insertRow(newRow);
|
||||
|
||||
// // int currentOldRow = -1;
|
||||
// // int currentNewRow = newRow-1;
|
||||
// // QList<int> deleteRows;
|
||||
// // foreach(selectedItem, selectedItems) {
|
||||
// // int column = selectedItem->column();
|
||||
// // if(selectedItem->row() != currentOldRow) {
|
||||
// // currentOldRow = selectedItem->row();
|
||||
// // deleteRows.append(currentOldRow);
|
||||
// // currentNewRow++;
|
||||
// // }
|
||||
// // this->takeItem(currentOldRow, column);
|
||||
// // this->setItem(currentNewRow, column, selectedItem);
|
||||
// // }
|
||||
|
||||
// // for(i = deleteRows.count()-1; i>=0; i--)
|
||||
// // this->removeRow(deleteRows.at(i));
|
||||
// }
|
||||
// }
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef TABLEWIDGETMOVABLE_HPP
|
||||
#define TABLEWIDGETMOVABLE_HPP
|
||||
|
||||
#include <QObject>
|
||||
#include <QTableWidget>
|
||||
#include <QWidget>
|
||||
|
||||
class TableWidgetMovable : public QTableWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TableWidgetMovable(QWidget *parent = nullptr);
|
||||
// void dropEvent(QDropEvent *event);
|
||||
// void swapRows(int row1, int row2);
|
||||
};
|
||||
|
||||
#endif // TABLEWIDGETMOVABLE_HPP
|
Loading…
Reference in New Issue