handle "Sonderkonto" in imports
This commit is contained in:
parent
410eb775aa
commit
d1c5d3a6f8
4 changed files with 47 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "settingsdialog.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <database.h>
|
||||
#include <posprinter.h>
|
||||
|
||||
|
@ -18,6 +20,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
|
|||
int feeInPercent = settings.value("global/feeInPercent").toInt();
|
||||
int maxFeeInEuro = settings.value("global/maxFeeInEuro").toInt();
|
||||
|
||||
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
||||
|
||||
ui_.cashPointNoSpinBox->setValue(cashPointNo);
|
||||
// ui_.posPrinterDeviceEdit->setText(posPrinterDevice);
|
||||
ui_.feePercentSpinBox->setValue(feeInPercent);
|
||||
|
@ -56,12 +60,17 @@ void SettingsDialog::accept()
|
|||
settings.setValue("global/maxFeeInEuro", ui_.maxFeeSpinBox->value());
|
||||
|
||||
if (oldCashPointNo != newCashPointNo) {
|
||||
int result =
|
||||
QMessageBox(QMessageBox::Icon::Question, "Sind Sie sicher?",
|
||||
"Möchten Sie die Kassen-Nr wirklich ändern? Diese muss über alle "
|
||||
"Installationen hinweg eindeutig sein.",
|
||||
QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this)
|
||||
.exec();
|
||||
int result{0};
|
||||
if (market_->getSales().size() > 0) {
|
||||
result = QMessageBox(QMessageBox::Icon::Question, "Sind Sie sicher?",
|
||||
"Möchten Sie die Kassen-Nr wirklich ändern? Diese muss über alle "
|
||||
"Installationen hinweg eindeutig sein.",
|
||||
QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No,
|
||||
this)
|
||||
.exec();
|
||||
} else {
|
||||
result = QMessageBox::Yes;
|
||||
}
|
||||
if (result == QMessageBox::Yes) {
|
||||
try {
|
||||
Database().updateCashPointNo(oldCashPointNo, newCashPointNo);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "ui_settingsdialog.h"
|
||||
|
||||
#include <marketplace.h>
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class SettingsDialog : public QDialog
|
||||
|
@ -16,6 +18,7 @@ class SettingsDialog : public QDialog
|
|||
|
||||
private:
|
||||
Ui::SettingsDialog ui_;
|
||||
Marketplace* market_{};
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue