Bugfix - voucher items manipulation fixed.

This commit is contained in:
2023-06-02 11:58:13 +02:00
parent 46b2098ffc
commit 8b132c6c51
3 changed files with 21 additions and 6 deletions
+6 -2
View File
@@ -515,7 +515,6 @@ void ShopForm::recalculate()
{
ShopService srv;
srv.calculate(m_voucher);
this->m_itemsModel->setData(m_voucher->items());
setTotalText();
ui->temporarySaveButton->setEnabled(!m_voucher->items().isEmpty());
@@ -530,6 +529,9 @@ void ShopForm::recalculate()
{
srv.update(m_voucher);
}
this->m_itemsModel->setData(m_voucher->items());
connectItemSignals();
}
void ShopForm::on_receiptCombo_currentIndexChanged(int)
@@ -654,7 +656,9 @@ void ShopForm::on_actionDelete_items_triggered()
QList<VoucherItemPtr> forDelete;
for (const auto& row : ui->actualReceipt->selectionModel()->selectedIndexes()) {
forDelete << m_itemsModel->itemFromIndex(row);
if (!forDelete.contains(m_itemsModel->itemFromIndex(row))) {
forDelete << m_itemsModel->itemFromIndex(row);
}
}
for (auto& item : forDelete) {