Bugfix - voucher items manipulation fixed.
This commit is contained in:
+6
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user