Compare commits
No commits in common. "e295c6a743f99c9158c584aa162f417d52a81bf4" and "2cc7a288fe3931956b167d23e88a3968b9046f86" have entirely different histories.
e295c6a743
...
2cc7a288fe
8 changed files with 6 additions and 75 deletions
|
@ -2,8 +2,6 @@ set(Boost_USE_STATIC_LIBS ON)
|
|||
|
||||
find_package(Boost 1.62 COMPONENTS date_time REQUIRED)
|
||||
find_package(SQLite3 REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(XLNT REQUIRED xlnt)
|
||||
|
||||
set(CORE_SOURCES
|
||||
database.cpp
|
||||
|
@ -12,12 +10,9 @@ set(CORE_SOURCES
|
|||
article.cpp
|
||||
sale.cpp
|
||||
marketplace.cpp
|
||||
excelreader.cpp
|
||||
)
|
||||
|
||||
add_library(core STATIC ${CORE_SOURCES})
|
||||
target_link_libraries(core Boost::boost Boost::date_time sqlite3 ${XLNT_LIBRARIES})
|
||||
if (WIN32)
|
||||
target_link_libraries(core bcrypt)
|
||||
endif()
|
||||
target_link_libraries(core Boost::boost Boost::date_time)
|
||||
target_link_libraries(core sqlite3)
|
||||
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
@ -9,7 +9,11 @@ Entity::~Entity() = default;
|
|||
|
||||
void Entity::createUuid()
|
||||
{
|
||||
#if defined __linux__
|
||||
static boost::uuids::random_generator generator{};
|
||||
#elif defined __WIN32
|
||||
static boost::uuids::random_generator_mt19937 generator{};
|
||||
#endif
|
||||
uuid_ = generator();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#include "excelreader.h"
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
void ExcelReader::readSellersFromFile(const std::string& filename, Marketplace* market)
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load(filename);
|
||||
auto ws = wb.sheet_by_index(0);
|
||||
|
||||
const int START_ROW = 6;
|
||||
const int END_ROW = 349;
|
||||
|
||||
for (const auto& row : ws.rows(false)) {
|
||||
//auto test = row[0].value<int>();
|
||||
//std::cout << test << "\n";
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef EXCEL_READER_H
|
||||
#define EXCEL_READER_H
|
||||
|
||||
#include "seller.h"
|
||||
#include "marketplace.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class ExcelReader
|
||||
{
|
||||
public:
|
||||
static void readSellersFromFile(const std::string& filename,
|
||||
Marketplace* market);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
class ExcelReader;
|
||||
|
||||
namespace
|
||||
{
|
||||
using SellersVec = std::vector<std::unique_ptr<Seller>>;
|
||||
|
@ -51,8 +49,6 @@ class Marketplace
|
|||
|
||||
void exportReportToCSV(const std::string& filename, int feeInPercent, int maxFeeInEuro);
|
||||
|
||||
friend class ExcelReader;
|
||||
|
||||
private:
|
||||
SellersVec sellers_;
|
||||
SalesVec sales_;
|
||||
|
|
|
@ -8,11 +8,8 @@
|
|||
#include "sellerdialog.h"
|
||||
#include "settingsdialog.h"
|
||||
|
||||
#include <excelreader.h>
|
||||
|
||||
#include <regex>
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
|
||||
|
@ -61,8 +58,6 @@ MainWindow::MainWindow()
|
|||
this->setWindowTitle("KIMA2 - Kasse Nr. " +
|
||||
QSettings().value("global/cashPointNo").toString());
|
||||
});
|
||||
connect(ui_.importExcelAction, &QAction::triggered, this,
|
||||
&MainWindow::onImportExcelActionTriggered);
|
||||
}
|
||||
|
||||
void MainWindow::onActionEditSellerTriggered()
|
||||
|
@ -238,19 +233,3 @@ void MainWindow::onAbout()
|
|||
"<p>Copyright © Martin Brodbeck <<a href=mailto:martin@brodbeck-online.de"
|
||||
">info@rustysoft.de</a>></p>");
|
||||
}
|
||||
|
||||
void MainWindow::onImportExcelActionTriggered()
|
||||
{
|
||||
if (!marketplace_->getSales().empty()) {
|
||||
QMessageBox(QMessageBox::Icon::Information, "Import nicht möglich",
|
||||
"Der Import ist nicht möglich, da schon Verkäufe getätigt wurden.",
|
||||
QMessageBox::StandardButton::Ok, this)
|
||||
.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
auto filename = QFileDialog::getOpenFileName(this, "Verkäufer importieren", QString(),
|
||||
"Excel Dateien (*.xlsx *.xls)");
|
||||
|
||||
ExcelReader::readSellersFromFile(filename.toStdString(), marketplace_.get());
|
||||
}
|
|
@ -32,7 +32,6 @@ class MainWindow : public QMainWindow
|
|||
void onActionEditSellerTriggered();
|
||||
void onSellerNoEditCheckSellerNo();
|
||||
void onPaidButtonTriggered();
|
||||
void onImportExcelActionTriggered();
|
||||
void setSaleModel();
|
||||
|
||||
Ui::MainWindow ui_;
|
||||
|
|
|
@ -404,7 +404,6 @@ drucken</string>
|
|||
<string>&Verkäufer</string>
|
||||
</property>
|
||||
<addaction name="actionEditSeller"/>
|
||||
<addaction name="importExcelAction"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHilfe">
|
||||
<property name="title">
|
||||
|
@ -459,11 +458,6 @@ drucken</string>
|
|||
<string>Auswertung</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="importExcelAction">
|
||||
<property name="text">
|
||||
<string>Importieren (Excel)</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Reference in a new issue