Make commune configurable (Default is still Dettingen)
This commit is contained in:
parent
bc9e395ee9
commit
cac9ee9e30
6 changed files with 47 additions and 24 deletions
|
@ -387,7 +387,7 @@ void MainWindow::onPrintSaleReceiptButtonClicked([[maybe_unused]] bool checked)
|
|||
}
|
||||
|
||||
if (printer->isValid())
|
||||
printer->printSaleReceipt(sale.get());
|
||||
printer->printSaleReceipt(sale.get(), settings.value("global/commune", "Dettingen").toString().toStdString());
|
||||
}
|
||||
|
||||
void MainWindow::onCancelAllArticlesButtonClicked([[maybe_unused]] bool checked)
|
||||
|
|
|
@ -207,7 +207,9 @@ void ReportDialog::onPrintSellerReceiptButtonClicked()
|
|||
}
|
||||
|
||||
if (printer->isValid())
|
||||
printer->printSellerReceipt(seller.get(), feeInPercent, maxFeeInEuro * 100);
|
||||
printer->printSellerReceipt(
|
||||
seller.get(), feeInPercent, maxFeeInEuro * 100,
|
||||
settings.value("global/commune", "Dettingen").toString().toStdString());
|
||||
}
|
||||
|
||||
void ReportDialog::onReportViewSelectionChanged(const QItemSelection& selected,
|
||||
|
|
|
@ -18,6 +18,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
|
|||
|
||||
QSettings settings{};
|
||||
int cashPointNo = settings.value("global/cashPointNo").toInt();
|
||||
QString commune = settings.value("global/commune", "Dettingen").toString();
|
||||
QString posPrinterDevice = settings.value("global/posPrinterDevice").toString();
|
||||
QString posPrinterEndpoint = settings.value("global/posPrinterEndpoint").toString();
|
||||
int feeInPercent = settings.value("global/feeInPercent").toInt();
|
||||
|
@ -27,6 +28,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
|
|||
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
||||
|
||||
ui_.cashPointNoSpinBox->setValue(cashPointNo);
|
||||
ui_.communeEdit->setText(commune);
|
||||
ui_.posPrinterDeviceEdit->setText(posPrinterDevice);
|
||||
ui_.posPrinterEndpointEdit->setText(posPrinterEndpoint);
|
||||
ui_.feePercentSpinBox->setValue(feeInPercent);
|
||||
|
@ -79,6 +81,7 @@ void SettingsDialog::accept()
|
|||
int oldCashPointNo = settings.value("global/cashPointNo").toInt();
|
||||
int newCashPointNo = ui_.cashPointNoSpinBox->value();
|
||||
|
||||
settings.setValue("global/commune", ui_.communeEdit->text().trimmed());
|
||||
settings.setValue("global/posPrinterDevice", ui_.posPrinterDeviceEdit->text().trimmed());
|
||||
settings.setValue("global/posPrinterEndpoint", ui_.posPrinterEndpointEdit->text().trimmed());
|
||||
settings.setValue("global/feeInPercent", ui_.feePercentSpinBox->value());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>242</height>
|
||||
<height>246</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -24,14 +24,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Bondrucker:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="posPrinterDeviceEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
|
@ -47,42 +47,49 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="testPosPrinterButton">
|
||||
<property name="text">
|
||||
<string>Testen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Gebühr in %:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="feePercentSpinBox">
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>max. Gebühr in €:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="maxFeeSpinBox">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="4">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="posPrinterEndpointEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Endpoint Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="4">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -92,10 +99,20 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="posPrinterEndpointEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Endpoint Address</string>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Gemeinde:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="communeEdit">
|
||||
<property name="text">
|
||||
<string>Dettingen</string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue