Compare commits
No commits in common. "245e41bbf074e8f234473b90a427e245dbf59cb5" and "c4ccd43b45d473f7ce9d7578a94ec601c6ebdb18" have entirely different histories.
245e41bbf0
...
c4ccd43b45
4 changed files with 70 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.8)
|
||||||
|
|
||||||
project(kima2 VERSION 1.7.1)
|
project(kima2 VERSION 1.7.0)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/cmake")
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,10 @@ MainWindow::MainWindow()
|
||||||
});
|
});
|
||||||
connect(m_ui.importSellerAction, &QAction::triggered, this,
|
connect(m_ui.importSellerAction, &QAction::triggered, this,
|
||||||
&MainWindow::onImportSellerActionTriggered);
|
&MainWindow::onImportSellerActionTriggered);
|
||||||
|
connect(m_ui.importSellerJsonAction, &QAction::triggered, this,
|
||||||
|
&MainWindow::onImportSellerJsonActionTriggered);
|
||||||
|
connect(m_ui.exportSellerJsonAction, &QAction::triggered, this,
|
||||||
|
&MainWindow::onExportSellerJsonActionTriggered);
|
||||||
connect(m_ui.exportSalesJsonAction, &QAction::triggered, this,
|
connect(m_ui.exportSalesJsonAction, &QAction::triggered, this,
|
||||||
&MainWindow::onExportSalesJsonActionTriggered);
|
&MainWindow::onExportSalesJsonActionTriggered);
|
||||||
connect(m_ui.importSalesJsonAction, &QAction::triggered, this,
|
connect(m_ui.importSalesJsonAction, &QAction::triggered, this,
|
||||||
|
@ -479,6 +483,59 @@ void MainWindow::onImportSellerActionTriggered()
|
||||||
.exec();
|
.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onImportSellerJsonActionTriggered()
|
||||||
|
{
|
||||||
|
if (!m_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(),
|
||||||
|
"JSON Dateien (*.json)");
|
||||||
|
|
||||||
|
if (filename.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
#if defined(_WIN64) || defined(_WIN32)
|
||||||
|
fs::path filePath(filename.toStdWString());
|
||||||
|
#else
|
||||||
|
fs::path filePath(filename.toStdString());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::size_t numImported{};
|
||||||
|
numImported = JsonUtil::importSellers(filePath, m_marketplace.get());
|
||||||
|
|
||||||
|
updateStatLabel();
|
||||||
|
|
||||||
|
using namespace std::string_literals;
|
||||||
|
std::ostringstream msg;
|
||||||
|
msg << "Aus der JSON-Datei wurden <b>"s << std::to_string(numImported)
|
||||||
|
<< "</b> Verkäufer importiert.";
|
||||||
|
QMessageBox(QMessageBox::Icon::Information, "Verkäufer erfolgreich importiert",
|
||||||
|
msg.str().c_str(), QMessageBox::StandardButton::Ok, this)
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::onExportSellerJsonActionTriggered()
|
||||||
|
{
|
||||||
|
auto filename = QFileDialog::getSaveFileName(
|
||||||
|
this, "Verkäufer exportieren", QString("kima2_verkaeufer.json"), "JSON Dateien (*.json)");
|
||||||
|
|
||||||
|
if (filename.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
#if defined(_WIN64) || defined(_WIN32)
|
||||||
|
fs::path filePath(filename.toStdWString());
|
||||||
|
#else
|
||||||
|
fs::path filePath(filename.toStdString());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
JsonUtil::exportSellers(filePath, m_marketplace.get());
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onExportSalesJsonActionTriggered()
|
void MainWindow::onExportSalesJsonActionTriggered()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
|
@ -40,6 +40,8 @@ class MainWindow : public QMainWindow
|
||||||
void onPaidButtonTriggered();
|
void onPaidButtonTriggered();
|
||||||
void onGivenSpinBoxValueChanged(double value);
|
void onGivenSpinBoxValueChanged(double value);
|
||||||
void onImportSellerActionTriggered();
|
void onImportSellerActionTriggered();
|
||||||
|
void onImportSellerJsonActionTriggered();
|
||||||
|
void onExportSellerJsonActionTriggered();
|
||||||
void onExportSalesJsonActionTriggered();
|
void onExportSalesJsonActionTriggered();
|
||||||
void onImportSalesJsonActionTriggered();
|
void onImportSalesJsonActionTriggered();
|
||||||
void setSaleModel();
|
void setSaleModel();
|
||||||
|
|
|
@ -440,8 +440,16 @@ drucken</string>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Verkäufer</string>
|
<string>&Verkäufer</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionEditSeller"/>
|
<widget class="QMenu" name="importSellerMenu">
|
||||||
|
<property name="title">
|
||||||
|
<string>Importieren</string>
|
||||||
|
</property>
|
||||||
<addaction name="importSellerAction"/>
|
<addaction name="importSellerAction"/>
|
||||||
|
<addaction name="importSellerJsonAction"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="actionEditSeller"/>
|
||||||
|
<addaction name="importSellerMenu"/>
|
||||||
|
<addaction name="exportSellerJsonAction"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuHilfe">
|
<widget class="QMenu" name="menuHilfe">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -505,7 +513,7 @@ drucken</string>
|
||||||
<string>Exportieren für andere Kasse (JSON)</string>
|
<string>Exportieren für andere Kasse (JSON)</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="importSellerActionX">
|
<action name="importSellerAction">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Aus CSV-Datei (initial)</string>
|
<string>Aus CSV-Datei (initial)</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -540,11 +548,6 @@ drucken</string>
|
||||||
<string>Lizenz</string>
|
<string>Lizenz</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="importSellerAction">
|
|
||||||
<property name="text">
|
|
||||||
<string>Importieren (aus CSV-Datei)</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
Loading…
Reference in a new issue