Allow to print multiple seller recipes.
This commit is contained in:
parent
8a5038e462
commit
98a9fe0069
3 changed files with 10 additions and 7 deletions
|
@ -201,7 +201,6 @@ void ReportDialog::onPrintSellerReceiptButtonClicked()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto indexes = selModel->selectedRows();
|
auto indexes = selModel->selectedRows();
|
||||||
auto &seller = m_market->getSellers().at(indexes[0].row());
|
|
||||||
|
|
||||||
auto printerDevice =
|
auto printerDevice =
|
||||||
convertToPosPrinterDevice(posPrinterDevice.toStdString(), posPrinterEndpoint.toStdString());
|
convertToPosPrinterDevice(posPrinterDevice.toStdString(), posPrinterEndpoint.toStdString());
|
||||||
|
@ -214,11 +213,15 @@ void ReportDialog::onPrintSellerReceiptButtonClicked()
|
||||||
printer = std::make_unique<PosPrinter>();
|
printer = std::make_unique<PosPrinter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printer->isValid())
|
if (printer->isValid()) {
|
||||||
|
for (const auto &index : indexes) {
|
||||||
|
auto &seller = m_market->getSellers().at(index.row());
|
||||||
printer->printSellerReceipt(
|
printer->printSellerReceipt(
|
||||||
seller.get(), feeInPercent, maxFeeInEuro * 100,
|
seller.get(), feeInPercent, maxFeeInEuro * 100,
|
||||||
settings.value("global/commune", "Dettingen").toString().toStdString());
|
settings.value("global/commune", "Dettingen").toString().toStdString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReportDialog::onReportViewSelectionChanged(const QItemSelection &selected,
|
void ReportDialog::onReportViewSelectionChanged(const QItemSelection &selected,
|
||||||
[[maybe_unused]] const QItemSelection &deselected)
|
[[maybe_unused]] const QItemSelection &deselected)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="reportView">
|
<widget class="QTableView" name="reportView">
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::MultiSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
|
|
@ -202,7 +202,7 @@ void PosPrinter::printSellerReceipt(Seller* seller, const int percent, const int
|
||||||
<< marketFeeAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n";
|
<< marketFeeAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n";
|
||||||
commandStream << "\nAuszahlung............. "
|
commandStream << "\nAuszahlung............. "
|
||||||
<< paymentAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n";
|
<< paymentAsString(seller->sumInCents(), percent, maxFeeInCent) << "\n";
|
||||||
commandStream << Command::FEED;
|
commandStream << Command::FEED << Command::FEED;
|
||||||
|
|
||||||
write(commandStream.str());
|
write(commandStream.str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue