started with xls import
This commit is contained in:
parent
7d405234d4
commit
e295c6a743
7 changed files with 73 additions and 4 deletions
|
@ -8,8 +8,11 @@
|
|||
#include "sellerdialog.h"
|
||||
#include "settingsdialog.h"
|
||||
|
||||
#include <excelreader.h>
|
||||
|
||||
#include <regex>
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
|
||||
|
@ -58,6 +61,8 @@ MainWindow::MainWindow()
|
|||
this->setWindowTitle("KIMA2 - Kasse Nr. " +
|
||||
QSettings().value("global/cashPointNo").toString());
|
||||
});
|
||||
connect(ui_.importExcelAction, &QAction::triggered, this,
|
||||
&MainWindow::onImportExcelActionTriggered);
|
||||
}
|
||||
|
||||
void MainWindow::onActionEditSellerTriggered()
|
||||
|
@ -232,4 +237,20 @@ void MainWindow::onAbout()
|
|||
"<p>KIMA2 ist ein kleines Kassenprogramm für Kindersachenmärkte.<p />"
|
||||
"<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,6 +32,7 @@ class MainWindow : public QMainWindow
|
|||
void onActionEditSellerTriggered();
|
||||
void onSellerNoEditCheckSellerNo();
|
||||
void onPaidButtonTriggered();
|
||||
void onImportExcelActionTriggered();
|
||||
void setSaleModel();
|
||||
|
||||
Ui::MainWindow ui_;
|
||||
|
|
|
@ -404,6 +404,7 @@ drucken</string>
|
|||
<string>&Verkäufer</string>
|
||||
</property>
|
||||
<addaction name="actionEditSeller"/>
|
||||
<addaction name="importExcelAction"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHilfe">
|
||||
<property name="title">
|
||||
|
@ -458,6 +459,11 @@ drucken</string>
|
|||
<string>Auswertung</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="importExcelAction">
|
||||
<property name="text">
|
||||
<string>Importieren (Excel)</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue