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
+7 -1
View File
@@ -131,7 +131,13 @@ void Voucher::addItem(QSharedPointer<VoucherItem> item)
void Voucher::removeItem(QSharedPointer<VoucherItem> item)
{
m_items.removeOne(item);
if (item->id() != 0) {
m_items.removeIf([&item](const auto& it){
return item->id() == it->id();
});
} else {
m_items.removeOne(item);
}
}
void Voucher::clearItems()